cf_clearance


Namecf_clearance JSON
Version 0.31.0 PyPI version JSON
download
home_page
SummaryPurpose To make a cloudflare v2 challenge pass successfully, Can be use cf_clearance bypassed by cloudflare, However, with the cf_clearance, make sure you use the same IP and UA as when you got it.
upload_time2023-07-17 04:16:34
maintainer
docs_urlNone
author
requires_python<4,>=3.8
licenseApache-2.0
keywords cloudflare-bypass cloudflare-scrape anti-bot-page cloudflare cf-clearance
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # cf-clearance

[![OSCS Status](https://www.oscs1024.com/platform/badge/vvanglro/cf_clearance.svg?size=small)](https://www.oscs1024.com/project/vvanglro/cf_clearance?ref=badge_small)
[![Package version](https://img.shields.io/pypi/v/cf_clearance?color=%2334D058&label=pypi%20package)](https://pypi.python.org/pypi/cf_clearance)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/cf_clearance.svg?color=%2334D058)](https://pypi.python.org/pypi/cf_clearance)
[![Docker Image versions](https://img.shields.io/docker/v/vvanglro/cf-clearance?color=%2334D058&label=docker%20version)](https://hub.docker.com/r/vvanglro/cf-clearance)


Purpose To make a cloudflare v2 challenge pass successfully, Can be use cf_clearance bypassed by cloudflare, However, with
the cf_clearance, make sure you use the same IP and UA as when you got it.

## Project Pass Challenge Status
[![Every day cron challenge](https://github.com/vvanglro/cf-clearance/actions/workflows/every_day_cron_challenge.yml/badge.svg)](https://github.com/vvanglro/cf-clearance/actions/workflows/every_day_cron_challenge.yml)

## Warning

If you use chromium, Please use interface mode, You must add headless=False.
If you use it on linux or docker, use XVFB.

If you use firefox you don't need interface mode and XVFB.

Challenge are not always successful. Please try more and handle exceptions.


## Docker Usage

Recommended to install using Docker container on Ubuntu server.

DockerHub => https://hub.docker.com/r/vvanglro/cf-clearance

```shell
docker run -d --restart always --network host --name cf-clearance vvanglro/cf-clearance:latest \
--host 0.0.0.0 --port 8000 --workers 1
```

```shell
curl http://localhost:8000/challenge -H "Content-Type:application/json" -X POST \
-d '{"proxy": {"server": "socks5://localhost:7890"}, "timeout":20, "url": "https://nowsecure.nl"}'
```

```python
import requests

proxy = "socks5://localhost:7890"
resp = requests.post(
    "http://localhost:8000/challenge",
    json={
        "proxy": {"server": proxy},
        "timeout": 20,
        "url": "https://nowsecure.nl",
        "pure": True,
        "browser": 2,
        "cookies": [
            {
                "url": "https://www.example.com",
                "name": "example-cookie",
                "value": "example-value",
            }
        ],
        "headers": {"example-ua": "example-ua-value"},
        "exec_js": "() => {return navigator.userAgent}",
    },
)
data = resp.json()
# In some cases, the cloudflare challenge will not be triggered,
# so when cf in the return parameter is true, it means that the challenge has been encountered.
if data.get("success") and data.get("cf"):
    ua = data.get("user_agent")
    exec_js_resp = data.get("exec_js_resp")
    cf_clearance_value = data.get("cookies").get("cf_clearance")
    # use cf_clearance, must be same IP and UA
    headers = {"user-agent": ua}
    cookies = {"cf_clearance": cf_clearance_value}
    res = requests.get(
        "https://nowsecure.nl", proxies={"all": proxy}, headers=headers, cookies=cookies
    )
    if "<title>Just a moment...</title>" not in res.text:
        print("cf challenge success")
```

## Install

```
pip install cf-clearance
```

## Usage

Please make sure it is the latest package. See [example](https://github.com/vvanglro/cf-clearance/tree/main/example).

```
pip install --upgrade cf-clearance
```
or
```shell
pip install git+https://github.com/vvanglro/cf-clearance.git@main
```

## Install Playwright Depends
```shell
playwright install chromium firefox
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "cf_clearance",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "<4,>=3.8",
    "maintainer_email": "",
    "keywords": "cloudflare-bypass cloudflare-scrape anti-bot-page cloudflare cf-clearance",
    "author": "",
    "author_email": "vvanglro <vvanglro@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/22/2d/b6d3b6c9e9b5b14c7576f6990c15f3383bf8bbf929030b60aa81d971f4ef/cf_clearance-0.31.0.tar.gz",
    "platform": null,
    "description": "# cf-clearance\n\n[![OSCS Status](https://www.oscs1024.com/platform/badge/vvanglro/cf_clearance.svg?size=small)](https://www.oscs1024.com/project/vvanglro/cf_clearance?ref=badge_small)\n[![Package version](https://img.shields.io/pypi/v/cf_clearance?color=%2334D058&label=pypi%20package)](https://pypi.python.org/pypi/cf_clearance)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/cf_clearance.svg?color=%2334D058)](https://pypi.python.org/pypi/cf_clearance)\n[![Docker Image versions](https://img.shields.io/docker/v/vvanglro/cf-clearance?color=%2334D058&label=docker%20version)](https://hub.docker.com/r/vvanglro/cf-clearance)\n\n\nPurpose To make a cloudflare v2 challenge pass successfully, Can be use cf_clearance bypassed by cloudflare, However, with\nthe cf_clearance, make sure you use the same IP and UA as when you got it.\n\n## Project Pass Challenge Status\n[![Every day cron challenge](https://github.com/vvanglro/cf-clearance/actions/workflows/every_day_cron_challenge.yml/badge.svg)](https://github.com/vvanglro/cf-clearance/actions/workflows/every_day_cron_challenge.yml)\n\n## Warning\n\nIf you use chromium, Please use interface mode, You must add headless=False.\nIf you use it on linux or docker, use XVFB.\n\nIf you use firefox you don't need interface mode and XVFB.\n\nChallenge are not always successful. Please try more and handle exceptions.\n\n\n## Docker Usage\n\nRecommended to install using Docker container on Ubuntu server.\n\nDockerHub => https://hub.docker.com/r/vvanglro/cf-clearance\n\n```shell\ndocker run -d --restart always --network host --name cf-clearance vvanglro/cf-clearance:latest \\\n--host 0.0.0.0 --port 8000 --workers 1\n```\n\n```shell\ncurl http://localhost:8000/challenge -H \"Content-Type:application/json\" -X POST \\\n-d '{\"proxy\": {\"server\": \"socks5://localhost:7890\"}, \"timeout\":20, \"url\": \"https://nowsecure.nl\"}'\n```\n\n```python\nimport requests\n\nproxy = \"socks5://localhost:7890\"\nresp = requests.post(\n    \"http://localhost:8000/challenge\",\n    json={\n        \"proxy\": {\"server\": proxy},\n        \"timeout\": 20,\n        \"url\": \"https://nowsecure.nl\",\n        \"pure\": True,\n        \"browser\": 2,\n        \"cookies\": [\n            {\n                \"url\": \"https://www.example.com\",\n                \"name\": \"example-cookie\",\n                \"value\": \"example-value\",\n            }\n        ],\n        \"headers\": {\"example-ua\": \"example-ua-value\"},\n        \"exec_js\": \"() => {return navigator.userAgent}\",\n    },\n)\ndata = resp.json()\n# In some cases, the cloudflare challenge will not be triggered,\n# so when cf in the return parameter is true, it means that the challenge has been encountered.\nif data.get(\"success\") and data.get(\"cf\"):\n    ua = data.get(\"user_agent\")\n    exec_js_resp = data.get(\"exec_js_resp\")\n    cf_clearance_value = data.get(\"cookies\").get(\"cf_clearance\")\n    # use cf_clearance, must be same IP and UA\n    headers = {\"user-agent\": ua}\n    cookies = {\"cf_clearance\": cf_clearance_value}\n    res = requests.get(\n        \"https://nowsecure.nl\", proxies={\"all\": proxy}, headers=headers, cookies=cookies\n    )\n    if \"<title>Just a moment...</title>\" not in res.text:\n        print(\"cf challenge success\")\n```\n\n## Install\n\n```\npip install cf-clearance\n```\n\n## Usage\n\nPlease make sure it is the latest package. See [example](https://github.com/vvanglro/cf-clearance/tree/main/example).\n\n```\npip install --upgrade cf-clearance\n```\nor\n```shell\npip install git+https://github.com/vvanglro/cf-clearance.git@main\n```\n\n## Install Playwright Depends\n```shell\nplaywright install chromium firefox\n```\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Purpose To make a cloudflare v2 challenge pass successfully, Can be use cf_clearance bypassed by cloudflare, However, with the cf_clearance, make sure you use the same IP and UA as when you got it.",
    "version": "0.31.0",
    "project_urls": {
        "Homepage": "https://github.com/vvanglro/cf_clearance",
        "Repository": "https://github.com/vvanglro/cf_clearance"
    },
    "split_keywords": [
        "cloudflare-bypass",
        "cloudflare-scrape",
        "anti-bot-page",
        "cloudflare",
        "cf-clearance"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0964aef2e1cf3f2b3577333b2719d7986c5d91532e6f97339f038b18d34a813e",
                "md5": "a1d5305f3d79aee7484db6a862dd194b",
                "sha256": "c40521fc0a2f768e4b0865ea3d546e0b217323a2a7053c4b9875008cdd172bce"
            },
            "downloads": -1,
            "filename": "cf_clearance-0.31.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a1d5305f3d79aee7484db6a862dd194b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.8",
            "size": 14377,
            "upload_time": "2023-07-17T04:16:32",
            "upload_time_iso_8601": "2023-07-17T04:16:32.250785Z",
            "url": "https://files.pythonhosted.org/packages/09/64/aef2e1cf3f2b3577333b2719d7986c5d91532e6f97339f038b18d34a813e/cf_clearance-0.31.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "222db6d3b6c9e9b5b14c7576f6990c15f3383bf8bbf929030b60aa81d971f4ef",
                "md5": "a9dc7ba695007912e9cde532a6045072",
                "sha256": "f8ab60505ce74509a977875e831ba52aa9cf8e5712f5840b8b9d6de9cd64d189"
            },
            "downloads": -1,
            "filename": "cf_clearance-0.31.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a9dc7ba695007912e9cde532a6045072",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.8",
            "size": 12889,
            "upload_time": "2023-07-17T04:16:34",
            "upload_time_iso_8601": "2023-07-17T04:16:34.125187Z",
            "url": "https://files.pythonhosted.org/packages/22/2d/b6d3b6c9e9b5b14c7576f6990c15f3383bf8bbf929030b60aa81d971f4ef/cf_clearance-0.31.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-17 04:16:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vvanglro",
    "github_project": "cf_clearance",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cf_clearance"
}
        
Elapsed time: 0.08927s