Anorov / cloudflare-scrape

A Python module to bypass Cloudflare's anti-bot page.
MIT License
3.35k stars 458 forks source link

Not Working #343

Open Alaa-HIjazi opened 4 years ago

Alaa-HIjazi commented 4 years ago

I Tried so Many ways and it doesn't bypass CF, i used your method which is not working, i even wrote a code in python to when i get the cookies i add them directly to a curl and so on, and it always give me the cloudfare html ...

lord8266 commented 4 years ago

Which site?

Alaa-HIjazi commented 4 years ago

Which site?

it's dehashed it got the 2 cookies cfduid and cf_clearance a mysession cookie and another cookie, but i debugged the issue in several ways to finally realize if i remove the cf_clearance cookie it will not work, so i literally replaced the cf_clearance id on every request using this technique and it's not working i can share a little of my code and some screenshots

lord8266 commented 4 years ago

What output do you get for this

sess=cfscrape.create_scraper()
sess.get_tokens("<your url>")

If you are just getting a 403 then your issue might be similar to #338

Also try for this site: https://www.kissanime.ru to confirm cfscrape works on your side as it is now

J0rdyZ65 commented 4 years ago

IMHO, the action used in the submit_url should be the entire string scrapped from the form (eg including the part after the '?'). Further, the "&amp;" strings included should be replaced with "&". At least, this works for me.

< re.search(r'action=\"(.*?)\"', challenge_form, flags=re.S).group(1).replace('&amp;', '&'))

                                re.search(r'action=\"(.*?)\"', challenge_form, flags=re.S).group(1).split('?')[0])

Alaa-HIjazi commented 4 years ago

I'm getting the cookies perfectly but when i include them in a curl to get the json, i always get the cloudfare html this is what i mean, @J0rdyZ65 if i do what you mentioned it will work ? but i'm using the url of the curl. Thank you guys !