Merge 95cf12a23bb6c580d180d6a4a88c9958c828af1e into f21c1d51bcdc322df5d4857391a9c43ef8850136

This commit is contained in:
Kennedy Oliveira 2025-06-05 01:13:45 +02:00 committed by GitHub
commit 4cd1838438
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 13 additions and 4 deletions

View File

@ -16,5 +16,5 @@ jobs:
name: Auto Tag
uses: Klemensas/action-autotag@stable
with:
GITHUB_TOKEN: "${{ secrets.GH_PAT }}"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
tag_prefix: "v"

View File

@ -28,7 +28,7 @@ jobs:
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
@ -61,7 +61,7 @@ jobs:
- name: Upload release artifacts
uses: alexellis/upload-assets@0.4.0
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["./dist/flaresolverr_*"]'
@ -90,6 +90,6 @@ jobs:
- name: Upload release artifacts
uses: alexellis/upload-assets@0.4.0
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["./dist/flaresolverr_*"]'

View File

@ -188,6 +188,7 @@ session. When you no longer need to use a session you should make sure to close
| cookies | Optional. Will be used by the headless browser. Eg: `"cookies": [{"name": "cookie1", "value": "value1"}, {"name": "cookie2", "value": "value2"}]`. |
| returnOnlyCookies | Optional, default false. Only returns the cookies. Response data, headers and other parts of the response are removed. |
| proxy | Optional, default disabled. Eg: `"proxy": {"url": "http://127.0.0.1:8888"}`. You must include the proxy schema in the URL: `http://`, `socks4://` or `socks5://`. Authorization (username/password) is not supported. (When the `session` parameter is set, the proxy is ignored; a session specific proxy can be set in `sessions.create`.) |
| waitInSeconds | Optional, default none, how long to wait with the page open after solving the challenge and before returning the results, useful to allow it to load dynamic content. |
> **Warning**
> If you want to use Cloudflare clearance cookie in your scripts, make sure you use the FlareSolverr User-Agent too. If they don't match you will see the challenge.

View File

@ -43,6 +43,9 @@ class V1RequestBase(object):
returnOnlyCookies: bool = None
download: bool = None # deprecated v2.0.0, not used
returnRawHtml: bool = None # deprecated v2.0.0, not used
# Wait the specified amount in seconds after resolving the challenge and before returning the response
# this can be useful for loading dynamic content of the page
waitInSeconds: int = None
def __init__(self, _dict):
self.__dict__.update(_dict)

View File

@ -390,6 +390,11 @@ def _evil_logic(req: V1RequestBase, driver: WebDriver, method: str) -> Challenge
if not req.returnOnlyCookies:
challenge_res.headers = {} # todo: fix, selenium not provides this info
if req.waitInSeconds and req.waitInSeconds > 0:
logging.info("Waiting " + str(req.waitInSeconds) + " seconds before returning the response...")
time.sleep(req.waitInSeconds)
challenge_res.response = driver.page_source
res.result = challenge_res