Closed lord8266 closed 11 months ago
Hey @lord8266, thanks for this PR. At this moment, I don't see cloudflare blocks the normal usage. If you got troubles with cloudflare when using the script, and this solution works for you, then please feel free to keep those changes in your repository. I will close this PR for now, if anyone else has troubles with cloudflare, I will refer to your PR. Thanks.
Pretty sure the other two bugs because of cloudflare
@lord8266, possible. Let me check again and come back to you.
@lord8266 I see, cloudflare is involved for the very first session. The latest commits should do the trick.
Nice @KevCui. I spent so much effort like a noob
Almost as if animepahe wants to allow scripts (What is the point of ddos protection if it allows scripts). Maybe ddos protection will activate if the ip sends too many requests and captcha will show up, then it is pretty much impossible at that point. Nice thinking though you really know what you are doing. I still too bad for open source sorry such a cringe pr
Hey @lord8266, don't be sorry. Thanks to you, this issue is found and addressed. Your efforts are appreciated 👍
I have added selenium to handle cloudflare protection page with
selenium-webdriver
npm package. One first request selenium is used and session details is saved to file, then on subsequent requests use curl with the session (useragent+cookies)Using file to save the session so that future calls to the script will not require to use selenium, if the session expires and the challenge is presented selenium will be called again.
I had to extract useragent from selenium since cloudflare somehow knows if the useragent sent in the request is the same as the browser via js (otherwise I could just hardcode any useragent).
Please let me know if it works for you. Thanks