mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2026-01-07 09:32:50 +01:00
Compare commits
4 Commits
v3.3.14-ho
...
v3.3.15
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aaf29be8e1 | ||
|
|
800866d033 | ||
|
|
043f18b231 | ||
|
|
d21a332519 |
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## v3.3.15 (2024/02/20)
|
||||
|
||||
* Fix looping challenges
|
||||
|
||||
## v3.3.14-hotfix2 (2024/02/17)
|
||||
|
||||
* Hotfix 2 - bad Chromium build, instances failed to terminate
|
||||
|
||||
## v3.3.14-hotfix (2024/02/17)
|
||||
|
||||
* Hotfix for Linux build - some Chrome files no longer exist
|
||||
|
||||
10
Dockerfile
10
Dockerfile
@@ -62,17 +62,17 @@ ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||||
CMD ["/usr/local/bin/python", "-u", "/app/flaresolverr.py"]
|
||||
|
||||
# Local build
|
||||
# docker build -t ngosang/flaresolverr:3.3.14-hotfix .
|
||||
# docker run -p 8191:8191 ngosang/flaresolverr:3.3.14-hotfix
|
||||
# docker build -t ngosang/flaresolverr:3.3.15 .
|
||||
# docker run -p 8191:8191 ngosang/flaresolverr:3.3.15
|
||||
|
||||
# Multi-arch build
|
||||
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||
# docker buildx create --use
|
||||
# docker buildx build -t ngosang/flaresolverr:3.3.14-hotfix --platform linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8 .
|
||||
# docker buildx build -t ngosang/flaresolverr:3.3.15 --platform linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8 .
|
||||
# add --push to publish in DockerHub
|
||||
|
||||
# Test multi-arch build
|
||||
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||
# docker buildx create --use
|
||||
# docker buildx build -t ngosang/flaresolverr:3.3.14-hotfix --platform linux/arm/v7 --load .
|
||||
# docker run -p 8191:8191 --platform linux/arm/v7 ngosang/flaresolverr:3.3.14-hotfix
|
||||
# docker buildx build -t ngosang/flaresolverr:3.3.15 --platform linux/arm/v7 --load .
|
||||
# docker run -p 8191:8191 --platform linux/arm/v7 ngosang/flaresolverr:3.3.15
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "flaresolverr",
|
||||
"version": "3.3.14-hotfix",
|
||||
"version": "3.3.15",
|
||||
"description": "Proxy server to bypass Cloudflare protection",
|
||||
"author": "Diego Heras (ngosang / ngosang@hotmail.es)",
|
||||
"license": "MIT"
|
||||
|
||||
@@ -25,7 +25,7 @@ def clean_files():
|
||||
|
||||
def download_chromium():
|
||||
# https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Linux_x64/
|
||||
revision = "1250005" if os.name == 'nt' else '1250006'
|
||||
revision = "1260008" if os.name == 'nt' else '1260015'
|
||||
arch = 'Win_x64' if os.name == 'nt' else 'Linux_x64'
|
||||
dl_file = 'chrome-win' if os.name == 'nt' else 'chrome-linux'
|
||||
dl_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, 'dist_chrome')
|
||||
|
||||
@@ -287,20 +287,35 @@ def click_verify(driver: WebDriver):
|
||||
time.sleep(2)
|
||||
|
||||
|
||||
def get_correct_window(driver: WebDriver) -> WebDriver:
|
||||
if len(driver.window_handles) > 1:
|
||||
for window_handle in driver.window_handles:
|
||||
driver.switch_to.window(window_handle)
|
||||
current_url = driver.current_url
|
||||
if not current_url.startswith("devtools://devtools"):
|
||||
return driver
|
||||
return driver
|
||||
|
||||
|
||||
def access_page(driver: WebDriver, url: str) -> None:
|
||||
driver.get(url)
|
||||
driver.start_session()
|
||||
driver.start_session() # required to bypass Cloudflare
|
||||
|
||||
|
||||
def _evil_logic(req: V1RequestBase, driver: WebDriver, method: str) -> ChallengeResolutionT:
|
||||
res = ChallengeResolutionT({})
|
||||
res.status = STATUS_OK
|
||||
res.message = ""
|
||||
|
||||
|
||||
# navigate to the page
|
||||
logging.debug(f'Navigating to... {req.url}')
|
||||
driver.get(req.url)
|
||||
driver.start_session() # required to bypass Cloudflare
|
||||
if method == 'POST':
|
||||
_post_request(req, driver)
|
||||
else:
|
||||
driver.get(req.url)
|
||||
driver.start_session() # required to bypass Cloudflare
|
||||
access_page(driver, req.url)
|
||||
driver = get_correct_window(driver)
|
||||
|
||||
# set cookies if required
|
||||
if req.cookies is not None and len(req.cookies) > 0:
|
||||
@@ -312,8 +327,8 @@ def _evil_logic(req: V1RequestBase, driver: WebDriver, method: str) -> Challenge
|
||||
if method == 'POST':
|
||||
_post_request(req, driver)
|
||||
else:
|
||||
driver.get(req.url)
|
||||
driver.start_session() # required to bypass Cloudflare
|
||||
access_page(driver, req.url)
|
||||
driver = get_correct_window(driver)
|
||||
|
||||
# wait for the page
|
||||
if utils.get_config_log_html():
|
||||
@@ -433,4 +448,5 @@ def _post_request(req: V1RequestBase, driver: WebDriver):
|
||||
</body>
|
||||
</html>"""
|
||||
driver.get("data:text/html;charset=utf-8," + html_content)
|
||||
driver.start_session()
|
||||
driver.start_session() # required to bypass Cloudflare
|
||||
|
||||
@@ -17,7 +17,7 @@ by UltrafunkAmsterdam (https://github.com/ultrafunkamsterdam)
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
__version__ = "3.5.4"
|
||||
__version__ = "3.5.5"
|
||||
|
||||
import json
|
||||
import logging
|
||||
|
||||
@@ -164,6 +164,8 @@ def get_webdriver(proxy: dict = None) -> WebDriver:
|
||||
# For normal headless mode:
|
||||
# options.add_argument('--headless')
|
||||
|
||||
options.add_argument("--auto-open-devtools-for-tabs")
|
||||
|
||||
# if we are inside the Docker container, we avoid downloading the driver
|
||||
driver_exe_path = None
|
||||
version_main = None
|
||||
|
||||
Reference in New Issue
Block a user