Browse Source

Change improve Cloudflare connectivity.

tags/release_0.21.28^2
JackDandy 5 years ago
parent
commit
d67bb0f22d
  1. 7
      CHANGES.md
  2. 4
      lib/cfscrape/__init__.py

7
CHANGES.md

@ -1,4 +1,9 @@
### 0.21.27 (2020-04-22 20:35:00 UTC)
### 0.21.28 (2020-04-24 09:40:00 UTC)
* Change improve Cloudflare connectivity
### 0.21.27 (2020-04-22 20:35:00 UTC)
* Update TZlocal 2.0.0b3 (410a838) to 2.1b1 (dd79171)
* Change Emby notifier to add unofficial support for Jellyfin

4
lib/cfscrape/__init__.py

@ -157,7 +157,7 @@ class CloudflareScraper(Session):
# Something is wrong with the page, perhaps CF changed their anti-bot technique
raise ValueError('Unable to find a new location from Cloudflare anti-bot IUAM page')
if not r.netloc:
if not r.netloc or location.startswith('/'):
location = urlunparse((parsed_url.scheme, domain, r.path, r.params, r.query, r.fragment))
return self.request(resp.request.method, location, **original_kwargs)
@ -167,7 +167,7 @@ class CloudflareScraper(Session):
js = re.search(
r'''(?x)
setTimeout\(function\(\){\s*?(var\s*?
(?:s,t,o,p,b,r,e,a,k,i,n,g|t,r,a),f.+?[\r\n\s\S]*?a\.value\s*=.+?)[\r\n]+
(?:s,t,o,p,\s*?b,r,e,a,k,i,n,g|t,r,a),f.+?[\r\n\s\S]*?a\.value\s*=.+?)[\r\n]+
''', body).group(1)
except (BaseException, Exception):
raise RuntimeError('Error #1 Cloudflare anti-bots changed, please notify SickGear for an update')

Loading…
Cancel
Save