FlareSolverr


NameFlareSolverr JSON
Version 3.3.21rc4.post3 PyPI version JSON
download
home_pagehttps://github.com/FlareSolverr/FlareSolverr/
SummaryProxy server to bypass Cloudflare protection
upload_time2024-07-31 04:25:56
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords proxy cloudflare ddos-guard captcha security
VCS
bugtrack_url
requirements bottle waitress selenium func-timeout prometheus-client requests certifi websockets xvfbwrapper pefile
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # FlareSolverr

[![Latest release](https://img.shields.io/github/v/release/FlareSolverr/FlareSolverr)](https://github.com/FlareSolverr/FlareSolverr/releases)
[![Docker Pulls](https://img.shields.io/docker/pulls/flaresolverr/flaresolverr)](https://hub.docker.com/r/flaresolverr/flaresolverr/)
[![GitHub issues](https://img.shields.io/github/issues/FlareSolverr/FlareSolverr)](https://github.com/FlareSolverr/FlareSolverr/issues)
[![GitHub pull requests](https://img.shields.io/github/issues-pr/FlareSolverr/FlareSolverr)](https://github.com/FlareSolverr/FlareSolverr/pulls)
[![Donate PayPal](https://img.shields.io/badge/Donate-PayPal-yellow.svg)](https://www.paypal.com/paypalme/diegoheras0xff)
[![Donate Bitcoin](https://img.shields.io/badge/Donate-Bitcoin-f7931a.svg)](https://www.blockchain.com/btc/address/13Hcv77AdnFWEUZ9qUpoPBttQsUT7q9TTh)
[![Donate Ethereum](https://img.shields.io/badge/Donate-Ethereum-8c8c8c.svg)](https://www.blockchain.com/eth/address/0x0D1549BbB00926BF3D92c1A8A58695e982f1BE2E)

FlareSolverr is a proxy server to bypass Cloudflare and DDoS-GUARD protection.

## How it works

FlareSolverr starts a proxy server, and it waits for user requests in an idle state using few resources.
When some request arrives, it uses [Selenium](https://www.selenium.dev) with the
[undetected-chromedriver](https://github.com/ultrafunkamsterdam/undetected-chromedriver)
to create a web browser (Chrome). It opens the URL with user parameters and waits until the Cloudflare challenge
is solved (or timeout). The HTML code and the cookies are sent back to the user, and those cookies can be used to
bypass Cloudflare using other HTTP clients.

**NOTE**: Web browsers consume a lot of memory. If you are running FlareSolverr on a machine with few RAM, do not make
many requests at once. With each request a new browser is launched.

It is also possible to use a permanent session. However, if you use sessions, you should make sure to close them as
soon as you are done using them.

## Installation

### Docker

It is recommended to install using a Docker container because the project depends on an external browser that is
already included within the image.

Docker images are available in:
* GitHub Registry => https://github.com/orgs/FlareSolverr/packages/container/package/flaresolverr
* DockerHub => https://hub.docker.com/r/flaresolverr/flaresolverr

Supported architectures are:

| Architecture | Tag          |
|--------------|--------------|
| x86          | linux/386    |
| x86-64       | linux/amd64  |
| ARM32        | linux/arm/v7 |
| ARM64        | linux/arm64  |

We provide a `docker-compose.yml` configuration file. Clone this repository and execute
`docker-compose up -d` _(Compose V1)_ or `docker compose up -d` _(Compose V2)_ to start
the container.

If you prefer the `docker cli` execute the following command.
```bash
docker run -d \
  --name=flaresolverr \
  -p 8191:8191 \
  -e LOG_LEVEL=info \
  --restart unless-stopped \
  ghcr.io/flaresolverr/flaresolverr:latest
```

If your host OS is Debian, make sure `libseccomp2` version is 2.5.x. You can check the version with `sudo apt-cache policy libseccomp2` 
and update the package with `sudo apt install libseccomp2=2.5.1-1~bpo10+1` or `sudo apt install libseccomp2=2.5.1-1+deb11u1`.
Remember to restart the Docker daemon and the container after the update.

### Precompiled binaries

> **Warning**
> Precompiled binaries are only available for x64 architecture. For other architectures see Docker images.

This is the recommended way for Windows users.
* Download the [FlareSolverr executable](https://github.com/FlareSolverr/FlareSolverr/releases) from the release's page. It is available for Windows x64 and Linux x64.
* Execute FlareSolverr binary. In the environment variables section you can find how to change the configuration.

### From source code

> **Warning**
> Installing from source code only works for x64 architecture. For other architectures see Docker images.

* Install [Python 3.11](https://www.python.org/downloads/).
* Install [Chrome](https://www.google.com/intl/en_us/chrome/) (all OS) or [Chromium](https://www.chromium.org/getting-involved/download-chromium/) (just Linux, it doesn't work in Windows) web browser.
* (Only in Linux) Install [Xvfb](https://en.wikipedia.org/wiki/Xvfb) package.
* (Only in macOS) Install [XQuartz](https://www.xquartz.org/) package.
* Clone this repository and open a shell in that path.
* Run `pip install -r requirements.txt` command to install FlareSolverr dependencies.
* Run `python src/flaresolverr.py` command to start FlareSolverr.

### From source code (FreeBSD/TrueNAS CORE)

* Run `pkg install chromium python39 py39-pip xorg-vfbserver` command to install the required dependencies.
* Clone this repository and open a shell in that path.
* Run `python3.9 -m pip install -r requirements.txt` command to install FlareSolverr dependencies.
* Run `python3.9 src/flaresolverr.py` command to start FlareSolverr.

### Systemd service

We provide an example Systemd unit file `flaresolverr.service` as reference. You have to modify the file to suit your needs: paths, user and environment variables.

## Usage

Example Bash request:
```bash
curl -L -X POST 'http://localhost:8191/v1' \
-H 'Content-Type: application/json' \
--data-raw '{
  "cmd": "request.get",
  "url": "http://www.google.com/",
  "maxTimeout": 60000
}'
```

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`

This will launch a new browser instance which will retain cookies until you destroy it with `sessions.destroy`.
This comes in handy, so you don't have to keep solving challenges over and over and you won't need to keep sending
cookies for the browser to use.

This also speeds up the requests since it won't have to launch a new browser instance for every request.

| Parameter | Notes                                                                                                                                                                                                                                                                                                            |
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| session   | Optional. The session ID that you want to be assigned to the instance. If isn't set a random UUID will be assigned.                                                                                                                                                                                              |
| 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 supported. Eg: `"proxy": {"url": "http://127.0.0.1:8888", "username": "testuser", "password": "testpass"}` |

#### + `sessions.list`

Returns a list of all the active sessions. More for debugging if you are curious to see how many sessions are running.
You should always make sure to properly close each session when you are done using them as too many may slow your
computer down.

Example response:

```json
{
  "sessions": [
    "session_id_1",
    "session_id_2",
    "session_id_3..."
  ]
}
```

#### + `sessions.destroy`

This will properly shutdown a browser instance and remove all files associated with it to free up resources for a new
session. When you no longer need to use a session you should make sure to close it.

| Parameter | Notes                                         |
|-----------|-----------------------------------------------|
| session   | The session ID that you want to be destroyed. |

#### + `request.get`

| Parameter           | Notes                                                                                                                                                                                                                                                                                                                                        |
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| url                 | Mandatory                                                                                                                                                                                                                                                                                                                                    |
| session             | Optional. Will send the request from and existing browser instance. If one is not sent it will create a temporary instance that will be destroyed immediately after the request is completed.                                                                                                                                                |
| session_ttl_minutes | Optional. FlareSolverr will automatically rotate expired sessions based on the TTL provided in minutes.                                                                                                                                                                                                                                      |
| maxTimeout          | Optional, default value 60000. Max timeout to solve the challenge in milliseconds.                                                                                                                                                                                                                                                           |
| 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`.) |

> **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.

Example response from running the `curl` above:

```json
{
    "solution": {
        "url": "https://www.google.com/?gws_rd=ssl",
        "status": 200,
        "headers": {
            "status": "200",
            "date": "Thu, 16 Jul 2020 04:15:49 GMT",
            "expires": "-1",
            "cache-control": "private, max-age=0",
            "content-type": "text/html; charset=UTF-8",
            "strict-transport-security": "max-age=31536000",
            "p3p": "CP=\"This is not a P3P policy! See g.co/p3phelp for more info.\"",
            "content-encoding": "br",
            "server": "gws",
            "content-length": "61587",
            "x-xss-protection": "0",
            "x-frame-options": "SAMEORIGIN",
            "set-cookie": "1P_JAR=2020-07-16-04; expires=Sat..."
        },
        "response":"<!DOCTYPE html>...",
        "cookies": [
            {
                "name": "NID",
                "value": "204=QE3Ocq15XalczqjuDy52HeseG3zAZuJzID3R57...",
                "domain": ".google.com",
                "path": "/",
                "expires": 1610684149.307722,
                "size": 178,
                "httpOnly": true,
                "secure": true,
                "session": false,
                "sameSite": "None"
            },
            {
                "name": "1P_JAR",
                "value": "2020-07-16-04",
                "domain": ".google.com",
                "path": "/",
                "expires": 1597464949.307626,
                "size": 19,
                "httpOnly": false,
                "secure": true,
                "session": false,
                "sameSite": "None"
            }
        ],
        "userAgent": "Windows NT 10.0; Win64; x64) AppleWebKit/5..."
    },
    "status": "ok",
    "message": "",
    "startTimestamp": 1594872947467,
    "endTimestamp": 1594872949617,
    "version": "1.0.0"
}
```

### + `request.post`

This is the same as `request.get` but it takes one more param:

| Parameter | Notes                                                                    |
|-----------|--------------------------------------------------------------------------|
| postData  | Must be a string with `application/x-www-form-urlencoded`. Eg: `a=b&c=d` |

## Environment variables

| Name               | Default                | Notes                                                                                                                                                         |
|--------------------|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| LOG_LEVEL          | info                   | Verbosity of the logging. Use `LOG_LEVEL=debug` for more information.                                                                                         |
| 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=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.                      |
| PORT               | 8191                   | Listening port. You don't need to change this if you are running on Docker.                                                                                   |
| HOST               | 0.0.0.0                | Listening interface. You don't need to change this if you are running on Docker.                                                                              |
| PROMETHEUS_ENABLED | false                  | Enable Prometheus exporter. See the Prometheus section below.                                                                                                 |
| PROMETHEUS_PORT    | 8192                   | Listening port for Prometheus exporter. See the Prometheus section below.                                                                                     |

Environment variables are set differently depending on the operating system. Some examples:
* Docker: Take a look at the Docker section in this document. Environment variables can be set in the `docker-compose.yml` file or in the Docker CLI command.
* Linux: Run `export LOG_LEVEL=debug` and then run `flaresolverr` in the same shell.
* Windows: Open `cmd.exe`, run `set LOG_LEVEL=debug` and then run `flaresolverr.exe` in the same shell.

## Prometheus exporter

The Prometheus exporter for FlareSolverr is disabled by default. It can be enabled with the environment variable `PROMETHEUS_ENABLED`. If you are using Docker make sure you expose the `PROMETHEUS_PORT`.

Example metrics:
```shell
# HELP flaresolverr_request_total Total requests with result
# TYPE flaresolverr_request_total counter
flaresolverr_request_total{domain="nowsecure.nl",result="solved"} 1.0
# HELP flaresolverr_request_created Total requests with result
# TYPE flaresolverr_request_created gauge
flaresolverr_request_created{domain="nowsecure.nl",result="solved"} 1.690141657157109e+09
# HELP flaresolverr_request_duration Request duration in seconds
# TYPE flaresolverr_request_duration histogram
flaresolverr_request_duration_bucket{domain="nowsecure.nl",le="0.0"} 0.0
flaresolverr_request_duration_bucket{domain="nowsecure.nl",le="10.0"} 1.0
flaresolverr_request_duration_bucket{domain="nowsecure.nl",le="25.0"} 1.0
flaresolverr_request_duration_bucket{domain="nowsecure.nl",le="50.0"} 1.0
flaresolverr_request_duration_bucket{domain="nowsecure.nl",le="+Inf"} 1.0
flaresolverr_request_duration_count{domain="nowsecure.nl"} 1.0
flaresolverr_request_duration_sum{domain="nowsecure.nl"} 5.858
# HELP flaresolverr_request_duration_created Request duration in seconds
# TYPE flaresolverr_request_duration_created gauge
flaresolverr_request_duration_created{domain="nowsecure.nl"} 1.6901416571570296e+09
```

## Captcha Solvers

> **Warning**
> At this time none of the captcha solvers work. You can check the status in the open issues. Any help is welcome.

Sometimes CloudFlare not only gives mathematical computations and browser tests, sometimes they also require the user to
solve a captcha.
If this is the case, FlareSolverr will return the error `Captcha detected but no automatic solver is configured.`

FlareSolverr can be customized to solve the CAPTCHA automatically by setting the environment variable `CAPTCHA_SOLVER`
to the file name of one of the adapters inside the [/captcha](src/captcha) directory.

## Related projects

* C# implementation => https://github.com/FlareSolverr/FlareSolverrSharp

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/FlareSolverr/FlareSolverr/",
    "name": "FlareSolverr",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Paul Pfeister <code@pfeister.dev>",
    "keywords": "proxy, cloudflare, ddos-guard, captcha, security",
    "author": null,
    "author_email": "Diego Heras <ngosang@hotmail.es>",
    "download_url": "https://files.pythonhosted.org/packages/20/e9/9fbe5a7968d35960a3ce4027684eb31ff7c28fcf2d999ffe84c215d87af8/flaresolverr-3.3.21rc4.post3.tar.gz",
    "platform": null,
    "description": "# FlareSolverr\n\n[![Latest release](https://img.shields.io/github/v/release/FlareSolverr/FlareSolverr)](https://github.com/FlareSolverr/FlareSolverr/releases)\n[![Docker Pulls](https://img.shields.io/docker/pulls/flaresolverr/flaresolverr)](https://hub.docker.com/r/flaresolverr/flaresolverr/)\n[![GitHub issues](https://img.shields.io/github/issues/FlareSolverr/FlareSolverr)](https://github.com/FlareSolverr/FlareSolverr/issues)\n[![GitHub pull requests](https://img.shields.io/github/issues-pr/FlareSolverr/FlareSolverr)](https://github.com/FlareSolverr/FlareSolverr/pulls)\n[![Donate PayPal](https://img.shields.io/badge/Donate-PayPal-yellow.svg)](https://www.paypal.com/paypalme/diegoheras0xff)\n[![Donate Bitcoin](https://img.shields.io/badge/Donate-Bitcoin-f7931a.svg)](https://www.blockchain.com/btc/address/13Hcv77AdnFWEUZ9qUpoPBttQsUT7q9TTh)\n[![Donate Ethereum](https://img.shields.io/badge/Donate-Ethereum-8c8c8c.svg)](https://www.blockchain.com/eth/address/0x0D1549BbB00926BF3D92c1A8A58695e982f1BE2E)\n\nFlareSolverr is a proxy server to bypass Cloudflare and DDoS-GUARD protection.\n\n## How it works\n\nFlareSolverr starts a proxy server, and it waits for user requests in an idle state using few resources.\nWhen some request arrives, it uses [Selenium](https://www.selenium.dev) with the\n[undetected-chromedriver](https://github.com/ultrafunkamsterdam/undetected-chromedriver)\nto create a web browser (Chrome). It opens the URL with user parameters and waits until the Cloudflare challenge\nis solved (or timeout). The HTML code and the cookies are sent back to the user, and those cookies can be used to\nbypass Cloudflare using other HTTP clients.\n\n**NOTE**: Web browsers consume a lot of memory. If you are running FlareSolverr on a machine with few RAM, do not make\nmany requests at once. With each request a new browser is launched.\n\nIt is also possible to use a permanent session. However, if you use sessions, you should make sure to close them as\nsoon as you are done using them.\n\n## Installation\n\n### Docker\n\nIt is recommended to install using a Docker container because the project depends on an external browser that is\nalready included within the image.\n\nDocker images are available in:\n* GitHub Registry => https://github.com/orgs/FlareSolverr/packages/container/package/flaresolverr\n* DockerHub => https://hub.docker.com/r/flaresolverr/flaresolverr\n\nSupported architectures are:\n\n| Architecture | Tag          |\n|--------------|--------------|\n| x86          | linux/386    |\n| x86-64       | linux/amd64  |\n| ARM32        | linux/arm/v7 |\n| ARM64        | linux/arm64  |\n\nWe provide a `docker-compose.yml` configuration file. Clone this repository and execute\n`docker-compose up -d` _(Compose V1)_ or `docker compose up -d` _(Compose V2)_ to start\nthe container.\n\nIf you prefer the `docker cli` execute the following command.\n```bash\ndocker run -d \\\n  --name=flaresolverr \\\n  -p 8191:8191 \\\n  -e LOG_LEVEL=info \\\n  --restart unless-stopped \\\n  ghcr.io/flaresolverr/flaresolverr:latest\n```\n\nIf your host OS is Debian, make sure `libseccomp2` version is 2.5.x. You can check the version with `sudo apt-cache policy libseccomp2` \nand update the package with `sudo apt install libseccomp2=2.5.1-1~bpo10+1` or `sudo apt install libseccomp2=2.5.1-1+deb11u1`.\nRemember to restart the Docker daemon and the container after the update.\n\n### Precompiled binaries\n\n> **Warning**\n> Precompiled binaries are only available for x64 architecture. For other architectures see Docker images.\n\nThis is the recommended way for Windows users.\n* Download the [FlareSolverr executable](https://github.com/FlareSolverr/FlareSolverr/releases) from the release's page. It is available for Windows x64 and Linux x64.\n* Execute FlareSolverr binary. In the environment variables section you can find how to change the configuration.\n\n### From source code\n\n> **Warning**\n> Installing from source code only works for x64 architecture. For other architectures see Docker images.\n\n* Install [Python 3.11](https://www.python.org/downloads/).\n* Install [Chrome](https://www.google.com/intl/en_us/chrome/) (all OS) or [Chromium](https://www.chromium.org/getting-involved/download-chromium/) (just Linux, it doesn't work in Windows) web browser.\n* (Only in Linux) Install [Xvfb](https://en.wikipedia.org/wiki/Xvfb) package.\n* (Only in macOS) Install [XQuartz](https://www.xquartz.org/) package.\n* Clone this repository and open a shell in that path.\n* Run `pip install -r requirements.txt` command to install FlareSolverr dependencies.\n* Run `python src/flaresolverr.py` command to start FlareSolverr.\n\n### From source code (FreeBSD/TrueNAS CORE)\n\n* Run `pkg install chromium python39 py39-pip xorg-vfbserver` command to install the required dependencies.\n* Clone this repository and open a shell in that path.\n* Run `python3.9 -m pip install -r requirements.txt` command to install FlareSolverr dependencies.\n* Run `python3.9 src/flaresolverr.py` command to start FlareSolverr.\n\n### Systemd service\n\nWe provide an example Systemd unit file `flaresolverr.service` as reference. You have to modify the file to suit your needs: paths, user and environment variables.\n\n## Usage\n\nExample Bash request:\n```bash\ncurl -L -X POST 'http://localhost:8191/v1' \\\n-H 'Content-Type: application/json' \\\n--data-raw '{\n  \"cmd\": \"request.get\",\n  \"url\": \"http://www.google.com/\",\n  \"maxTimeout\": 60000\n}'\n```\n\nExample Python request:\n```py\nimport requests\n\nurl = \"http://localhost:8191/v1\"\nheaders = {\"Content-Type\": \"application/json\"}\ndata = {\n    \"cmd\": \"request.get\",\n    \"url\": \"http://www.google.com/\",\n    \"maxTimeout\": 60000\n}\nresponse = requests.post(url, headers=headers, json=data)\nprint(response.text)\n```\n\nExample PowerShell request:\n```ps1\n$body = @{\n    cmd = \"request.get\"\n    url = \"http://www.google.com/\"\n    maxTimeout = 60000\n} | ConvertTo-Json\n\nirm -UseBasicParsing 'http://localhost:8191/v1' -Headers @{\"Content-Type\"=\"application/json\"} -Method Post -Body $body\n```\n\n### Commands\n\n#### + `sessions.create`\n\nThis will launch a new browser instance which will retain cookies until you destroy it with `sessions.destroy`.\nThis comes in handy, so you don't have to keep solving challenges over and over and you won't need to keep sending\ncookies for the browser to use.\n\nThis also speeds up the requests since it won't have to launch a new browser instance for every request.\n\n| Parameter | Notes                                                                                                                                                                                                                                                                                                            |\n|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| session   | Optional. The session ID that you want to be assigned to the instance. If isn't set a random UUID will be assigned.                                                                                                                                                                                              |\n| 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 supported. Eg: `\"proxy\": {\"url\": \"http://127.0.0.1:8888\", \"username\": \"testuser\", \"password\": \"testpass\"}` |\n\n#### + `sessions.list`\n\nReturns a list of all the active sessions. More for debugging if you are curious to see how many sessions are running.\nYou should always make sure to properly close each session when you are done using them as too many may slow your\ncomputer down.\n\nExample response:\n\n```json\n{\n  \"sessions\": [\n    \"session_id_1\",\n    \"session_id_2\",\n    \"session_id_3...\"\n  ]\n}\n```\n\n#### + `sessions.destroy`\n\nThis will properly shutdown a browser instance and remove all files associated with it to free up resources for a new\nsession. When you no longer need to use a session you should make sure to close it.\n\n| Parameter | Notes                                         |\n|-----------|-----------------------------------------------|\n| session   | The session ID that you want to be destroyed. |\n\n#### + `request.get`\n\n| Parameter           | Notes                                                                                                                                                                                                                                                                                                                                        |\n|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| url                 | Mandatory                                                                                                                                                                                                                                                                                                                                    |\n| session             | Optional. Will send the request from and existing browser instance. If one is not sent it will create a temporary instance that will be destroyed immediately after the request is completed.                                                                                                                                                |\n| session_ttl_minutes | Optional. FlareSolverr will automatically rotate expired sessions based on the TTL provided in minutes.                                                                                                                                                                                                                                      |\n| maxTimeout          | Optional, default value 60000. Max timeout to solve the challenge in milliseconds.                                                                                                                                                                                                                                                           |\n| cookies             | Optional. Will be used by the headless browser. Eg: `\"cookies\": [{\"name\": \"cookie1\", \"value\": \"value1\"}, {\"name\": \"cookie2\", \"value\": \"value2\"}]`.                                                                                                                                                                                           |\n| returnOnlyCookies   | Optional, default false. Only returns the cookies. Response data, headers and other parts of the response are removed.                                                                                                                                                                                                                       |\n| 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`.) |\n\n> **Warning**\n> 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.\n\nExample response from running the `curl` above:\n\n```json\n{\n    \"solution\": {\n        \"url\": \"https://www.google.com/?gws_rd=ssl\",\n        \"status\": 200,\n        \"headers\": {\n            \"status\": \"200\",\n            \"date\": \"Thu, 16 Jul 2020 04:15:49 GMT\",\n            \"expires\": \"-1\",\n            \"cache-control\": \"private, max-age=0\",\n            \"content-type\": \"text/html; charset=UTF-8\",\n            \"strict-transport-security\": \"max-age=31536000\",\n            \"p3p\": \"CP=\\\"This is not a P3P policy! See g.co/p3phelp for more info.\\\"\",\n            \"content-encoding\": \"br\",\n            \"server\": \"gws\",\n            \"content-length\": \"61587\",\n            \"x-xss-protection\": \"0\",\n            \"x-frame-options\": \"SAMEORIGIN\",\n            \"set-cookie\": \"1P_JAR=2020-07-16-04; expires=Sat...\"\n        },\n        \"response\":\"<!DOCTYPE html>...\",\n        \"cookies\": [\n            {\n                \"name\": \"NID\",\n                \"value\": \"204=QE3Ocq15XalczqjuDy52HeseG3zAZuJzID3R57...\",\n                \"domain\": \".google.com\",\n                \"path\": \"/\",\n                \"expires\": 1610684149.307722,\n                \"size\": 178,\n                \"httpOnly\": true,\n                \"secure\": true,\n                \"session\": false,\n                \"sameSite\": \"None\"\n            },\n            {\n                \"name\": \"1P_JAR\",\n                \"value\": \"2020-07-16-04\",\n                \"domain\": \".google.com\",\n                \"path\": \"/\",\n                \"expires\": 1597464949.307626,\n                \"size\": 19,\n                \"httpOnly\": false,\n                \"secure\": true,\n                \"session\": false,\n                \"sameSite\": \"None\"\n            }\n        ],\n        \"userAgent\": \"Windows NT 10.0; Win64; x64) AppleWebKit/5...\"\n    },\n    \"status\": \"ok\",\n    \"message\": \"\",\n    \"startTimestamp\": 1594872947467,\n    \"endTimestamp\": 1594872949617,\n    \"version\": \"1.0.0\"\n}\n```\n\n### + `request.post`\n\nThis is the same as `request.get` but it takes one more param:\n\n| Parameter | Notes                                                                    |\n|-----------|--------------------------------------------------------------------------|\n| postData  | Must be a string with `application/x-www-form-urlencoded`. Eg: `a=b&c=d` |\n\n## Environment variables\n\n| Name               | Default                | Notes                                                                                                                                                         |\n|--------------------|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| LOG_LEVEL          | info                   | Verbosity of the logging. Use `LOG_LEVEL=debug` for more information.                                                                                         |\n| LOG_HTML           | false                  | Only for debugging. If `true` all HTML that passes through the proxy will be logged to the console in `debug` level.                                          |\n| CAPTCHA_SOLVER     | none                   | Captcha solving method. It is used when a captcha is encountered. See the Captcha Solvers section.                                                            |\n| TZ                 | UTC                    | Timezone used in the logs and the web browser. Example: `TZ=Europe/London`.                                                                                   |\n| LANG               | none                   | Language used in the web browser. Example: `LANG=en_GB`.                                                                                   |\n| HEADLESS           | true                   | Only for debugging. To run the web browser in headless mode or visible.                                                                                       |\n| 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. |\n| 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.                      |\n| PORT               | 8191                   | Listening port. You don't need to change this if you are running on Docker.                                                                                   |\n| HOST               | 0.0.0.0                | Listening interface. You don't need to change this if you are running on Docker.                                                                              |\n| PROMETHEUS_ENABLED | false                  | Enable Prometheus exporter. See the Prometheus section below.                                                                                                 |\n| PROMETHEUS_PORT    | 8192                   | Listening port for Prometheus exporter. See the Prometheus section below.                                                                                     |\n\nEnvironment variables are set differently depending on the operating system. Some examples:\n* Docker: Take a look at the Docker section in this document. Environment variables can be set in the `docker-compose.yml` file or in the Docker CLI command.\n* Linux: Run `export LOG_LEVEL=debug` and then run `flaresolverr` in the same shell.\n* Windows: Open `cmd.exe`, run `set LOG_LEVEL=debug` and then run `flaresolverr.exe` in the same shell.\n\n## Prometheus exporter\n\nThe Prometheus exporter for FlareSolverr is disabled by default. It can be enabled with the environment variable `PROMETHEUS_ENABLED`. If you are using Docker make sure you expose the `PROMETHEUS_PORT`.\n\nExample metrics:\n```shell\n# HELP flaresolverr_request_total Total requests with result\n# TYPE flaresolverr_request_total counter\nflaresolverr_request_total{domain=\"nowsecure.nl\",result=\"solved\"} 1.0\n# HELP flaresolverr_request_created Total requests with result\n# TYPE flaresolverr_request_created gauge\nflaresolverr_request_created{domain=\"nowsecure.nl\",result=\"solved\"} 1.690141657157109e+09\n# HELP flaresolverr_request_duration Request duration in seconds\n# TYPE flaresolverr_request_duration histogram\nflaresolverr_request_duration_bucket{domain=\"nowsecure.nl\",le=\"0.0\"} 0.0\nflaresolverr_request_duration_bucket{domain=\"nowsecure.nl\",le=\"10.0\"} 1.0\nflaresolverr_request_duration_bucket{domain=\"nowsecure.nl\",le=\"25.0\"} 1.0\nflaresolverr_request_duration_bucket{domain=\"nowsecure.nl\",le=\"50.0\"} 1.0\nflaresolverr_request_duration_bucket{domain=\"nowsecure.nl\",le=\"+Inf\"} 1.0\nflaresolverr_request_duration_count{domain=\"nowsecure.nl\"} 1.0\nflaresolverr_request_duration_sum{domain=\"nowsecure.nl\"} 5.858\n# HELP flaresolverr_request_duration_created Request duration in seconds\n# TYPE flaresolverr_request_duration_created gauge\nflaresolverr_request_duration_created{domain=\"nowsecure.nl\"} 1.6901416571570296e+09\n```\n\n## Captcha Solvers\n\n> **Warning**\n> At this time none of the captcha solvers work. You can check the status in the open issues. Any help is welcome.\n\nSometimes CloudFlare not only gives mathematical computations and browser tests, sometimes they also require the user to\nsolve a captcha.\nIf this is the case, FlareSolverr will return the error `Captcha detected but no automatic solver is configured.`\n\nFlareSolverr can be customized to solve the CAPTCHA automatically by setting the environment variable `CAPTCHA_SOLVER`\nto the file name of one of the adapters inside the [/captcha](src/captcha) directory.\n\n## Related projects\n\n* C# implementation => https://github.com/FlareSolverr/FlareSolverrSharp\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Proxy server to bypass Cloudflare protection",
    "version": "3.3.21rc4.post3",
    "project_urls": {
        "Bug-tracker": "https://github.com/FlareSolverr/FlareSolverr/issues/",
        "Documentation": "https://github.com/FlareSolverr/FlareSolverr/wiki/",
        "Homepage": "https://github.com/FlareSolverr/FlareSolverr/"
    },
    "split_keywords": [
        "proxy",
        " cloudflare",
        " ddos-guard",
        " captcha",
        " security"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "214874230ca6d04f9d9b3f0fd1e419cf35ca1ba2712c74f6fd1522d9aa360dd4",
                "md5": "a69a327dadae3d5dff51de5b098fd3eb",
                "sha256": "11b8550c860b12c83fbc507bf5cad9d3b7dfcdd0e9f359af7eaab04a7b44b40c"
            },
            "downloads": -1,
            "filename": "flaresolverr-3.3.21rc4.post3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a69a327dadae3d5dff51de5b098fd3eb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 29108,
            "upload_time": "2024-07-31T04:25:55",
            "upload_time_iso_8601": "2024-07-31T04:25:55.133491Z",
            "url": "https://files.pythonhosted.org/packages/21/48/74230ca6d04f9d9b3f0fd1e419cf35ca1ba2712c74f6fd1522d9aa360dd4/flaresolverr-3.3.21rc4.post3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "20e99fbe5a7968d35960a3ce4027684eb31ff7c28fcf2d999ffe84c215d87af8",
                "md5": "ee0b7ca82498e88caa39cdb8b6b45ea3",
                "sha256": "6c9c0d63eb75ef73c35850a3f58d4e797011c2cb94f492da28ed15c262e0c974"
            },
            "downloads": -1,
            "filename": "flaresolverr-3.3.21rc4.post3.tar.gz",
            "has_sig": false,
            "md5_digest": "ee0b7ca82498e88caa39cdb8b6b45ea3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 29512,
            "upload_time": "2024-07-31T04:25:56",
            "upload_time_iso_8601": "2024-07-31T04:25:56.641232Z",
            "url": "https://files.pythonhosted.org/packages/20/e9/9fbe5a7968d35960a3ce4027684eb31ff7c28fcf2d999ffe84c215d87af8/flaresolverr-3.3.21rc4.post3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-31 04:25:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "FlareSolverr",
    "github_project": "FlareSolverr",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "bottle",
            "specs": [
                [
                    "==",
                    "0.12.25"
                ]
            ]
        },
        {
            "name": "waitress",
            "specs": [
                [
                    "==",
                    "2.1.2"
                ]
            ]
        },
        {
            "name": "selenium",
            "specs": [
                [
                    "==",
                    "4.15.2"
                ]
            ]
        },
        {
            "name": "func-timeout",
            "specs": [
                [
                    "==",
                    "4.3.5"
                ]
            ]
        },
        {
            "name": "prometheus-client",
            "specs": [
                [
                    "==",
                    "0.17.1"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.32.3"
                ]
            ]
        },
        {
            "name": "certifi",
            "specs": [
                [
                    "==",
                    "2024.07.04"
                ]
            ]
        },
        {
            "name": "websockets",
            "specs": [
                [
                    "==",
                    "11.0.3"
                ]
            ]
        },
        {
            "name": "xvfbwrapper",
            "specs": [
                [
                    "==",
                    "0.2.9"
                ]
            ]
        },
        {
            "name": "pefile",
            "specs": [
                [
                    "==",
                    "2023.2.7"
                ]
            ]
        }
    ],
    "lcname": "flaresolverr"
}
        
Elapsed time: 3.60530s