mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2025-12-06 09:38:49 +01:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
644a843d89 | ||
|
|
82e1c94c6f | ||
|
|
fbc71516f5 | ||
|
|
40bd1cba4c | ||
|
|
d1588c1156 | ||
|
|
b4ad583baa | ||
|
|
5d31e551cc |
@@ -1,5 +1,14 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v3.3.1 (2023/08/03)
|
||||||
|
|
||||||
|
* Fix for Cloudflare verify checkbox
|
||||||
|
* Fix HEADLESS=false in Windows binary
|
||||||
|
* Fix Prometheus exporter for management and health endpoints
|
||||||
|
* Remove misleading stack trace when the verify checkbox is not found
|
||||||
|
* Revert "Update base Docker image to Debian Bookworm" #849
|
||||||
|
* Revert "Install Chromium 115 from Debian testing" #849
|
||||||
|
|
||||||
## v3.3.0 (2023/08/02)
|
## v3.3.0 (2023/08/02)
|
||||||
|
|
||||||
* Fix for new Cloudflare detection. Thanks @cedric-bour for #845
|
* Fix for new Cloudflare detection. Thanks @cedric-bour for #845
|
||||||
|
|||||||
22
Dockerfile
22
Dockerfile
@@ -1,4 +1,4 @@
|
|||||||
FROM python:3.11-slim-bookworm as builder
|
FROM python:3.11-slim-bullseye as builder
|
||||||
|
|
||||||
# Build dummy packages to skip installing them and their dependencies
|
# Build dummy packages to skip installing them and their dependencies
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
@@ -12,7 +12,7 @@ RUN apt-get update \
|
|||||||
&& equivs-build adwaita-icon-theme \
|
&& equivs-build adwaita-icon-theme \
|
||||||
&& mv adwaita-icon-theme_*.deb /adwaita-icon-theme.deb
|
&& mv adwaita-icon-theme_*.deb /adwaita-icon-theme.deb
|
||||||
|
|
||||||
FROM python:3.11-slim-bookworm
|
FROM python:3.11-slim-bullseye
|
||||||
|
|
||||||
# Copy dummy packages
|
# Copy dummy packages
|
||||||
COPY --from=builder /*.deb /
|
COPY --from=builder /*.deb /
|
||||||
@@ -27,16 +27,12 @@ WORKDIR /app
|
|||||||
# Install dummy packages
|
# Install dummy packages
|
||||||
RUN dpkg -i /libgl1-mesa-dri.deb \
|
RUN dpkg -i /libgl1-mesa-dri.deb \
|
||||||
&& dpkg -i /adwaita-icon-theme.deb \
|
&& dpkg -i /adwaita-icon-theme.deb \
|
||||||
# Use Testing packages. The latest version of Chromium is not available for ARM
|
|
||||||
&& sed -i 's/bookworm-updates/bookworm-updates testing/g' /etc/apt/sources.list.d/debian.sources \
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends -t testing chromium chromium-common chromium-driver xvfb dumb-init \
|
&& apt-get install -y --no-install-recommends chromium chromium-common chromium-driver xvfb dumb-init \
|
||||||
procps curl vim-tiny xauth \
|
procps curl vim xauth \
|
||||||
# Remove temporary files and hardware decoding libraries
|
# Remove temporary files and hardware decoding libraries
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& rm -f /usr/lib/systemd/systemd* \
|
|
||||||
&& rm -f /usr/lib/x86_64-linux-gnu/systemd/* \
|
|
||||||
&& rm -f /usr/lib/x86_64-linux-gnu/libmfxhw* \
|
&& rm -f /usr/lib/x86_64-linux-gnu/libmfxhw* \
|
||||||
&& rm -f /usr/lib/x86_64-linux-gnu/mfx/* \
|
&& rm -f /usr/lib/x86_64-linux-gnu/mfx/* \
|
||||||
# Create flaresolverr user
|
# Create flaresolverr user
|
||||||
@@ -66,17 +62,17 @@ ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
|||||||
CMD ["/usr/local/bin/python", "-u", "/app/flaresolverr.py"]
|
CMD ["/usr/local/bin/python", "-u", "/app/flaresolverr.py"]
|
||||||
|
|
||||||
# Local build
|
# Local build
|
||||||
# docker build -t ngosang/flaresolverr:3.3.0 .
|
# docker build -t ngosang/flaresolverr:3.3.1 .
|
||||||
# docker run -p 8191:8191 ngosang/flaresolverr:3.3.0
|
# docker run -p 8191:8191 ngosang/flaresolverr:3.3.1
|
||||||
|
|
||||||
# Multi-arch build
|
# Multi-arch build
|
||||||
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||||
# docker buildx create --use
|
# docker buildx create --use
|
||||||
# docker buildx build -t ngosang/flaresolverr:3.3.0 --platform linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8 .
|
# docker buildx build -t ngosang/flaresolverr:3.3.1 --platform linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8 .
|
||||||
# add --push to publish in DockerHub
|
# add --push to publish in DockerHub
|
||||||
|
|
||||||
# Test multi-arch build
|
# Test multi-arch build
|
||||||
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||||
# docker buildx create --use
|
# docker buildx create --use
|
||||||
# docker buildx build -t ngosang/flaresolverr:3.3.0 --platform linux/arm/v7 --load .
|
# docker buildx build -t ngosang/flaresolverr:3.3.1 --platform linux/arm/v7 --load .
|
||||||
# docker run -p 8191:8191 --platform linux/arm/v7 ngosang/flaresolverr:3.3.0
|
# docker run -p 8191:8191 --platform linux/arm/v7 ngosang/flaresolverr:3.3.1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "flaresolverr",
|
"name": "flaresolverr",
|
||||||
"version": "3.3.0",
|
"version": "3.3.1",
|
||||||
"description": "Proxy server to bypass Cloudflare protection",
|
"description": "Proxy server to bypass Cloudflare protection",
|
||||||
"author": "Diego Heras (ngosang / ngosang@hotmail.es)",
|
"author": "Diego Heras (ngosang / ngosang@hotmail.es)",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
|||||||
@@ -33,6 +33,10 @@ def prometheus_plugin(callback):
|
|||||||
def export_metrics(actual_response):
|
def export_metrics(actual_response):
|
||||||
res = V1ResponseBase(actual_response)
|
res = V1ResponseBase(actual_response)
|
||||||
|
|
||||||
|
if res.startTimestamp is None or res.endTimestamp is None:
|
||||||
|
# skip management and healthcheck endpoints
|
||||||
|
return
|
||||||
|
|
||||||
domain = "unknown"
|
domain = "unknown"
|
||||||
if res.solution and res.solution.url:
|
if res.solution and res.solution.url:
|
||||||
parsed_url = urllib.parse.urlparse(res.solution.url)
|
parsed_url = urllib.parse.urlparse(res.solution.url)
|
||||||
|
|||||||
@@ -62,6 +62,12 @@ if __name__ == "__main__":
|
|||||||
if sys.version_info < (3, 9):
|
if sys.version_info < (3, 9):
|
||||||
raise Exception("The Python version is less than 3.9, a version equal to or higher is required.")
|
raise Exception("The Python version is less than 3.9, a version equal to or higher is required.")
|
||||||
|
|
||||||
|
# fix for HEADLESS=false in Windows binary
|
||||||
|
# https://stackoverflow.com/a/27694505
|
||||||
|
if os.name == 'nt':
|
||||||
|
import multiprocessing
|
||||||
|
multiprocessing.freeze_support()
|
||||||
|
|
||||||
# fix ssl certificates for compiled binaries
|
# fix ssl certificates for compiled binaries
|
||||||
# https://github.com/pyinstaller/pyinstaller/issues/7229
|
# https://github.com/pyinstaller/pyinstaller/issues/7229
|
||||||
# https://stackoverflow.com/questions/55736855/how-to-change-the-cafile-argument-in-the-ssl-module-in-python3
|
# https://stackoverflow.com/questions/55736855/how-to-change-the-cafile-argument-in-the-ssl-module-in-python3
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ CHALLENGE_SELECTORS = [
|
|||||||
# Fairlane / pararius.com
|
# Fairlane / pararius.com
|
||||||
'div.vc div.text-box h2'
|
'div.vc div.text-box h2'
|
||||||
]
|
]
|
||||||
SHORT_TIMEOUT = 10
|
SHORT_TIMEOUT = 1
|
||||||
SESSIONS_STORAGE = SessionsStorage()
|
SESSIONS_STORAGE = SessionsStorage()
|
||||||
|
|
||||||
|
|
||||||
@@ -264,8 +264,8 @@ def click_verify(driver: WebDriver):
|
|||||||
actions.click(checkbox)
|
actions.click(checkbox)
|
||||||
actions.perform()
|
actions.perform()
|
||||||
logging.debug("Cloudflare verify checkbox found and clicked!")
|
logging.debug("Cloudflare verify checkbox found and clicked!")
|
||||||
except Exception as e:
|
except Exception:
|
||||||
logging.debug("Cloudflare verify checkbox not found on the page. Error: " + str(e))
|
logging.debug("Cloudflare verify checkbox not found on the page.")
|
||||||
finally:
|
finally:
|
||||||
driver.switch_to.default_content()
|
driver.switch_to.default_content()
|
||||||
|
|
||||||
@@ -281,8 +281,8 @@ def click_verify(driver: WebDriver):
|
|||||||
actions.click(button)
|
actions.click(button)
|
||||||
actions.perform()
|
actions.perform()
|
||||||
logging.debug("The Cloudflare 'Verify you are human' button found and clicked!")
|
logging.debug("The Cloudflare 'Verify you are human' button found and clicked!")
|
||||||
except Exception as e:
|
except Exception:
|
||||||
logging.debug("The Cloudflare 'Verify you are human' button not found on the page. Error: " + str(e))
|
logging.debug("The Cloudflare 'Verify you are human' button not found on the page.")
|
||||||
|
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
@@ -297,8 +297,8 @@ def _evil_logic(req: V1RequestBase, driver: WebDriver, method: str) -> Challenge
|
|||||||
if method == 'POST':
|
if method == 'POST':
|
||||||
_post_request(req, driver)
|
_post_request(req, driver)
|
||||||
else:
|
else:
|
||||||
with driver:
|
driver.get(req.url)
|
||||||
driver.get(req.url)
|
driver.start_session() # required to bypass Cloudflare
|
||||||
|
|
||||||
# set cookies if required
|
# set cookies if required
|
||||||
if req.cookies is not None and len(req.cookies) > 0:
|
if req.cookies is not None and len(req.cookies) > 0:
|
||||||
@@ -310,8 +310,8 @@ def _evil_logic(req: V1RequestBase, driver: WebDriver, method: str) -> Challenge
|
|||||||
if method == 'POST':
|
if method == 'POST':
|
||||||
_post_request(req, driver)
|
_post_request(req, driver)
|
||||||
else:
|
else:
|
||||||
with driver:
|
driver.get(req.url)
|
||||||
driver.get(req.url)
|
driver.start_session() # required to bypass Cloudflare
|
||||||
|
|
||||||
# wait for the page
|
# wait for the page
|
||||||
if utils.get_config_log_html():
|
if utils.get_config_log_html():
|
||||||
@@ -430,5 +430,5 @@ def _post_request(req: V1RequestBase, driver: WebDriver):
|
|||||||
<script>document.getElementById('hackForm').submit();</script>
|
<script>document.getElementById('hackForm').submit();</script>
|
||||||
</body>
|
</body>
|
||||||
</html>"""
|
</html>"""
|
||||||
with driver:
|
driver.get("data:text/html;charset=utf-8," + html_content)
|
||||||
driver.get("data:text/html;charset=utf-8," + html_content)
|
driver.start_session() # required to bypass Cloudflare
|
||||||
|
|||||||
Reference in New Issue
Block a user