Purpose To make a cloudflare challenge pass successfully, Can be use cf_clearance bypassed by cloudflare

Overview

cf_clearance

Reference from playwright_stealth and undetected-chromedriver

Purpose To make a cloudflare 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.

Install

$ pip install cf_clearance

Usage

sync

from playwright.sync_api import sync_playwright
from cf_clearance import sync_retry, stealth_sync

with sync_playwright() as p:
    browser = p.chromium.launch()
    page = browser.new_page()
    stealth_sync(page)
    page.goto('https://nowsecure.nl')
    res = sync_retry(page)
    if res:
        cppkies = page.context.cookies()
        for cookie in cppkies:
            if cookie.get('name') == 'cf_clearance':
                print(cookie.get('value'))
        ua = page.evaluate('() => {return navigator.userAgent}')
        print(ua)
    else:
        print("fail")
    browser.close()

async

import asyncio
from playwright.async_api import async_playwright
from cf_clearance import async_retry, stealth_async

async def main():
    async with async_playwright() as p:
        browser = await p.chromium.launch()
        page = await browser.new_page()
        await stealth_async(page)
        await page.goto('https://nowsecure.nl')
        res = await async_retry(page)
        if res:
            cppkies = await page.context.cookies()
            for cookie in cppkies:
                if cookie.get('name') == 'cf_clearance':
                    print(cookie.get('value'))
            ua = await page.evaluate('() => {return navigator.userAgent}')
            print(ua)
        else:
            print("fail")
        await browser.close()


