Open s4028600 opened 4 years ago
Cfscrape was normal yesterday, but it's not working today. The source code of cloudflare's web page has obviously changed. http://www.m45e.com/
Same problem here.
Yes, yesterday everything was fine. And now i noticed this:
challenge, ms = re.search(r"setTimeout\(function\(\){\s*(var "r"s,t,o,p,b,r,e,a,k,i,n,g,f.+?\r?\n[\s\S]+?a\.value\s*=.+?)\r?\n"r"(?:[^{<>]*},\s*(\d{4,}))?",javascript, flags=re.S).groups()
(It's @ line 253 in _init_.py)
Then I checked the html and noticed this:
(Look at the space between
s,t,o,p, b,r,e,a,k,i,n,g
, next top,
variable)
So it seemed to be a missing space in the regex.
Add an space or
.?
in the regex (again, it's near line 253 in _init_.py).
This worked for me at least (after 15 minutes debugging)
I have also gone through the HTML of that site with Cloudflare protection and it seemed changed but I never realized this was so small. Well, I'm not that good debugger. I was quite confused about this javascript challenge because it involves lots of things that are hard to understand. But you came here like a godly hand. How could you do that? I mean there could be a number of other things which can cause this problem. How the hell this small space .? regex. Haahahahahahahahhahahaha Really you are phenomenal. :)
Yes, yesterday everything was fine. And now i noticed this:
challenge, ms = re.search(r"setTimeout\(function\(\){\s*(var "r"s,t,o,p,b,r,e,a,k,i,n,g,f.+?\r?\n[\s\S]+?a\.value\s*=.+?)\r?\n"r"(?:[^{<>]*},\s*(\d{4,}))?",javascript, flags=re.S).groups()
(It's @ line 253 in init.py)
Then I checked the html and noticed this:
(Look at the space between
s,t,o,p, b,r,e,a,k,i,n,g
, next top,
variable)So it seemed to be a missing space in the regex.
Add an space or
.?
in the regex (again, it's near line 253 in init.py).This worked for me at least (after 15 minutes debugging)
i did the changes for the new challenge but i am still having issues.
Traceback (most recent call last):
File "C:\Users\Acer\AppData\Local\Programs\Python\Python38\lib\site-packages\cfscrape\__init__.py", line 251, in solve_challenge
challenge, ms = re.search(
AttributeError: 'NoneType' object has no attribute 'groups'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "animeultima.py", line 8, in <module>
html_content=scraper.get(uri).content
File "C:\Users\Acer\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\sessions.py", line 543, in get
return self.request('GET', url, **kwargs)
File "C:\Users\Acer\AppData\Local\Programs\Python\Python38\lib\site-packages\cfscrape\__init__.py", line 129, in request
resp = self.solve_cf_challenge(resp, **kwargs)
File "C:\Users\Acer\AppData\Local\Programs\Python\Python38\lib\site-packages\cfscrape\__init__.py", line 204, in solve_cf_challenge
answer, delay = self.solve_challenge(body, domain)
File "C:\Users\Acer\AppData\Local\Programs\Python\Python38\lib\site-packages\cfscrape\__init__.py", line 290, in solve_challenge
raise ValueError(
ValueError: Unable to identify Cloudflare IUAM Javascript on website. Cloudflare may have changed their technique, or there may be a bug in the script.
Please read https://github.com/Anorov/cloudflare-scrape#updates, then file a bug report at https://github.com/Anorov/cloudflare-scrape/issues."
@spyderbibek mmm... can you share the piece of your code?
@spyderbibek mmm... can you share the piece of your code?
here you go
import cfscrape
from bs4 import BeautifulSoup
uri="https://www1.animeultima.to/"
scraper= cfscrape.create_scraper()
html_content=scraper.get(uri).content
print(html_content)
@spyderbibek did you update your cfscrape module and you have node js > 10
Check these criteria
[ ✓] I've upgraded cfscrape with pip install -U cfscrape
[ ✓] I'm using Node version 10 or higher
[ ✓] The site protection I'm having issues with is from Cloudflare
[ ✓] I'm not using Tor, a VPN, or an anonymizing proxy
Check Node Version : (node --version or nodejs --version)
And one more thing SpyderBibek is that when you made the changes in init.py, are the changes remained there. Make sure that!
yes i have checked every criteria and i am 100% positive all are fulfilled and yes the changes in init.py persists.
@spyderbibek Well... I got this js challengue from cloudflare
(it's a completely different challengue I think so)
which is so much different than the spected one
I don't know so much about cloudflare. But I'll keep investigating
well for me i am getting this challenge
@spyderbibek Yes, me too (testing your code above). But there's more challengues then. After that, you'll get this:
I think that's because previous challengues were not successfully solved, so CF sends that (above js).
But trust me, in my case, I solved this as I said. That's for my page request (an university one). It's possible that your page request (an anime series one) CF is more strict. I dunno :/
It seems like cloudflare changed their methods. I'm litteraly sending same post request from my perl script like my browser does. But I keep getting 502 and keep redirected to another challenge.
I'd guess they are doing fingerprinting or similar checks. Using Selenium with either Chrome or Firefox I was still able to bypass CloudFlare.
I'd guess they are doing fingerprinting or similar checks. Using Selenium with either Chrome or Firefox I was still able to bypass CloudFlare.
I used to use phantomjs/capserjs, but they seem to be unmaintaned now.
how do you change the init.py file when running via a Linux virtual machine?
useless. this project is always same poor maintain...
and that was all..
Before creating an issue, first upgrade cfscrape with
pip install -U cfscrape
and see if you're still experiencing the problem. Please also confirm your Node version (node --version
ornodejs --version
) is version 10 or higher.Make sure the website you're having issues with is actually using anti-bot protection by Cloudflare and not a competitor like Imperva Incapsula or Sucuri. And if you're using an anonymizing proxy, a VPN, or Tor, Cloudflare often flags those IPs and may block you or present you with a captcha as a result.
Please confirm the following statements and check the boxes before creating an issue:
pip install -U cfscrape
Python version number
Run
python --version
and paste the output below:cfscrape version number
Run
pip show cfscrape
and paste the output below:Code snippet involved with the issue
Complete exception and traceback
(If the problem doesn't involve an exception being raised, leave this blank)
URL of the Cloudflare-protected page
[https://masiro.moe]
URL of Pastebin/Gist with HTML source of protected page
[LINK GOES HERE]