KyranRana / cloudflare-bypass

A new and improved PHP library which bypasses the Cloudflare IUAM page using cURL
MIT License
274 stars 98 forks source link

how can i set cf clearance cookie? thank y #67

Closed curla92 closed 5 years ago

curla92 commented 6 years ago

i would to add cf clearance cookie with v2 example. thank y

KyranRana commented 6 years ago

When initialising CFCurl or CFStreamContext, set the cache property to true and cache_path to the directory you want the clearance cookie you want to be stored in. Once you have done this, trigger the CF Bypass process and there should be a file in that directory with the CF clearance token for the CF site you accessed.

The file name should be called md5( site hostname ).txt

curla92 commented 6 years ago

i added these lines….

curl_setopt($ch, CURLOPT_COOKIEJAR, COOKIE_FILE_PATH); curl_setopt($ch, CURLOPT_COOKIEFILE, COOKIE_FILE_PATH);

is it ok? thank y

Il giorno 29 set 2018, alle ore 12:19, Kyran Rana notifications@github.com<mailto:notifications@github.com> ha scritto:

cache_path

KyranRana commented 6 years ago

Try this:

$curl_cf_wrapper = new CFCurl(array(
    'cache'         => true,   // Caching now enabled by default; stores clearance tokens in Cache folder
    'max_retries'   => 5,       // Max attempts to try and get CF clearance
    'cache_path'   => COOKIE_FILE_PATH  // Where to cache session/clearance tokens.
));