:cookie: Fetch cookie generated by Cloudflare
getCFcookie.js is a script to fetch cookie generated by Cloudflare. Once you got all cookies, you could simply filter the necessary value in cookie, for example cf_clearance
, to bypass cf check.
npm i puppeteer-core puppeteer-extra puppeteer-extra-plugin-stealth commander
Usage: ./getCFcookie.js -u <url> -a <user_agent> [-p <path>] [-s]
Options:
-u, --url <site_url> url to visit
-a, --agent <user_agent> browser user agent
-p, --path <binary_path> optional, path to chrome/chromium binary
default "/usr/bin/chromium"
-s, --show optional, show browser
default not show
-h, --help display help for command
For normal Cloudflare DDoS prevention mechanism, it needs to wait for 5 seconds to get cookie.
If reCAPTCHA challenge is implemented on top, please use -s
option to prompt browser and resolve reCAPTCHA challenge manually.