-
-
Notifications
You must be signed in to change notification settings - Fork 975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[kemonoparty] retry on DDoS-Guard challenges #3569
Conversation
improve flexibility by using functions instead of response codes
2887168
to
48aee6e
Compare
gallery_dl/extractor/common.py
Outdated
if code not in retry_codes and code < 500 and not \ | ||
(retry_on and retry_on(response)): | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if code not in retry_codes and code < 500 and not \ | |
(retry_on and retry_on(response)): | |
break | |
if code not in retry_codes and code < 500: | |
break | |
if retry_on and not retry_on(response): | |
break |
Just use two if
s.
Looks better and makes it easier to appease flake8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
retry_on
will not be reachable unless 403
is in retry_codes
. Perhaps you meant this:
if code not in retry_codes and code < 500:
if not (retry_on and retry_on(response)):
break
Also, the extra cookies ( |
Does this help when the initial page url throws a 403 or just items within the page? |
Both. You can use the |
Update: Got a slightly different challenge page:
|
48aee6e
to
0c16c98
Compare
I really like the idea of making This is also far from the first time this happened. I remember there being 3 other instances where ddosguard blocked access to kemono, but that usually resolved itself after a few days. It might also be helpful to ask about what's going on on partychan. |
Yeah, those legit 403 errors seem rare enough. I've been running gallery-dl for several days now and they never reappeared. |
and rename '_http_retry_codes' to '_http_retry' (#3569)
This is related to #3566. DDoS-Guard has recently been throwing a lot more 403 errors, which can usually be worked around by retrying after a short period of time. The
retry-codes
option already handles this very well, but I've seen some legit 403 errors sent by the origin server (e.g. https://c2.kemono.party/data/files/357512/55364284/Sample.png), so this PR tries to detect DDoS-Guard's challenge page.Example error response: