Closed momala454 closed 4 years ago
yes the same it does not work anymore
Indeed it started to happen few hours ago, no longer works.
someone found the solution?
i think it may have been tested previously randomly by cloudflare as i had the same kind of error a month ago : https://github.com/KyranRana/cloudflare-bypass/issues/140
it seems this patch has the new working version for node https://github.com/codemanki/cloudscraper/pull/287/files
sadly im at work and unable to test it
if you look at the form closely, it now also uses a POST request instead of a GET. I think maintaining this package is going to be a pain since PHP is not meant to deal with javascript. Cloudflare will keep changing this protection page in the future. The best solution is to use an actual javascript solution to solve the challenge (like V8Js PHP extension or setup your own Node.js server).
Or improve this script to use something like symfony/dom-crawler
to atleast polish some of the hardcoded form properties out (like <input name="s"
change to <input name="r"
)
if you look at the form closely, it now also uses a POST request instead of a GET. I think maintaining this package is going to be a pain since PHP is not meant to deal with javascript. Cloudflare will keep changing this protection page in the future. The best solution is to use an actual javascript solution to solve the challenge (like V8Js PHP extension or setup your own Node.js server).
Or improve this script to use something like
symfony/dom-crawler
to atleast polish some of the hardcoded form properties out (like<input name="s"
change to<input name="r"
)
indeed i was thinking of using headless chrome, but right now i am content to just use this package as middleware for guzzle, i only have problem with one side.
thanks to the contributors it seems to be working now again, to start using it before the version is tagged you could just require this
"kyranrana/cloudflare-bypass": "dev-master#4e7a6f57df9884e450e7e02ef067425cc1f8801d",
in your composer.json
a suggestion, cloudflare use this header: server: cloudflare
so you could use this and the http code 503 to detect cloudflare
causes Notice: Undefined offset: 1 in /CloudflareBypass/vendor/kyranrana/cloudflare-bypass/src/main/Model/UAM/UAMPageFormParams.php on line 40
Fatal error: Uncaught TypeError: Argument 1 passed to CloudflareBypass\Model\UAM\UAMPageFormParams::__construct() must be of the type string, null given, called in /CloudflareBypass/vendor/kyranrana/cloudflare-bypass/src/main/Model/UAM/UAMPageFormParams.php on line 40 and defined in /CloudflareBypass/vendor/kyranrana/cloudflare-bypass/src/main/Model/UAM/UAMPageFormParams.php:97 Stack trace: