mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2025-12-05 17:18:19 +01:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
227bd7ac72 | ||
|
|
e6a08584c0 | ||
|
|
df06d13cf8 | ||
|
|
993b8c41ac | ||
|
|
a4d42d7834 | ||
|
|
1c855b8af0 | ||
|
|
745c69491f | ||
|
|
f7e316fd5a | ||
|
|
16c8ab5f3d |
16
CHANGELOG.md
16
CHANGELOG.md
@@ -1,5 +1,21 @@
|
||||
# Changelog
|
||||
|
||||
## v3.3.14 (2024/02/17)
|
||||
|
||||
* Update Chrome downloads. Thanks @opemvbs
|
||||
|
||||
## v3.3.13 (2024/01/07)
|
||||
|
||||
* Fix too many open files error
|
||||
|
||||
## v3.3.12 (2023/12/15)
|
||||
|
||||
* Fix looping challenges and invalid cookies
|
||||
|
||||
## v3.3.11 (2023/12/11)
|
||||
|
||||
* Update UC 3.5.4 & Selenium 4.15.2. Thanks @txtsd
|
||||
|
||||
## v3.3.10 (2023/11/14)
|
||||
|
||||
* Add LANG ENV - resolves issues with YGGtorrent
|
||||
|
||||
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.10 .
|
||||
# docker run -p 8191:8191 ngosang/flaresolverr:3.3.10
|
||||
# docker build -t ngosang/flaresolverr:3.3.14 .
|
||||
# docker run -p 8191:8191 ngosang/flaresolverr:3.3.14
|
||||
|
||||
# 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.10 --platform linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8 .
|
||||
# docker buildx build -t ngosang/flaresolverr:3.3.14 --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.10 --platform linux/arm/v7 --load .
|
||||
# docker run -p 8191:8191 --platform linux/arm/v7 ngosang/flaresolverr:3.3.10
|
||||
# docker buildx build -t ngosang/flaresolverr:3.3.14 --platform linux/arm/v7 --load .
|
||||
# docker run -p 8191:8191 --platform linux/arm/v7 ngosang/flaresolverr:3.3.14
|
||||
|
||||
30
README.md
30
README.md
@@ -89,7 +89,7 @@ We provide an example Systemd unit file `flaresolverr.service` as reference. You
|
||||
|
||||
## Usage
|
||||
|
||||
Example request:
|
||||
Example Bash request:
|
||||
```bash
|
||||
curl -L -X POST 'http://localhost:8191/v1' \
|
||||
-H 'Content-Type: application/json' \
|
||||
@@ -100,6 +100,32 @@ curl -L -X POST 'http://localhost:8191/v1' \
|
||||
}'
|
||||
```
|
||||
|
||||
Example Python request:
|
||||
```py
|
||||
import requests
|
||||
|
||||
url = "http://localhost:8191/v1"
|
||||
headers = {"Content-Type": "application/json"}
|
||||
data = {
|
||||
"cmd": "request.get",
|
||||
"url": "http://www.google.com/",
|
||||
"maxTimeout": 60000
|
||||
}
|
||||
response = requests.post(url, headers=headers, json=data)
|
||||
print(response.text)
|
||||
```
|
||||
|
||||
Example PowerShell request:
|
||||
```ps1
|
||||
$body = @{
|
||||
cmd = "request.get"
|
||||
url = "http://www.google.com/"
|
||||
maxTimeout = 60000
|
||||
} | ConvertTo-Json
|
||||
|
||||
irm -UseBasicParsing 'http://localhost:8191/v1' -Headers @{"Content-Type"="application/json"} -Method Post -Body $body
|
||||
```
|
||||
|
||||
### Commands
|
||||
|
||||
#### + `sessions.create`
|
||||
@@ -232,7 +258,7 @@ This is the same as `request.get` but it takes one more param:
|
||||
| LOG_HTML | false | Only for debugging. If `true` all HTML that passes through the proxy will be logged to the console in `debug` level. |
|
||||
| CAPTCHA_SOLVER | none | Captcha solving method. It is used when a captcha is encountered. See the Captcha Solvers section. |
|
||||
| TZ | UTC | Timezone used in the logs and the web browser. Example: `TZ=Europe/London`. |
|
||||
| LANG | none | Language used in the web browser. Example: `LANG=fr_FR`. |
|
||||
| LANG | none | Language used in the web browser. Example: `LANG=en_GB`. |
|
||||
| HEADLESS | true | Only for debugging. To run the web browser in headless mode or visible. |
|
||||
| BROWSER_TIMEOUT | 40000 | If you are experiencing errors/timeouts because your system is slow, you can try to increase this value. Remember to increase the `maxTimeout` parameter too. |
|
||||
| TEST_URL | https://www.google.com | FlareSolverr makes a request on start to make sure the web browser is working. You can change that URL if it is blocked in your country. |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "flaresolverr",
|
||||
"version": "3.3.10",
|
||||
"version": "3.3.14",
|
||||
"description": "Proxy server to bypass Cloudflare protection",
|
||||
"author": "Diego Heras (ngosang / ngosang@hotmail.es)",
|
||||
"license": "MIT"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
bottle==0.12.25
|
||||
waitress==2.1.2
|
||||
selenium==4.11.2
|
||||
selenium==4.15.2
|
||||
func-timeout==4.3.5
|
||||
prometheus-client==0.17.1
|
||||
# required by undetected_chromedriver
|
||||
|
||||
@@ -25,7 +25,7 @@ def clean_files():
|
||||
|
||||
def download_chromium():
|
||||
# https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Linux_x64/
|
||||
revision = "1140001" if os.name == 'nt' else '1140000'
|
||||
revision = "1250005" if os.name == 'nt' else '1250006'
|
||||
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')
|
||||
|
||||
@@ -294,6 +294,8 @@ def _evil_logic(req: V1RequestBase, driver: WebDriver, method: str) -> Challenge
|
||||
|
||||
# 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:
|
||||
|
||||
@@ -17,7 +17,7 @@ by UltrafunkAmsterdam (https://github.com/ultrafunkamsterdam)
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
__version__ = "3.5.3"
|
||||
__version__ = "3.5.4"
|
||||
|
||||
import json
|
||||
import logging
|
||||
@@ -396,7 +396,7 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
|
||||
if no_sandbox:
|
||||
options.arguments.extend(["--no-sandbox", "--test-type"])
|
||||
|
||||
if headless or options.headless:
|
||||
if headless or getattr(options, 'headless', None):
|
||||
#workaround until a better checking is found
|
||||
try:
|
||||
v_main = int(self.patcher.version_main) if self.patcher.version_main else 108
|
||||
@@ -491,7 +491,7 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
|
||||
else:
|
||||
self._web_element_cls = WebElement
|
||||
|
||||
if options.headless:
|
||||
if headless or getattr(options, 'headless', None):
|
||||
self._configure_headless()
|
||||
|
||||
def _configure_headless(self):
|
||||
|
||||
@@ -41,6 +41,7 @@ def start_detached(executable, *args):
|
||||
# close pipes
|
||||
writer.close()
|
||||
reader.close()
|
||||
process.close()
|
||||
|
||||
return pid
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@ class Patcher(object):
|
||||
download_url = "%s/%s/%s" % (self.url_repo, self.version_full.vstring, zip_name)
|
||||
else:
|
||||
zip_name = zip_name.replace("_", "-", 1)
|
||||
download_url = "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/%s/%s/%s"
|
||||
download_url = "https://storage.googleapis.com/chrome-for-testing-public/%s/%s/%s"
|
||||
download_url %= (self.version_full.vstring, self.platform_name, zip_name)
|
||||
|
||||
logger.debug("downloading from %s" % download_url)
|
||||
|
||||
@@ -153,7 +153,7 @@ def get_webdriver(proxy: dict = None) -> WebDriver:
|
||||
logging.debug("Using webdriver proxy: %s", proxy_url)
|
||||
options.add_argument('--proxy-server=%s' % proxy_url)
|
||||
|
||||
# note: headless mode is detected (options.headless = True)
|
||||
# note: headless mode is detected (headless = True)
|
||||
# we launch the browser in head-full mode with the window hidden
|
||||
windows_headless = False
|
||||
if get_config_headless():
|
||||
@@ -161,6 +161,8 @@ def get_webdriver(proxy: dict = None) -> WebDriver:
|
||||
windows_headless = True
|
||||
else:
|
||||
start_xvfb_display()
|
||||
# For normal headless mode:
|
||||
# options.add_argument('--headless')
|
||||
|
||||
# if we are inside the Docker container, we avoid downloading the driver
|
||||
driver_exe_path = None
|
||||
|
||||
Reference in New Issue
Block a user