asyncio.get_event_loop().run_until_complete(main())
Comments
  • how to use in Doker ?  got a timeout with example

    how to use in Doker ? got a timeout with example

    0.28.3 in an ubnutu 20.04 TLS server with docker I can open https://nowsecure.nl via curl

    curl http://localhost:8000/challenge -H "Content-Type:application/json" -X POST -d '{ "timeout":40, "url": "https://nowsecure.nl"}'

    got

    {"success":false,"msg":"challenge timeout","user_agent":null,"cookies":null}

    opened by bigqiao 5
  • how to use in Doker ? More doc pls

    how to use in Doker ? More doc pls

    curl http://localhost:8000/challenge -H "Content-Type:application/json" -X POST -d '{"proxy": {"server": "socks5://localhost:38080"}, "timeout":20, "url": "https://chat.openai.com/chat"}'

    {"success":true,"msg":"cf challenge success","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36","cookies":{"cf_clearance":"mwV29nkv5mXzyvyvZ.aqgn59rL.hn_NunwUjp9g9tn0-1670827806-0-160","__Host-next-auth.csrf-token":"e64048d7560707f3fc484abbe15fdc72c4fa170fd53f3af8a769d06221fa5dac%7C0b483ae212fb5c8cf8794bef893c8a0626b3eb8b367ac16521dccf8c56d9d0ed","__Secure-next-auth.callback-url":"https%3A%2F%2Fchat.openai.com","__cf_bm":"u3MNGV6m86Ib2GUndQcUA6MlAijvK6qc9ngGWROAhlo-1670827806-0-Abk+W9FPVBjwtOq+VlJKeOGq5S7Xz/lQ9rTyzY9p9zUxz2bpM8Guiza56AJYIydDI97ESDSt/1/NiPOxVVLpWUQ="}}

    opened by PlexPt 5
  • Can't use latest docker image

    Can't use latest docker image

    curl http://127.0.0.1:8000/challenge -H "Content-Type:application/json" -X POST \
          -d '{"timeout":20, "url": "https://nowsecure.nl"}' -v
    
    

    Note: Unnecessary use of -X or --request, POST is already inferred.

    • Trying 127.0.0.1:8000...
    • Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)

    POST /challenge HTTP/1.1 Host: 127.0.0.1:8000 User-Agent: curl/7.79.1 Accept: / Content-Type:application/json Content-Length: 45

    • Empty reply from server
    • Closing connection 0 curl: (52) Empty reply from server
    opened by ralfiannor 4
  • Bypass failed

    Bypass failed

    Some pages can be bypassed ,some not working image

        if browser is None:
            p = await async_playwright().start()
            browser = await p.chromium.launch(headless=False,
                                              channel='chrome',
                                              args=["--no-sandbox"])
        page = await context.new_page()
            await async_stealth(page, pure=True)
            await page.goto(url, timeout=0)
            res = await async_cf_retry(page)
            await page.wait_for_timeout(1000 * 2)
    ``
    opened by jw-star 3
  • Thank you.

    Thank you.

    With CloudFlare adding H Captcha, it completely broke my code and I couldn't find a solution until I found a github page with 10 stars.

    This is some great code on your part. Thank you for making this free publicly available code, it is highly appreciated!!! <3

    opened by tcrch 3
  • adopt FlareSolverr style

    adopt FlareSolverr style

    Please I want to use it like docker run -d
    --name=flaresolverr
    -p 8191:8191
    -e LOG_LEVEL=info
    --restart unless-stopped
    ghcr.io/flaresolverr/flaresolverr:latest

    and

    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 }'

    FlareSolverr Doesnt support user-proxy auth :(

    opened by sneedgers 2
  • SOCKSHTTPSConnectionPool(host='nowsecure.nl', port=443)

    SOCKSHTTPSConnectionPool(host='nowsecure.nl', port=443)

    Hello thanks for your great work but i try now use test idea and have this error:

    requests.exceptions.ConnectionError: SOCKSHTTPSConnectionPool(host='nowsecure.nl', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.contrib.socks.SOCKSHTTPSConnection object at 0x110996730>: Failed to establish a new connection: [Errno 61] Connection refused'))

    I have one file proxies.txt

    thanks

    opened by reactiver001 1
  • cannot import name 'sync_retry' from 'cf_clearance'

    cannot import name 'sync_retry' from 'cf_clearance'

    Hi, I'm getting that error. im trying to run the example script:

    from playwright.sync_api import sync_playwright
    from cf_clearance import sync_retry, stealth_sync
    import requests
    

    ImportError: cannot import name 'sync_retry' from 'cf_clearance'

    opened by jhuaraya 1
  • refactor: optimization

    refactor: optimization

    Changed sleep position and counter position

    Unwanted exception handling removed in Docker's server.py, changed to return all retrieved cookies You assigned the correct status code to the response you want to return on error

    opened by KohnoseLami 0
Releases(v0.28.3)
Make your Pass (sanitaire) Fun Again

Make Your Pass (Sanitaire) Fun Again Customize your Pass Sanitaire (French name for EU digital Covide19 Certificate) with colors and images, thus make

null 101 Dec 1, 2022
The purpose of this bot is to take soundcloud track requests, that are posted in the stream-requests channel, and add them to a playlist, to make the process of scrolling through the requests easier for Root

Discord Song Collector Dont know if anyone is actually going to read this, but the purpose of this bot is to check every message in the stream-request

null 2 Mar 1, 2022
Battle Pass farming tft bot

Tft bot Bot para farmar pontos do Passe de Batalha do TFT Descrição A cada partida de tft jogada você ganha 100 pontos no passe, porém você não precis

Leonardo Gonçalves 4 Jan 27, 2022
Opensea-upload-with-recaptcha-solution - Updated opensea uploading solution with recaptcha pass

opensea-upload-with-recaptcha-solution updated opensea uploading solution with r

byeonggeon sim 25 Nov 15, 2022
A cross-platform script to book first available time for getting a passport in Sweden - Ett skript som automatiskt bokar pass hos polisen

Automatic passport booker - Boka pass automatiskt hos Svenska polisen A cross-platform script to book first available time for getting a passport in S

Elias Floreteng 14 Oct 17, 2022
A simple Python API wrapper for Cloudflare Stream's API.

python-cloudflare-stream A basic Python API wrapper for working with Cloudflare Stream. Arbington.com started off using Cloudflare Stream. We used the

Arbington 3 Sep 8, 2022
DDoS Script (DDoS Panel) with Multiple Bypass ( Cloudflare UAM,CAPTCHA,BFM,NOSEC / DDoS Guard / Google Shield / V Shield / Amazon / etc.. )

KARMA DDoS DDoS Script (DDoS Panel) with Multiple Bypass ( Cloudflare UAM,CAPTCHA,BFM,NOSEC / DDoS Guard / Google Shield / V Shield / Amazon / etc.. )

Hyuk 256 Jan 2, 2023
a discord libary that use to make discord bot with low efficiency and bad performance because I don't know how to manage the project

Aircord ??️ a discord libary that use to make discord bot with low efficiency and bad performance because I don't know how to manage the project Examp

Aircord 2 Oct 24, 2021
Make WhatsApp ChatBot and use WhatsApp API to send the WhatsApp messages in python .

Ultramsg.com WhatsApp Bot using WhatsApp API and ultramsg Demo WhatsApp API ChatBot using Ultramsg API with python. Opportunities and tasks: The outpu

Ultramsg 64 Dec 29, 2022
domhttpx is a google search engine dorker with HTTP toolkit built with python, can make it easier for you to find many URLs/IPs at once with fast time.

domhttpx is a google search engine dorker with HTTP toolkit built with python, can make it easier for you to find many URLs/IPs at once with fast time

Naufal Ardhani 59 Dec 4, 2022
A Code that can make your Discord Account 24/7!

Online-Forever Make your Discord Account Online 24/7! A Code written in Python that helps you to keep your account 24/7. The main.py is the main file.

Phantom 556 Dec 29, 2022
A Code that can make your Discord Account 24/7 on Voice Channels!

Voicecord Make your Discord Account Online 24/7 on Voice Channels! A Code written in Python that helps you to keep your account 24/7 on Voice Channels

Phantom 229 Jan 7, 2023
A code that can make an account bump your discord server 24/7!

BumpCord A code that can make an account bump your discord server 24/7! The main.py is the main file. keep_alive.py prevents your repl from going to s

Phantom 28 Aug 20, 2022
This code will guide you on how you can make your own Twitter Bot.

This code will guide you on how you can make your own Twitter Bot. This bot retweets, and likes to tweet with a particular word, here Python3.

Kunal Diwan 1 Oct 14, 2022
An attempt to make a bot that can auto-archive Danganronpa KG RPs on Discord.

Danganronpa Killing Game Archiving Bot An attempt to make a bot that can auto-archive Danganronpa KG RPs on Discord. The final format is meant to look

Astrea 1 Nov 30, 2021
A code that can make your 5 accounts stay 24/7 in a discord voice channel!

Voicecord A code that can make your 5 accounts stay 24/7 in a discord voice channel! Usage ・Fork the repo ・Clone it to replit ・Install the required pa

DraKenCodeZ 3 Jan 9, 2022
A bot which is a ghost and you can make friends with it

This is a bot which is a ghost and you can make friends with it. It will haunt your friends. Explore and test the bot in replit !

Siwan SR 0 Oct 6, 2022
Python bindings for ArrayFire: A general purpose GPU library.

ArrayFire Python Bindings ArrayFire is a high performance library for parallel computing with an easy-to-use API. It enables users to write scientific

ArrayFire 402 Dec 20, 2022
Discord ToolBox is a discord bot developed by DJD320 created for the purpose of having some convenient tools in the form of a single bot.

Discord ToolBox Discord ToolBox is a discord bot developed by DJD320 created for the purpose of having some convenient tools in the form of a single b

null 3 Aug 7, 2021