mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
[common] use 'cf-mitigated' header to detect challenges
This commit is contained in:
parent
4b04ccb3a1
commit
0db3c11ab0
@ -196,6 +196,10 @@ class Extractor():
|
||||
server = response.headers.get("Server")
|
||||
if server and server.startswith("cloudflare") and \
|
||||
code in (403, 503):
|
||||
mitigated = response.headers.get("cf-mitigated")
|
||||
if mitigated and mitigated.lower() == "challenge":
|
||||
self.log.warning("Cloudflare challenge")
|
||||
break
|
||||
content = response.content
|
||||
if b"_cf_chl_opt" in content or b"jschl-answer" in content:
|
||||
self.log.warning("Cloudflare challenge")
|
||||
|
Loading…
Reference in New Issue
Block a user