Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

ClosedPort22
Copy link
Contributor

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:

GET https://kemono.party/fantia/user/6188/post/1268108
Status: 403 Forbidden

Request Headers
---------------
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.66 Safari/537.36 Edg/103.0.1264.44
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://kemono.party/
Cookie: __ddg1_=***; __ddg2=***

Response Headers
----------------
Server: ddos-guard
Date: Wed, 25 Jan 2023 05:58:21 GMT
Connection: keep-alive
Keep-Alive: timeout=60
Set-Cookie: __ddgid_=***; Domain=.kemono.party; HttpOnly; Path=/; Expires=Thu, 25-Jan-2024 05:58:21 GMT, __ddgmark_=***; Domain=.kemono.party; HttpOnly; Path=/; Expires=Thu, 26-Jan-2023 05:58:21 GMT, __ddg5_=***; Domain=.kemono.party; Path=/; HttpOnly; Expires=Wed, 25-Jan-2023 08:58:21 GMT
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: text/html; charset=UTF-8
Content-Length: 11279

Content
-------
<!DOCTYPE html><html><head><title>DDOS-GUARD</title><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><script>var DOMReady=function(t){var e=document,d="addEventListener";e[d]?e[d]("DOMContentLoaded",t):window.attachEvent("onload",t)},loadScript=function(t,e){var d=document.createElement("script");d.type="text/javascript",d.src=t,"string"==typeof e&&""!==e&&(d.id=e),(document.getElementsByTagName("head")[0]||document.body).appendChild(d)};DOMReady(function(){loadScript("/.well-known/ddos-guard/check?context=free_splash","ddg_script_f"),loadScript("https://check.ddos-guard.net/check.js")});</script><style>*{margin:0;padding:0}body,html{font-family:Open Sans,Arial,Helvetica,sans-serif;height:100%;color:#333}#wrap-main{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0 auto;max-width:1000px;padding:0 10px 70px}#link-ddg{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;white-space:nowrap;margin:0 auto 30px;font-size:12px;color:#636363}#link-ddg a{text-decoration:none}#link-ddg a:active,#link-ddg a:hover,#link-ddg a:link,#link-ddg a:visited{color:#3399e0}#link-ddg a:focus{color:#3399e0}.container{background:#fff;margin:0 auto}#dg-load{margin-top:25px}.logo-foot{margin-bottom:10px}@media screen and (max-width:1200px){.main{width:500px}#link-ddg{font-size:12px}}@media screen and (max-width:767px){#description{font-size:13px}#link-ddg{margin-bottom:10px;font-size:9px}}.logo{width:120px;margin-bottom:35px}#title{font-size:32px;font-weight:900;margin-bottom:40px}#description{color:#8f9390;margin-bottom:30px}.container{display:-webkit-box;display:-ms-flexbox;display:flex;display:-webkit-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;text-align:center;background:url(data:image/svg+xml;base64,PHN2ZyBpZD0i0KHQu9C+0LlfMSIgZGF0YS1uYW1lPSLQodC70L7QuSAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNjYuNzUgNDcuOTciPjxkZWZzPjxzdHlsZT4uY2xzLTF7ZmlsbDojZmZmO308L3N0eWxlPjwvZGVmcz48dGl0bGU+0JzQvtC90YLQsNC20L3QsNGPINC+0LHQu9Cw0YHRgtGMIDE8L3RpdGxlPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTEzNS41NSwzOS44MmMtLjM4LDAtLjc1LDAtMS4xMywwYTE4LjkxLDE4LjkxLDAsMCwwLTM1LjMzLTQuNTNBMjUuMjYsMjUuMjYsMCwwLDAsNzcuMjEsMjIuN2MtLjgyLDAtMS42MywwLTIuNDMuMTJBMjkuMjYsMjkuMjYsMCwwLDAsMTcsMjkuMjZhMjkuNTksMjkuNTksMCwwLDAsLjE2LDNBMTguNTIsMTguNTIsMCwwLDAsMCw0OEgxNTAuNDNBMTcuNjQsMTcuNjQsMCwwLDAsMTM1LjU1LDM5LjgyWiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE1OS40OSw0NS40NUE5LjU4LDkuNTgsMCwwLDAsMTUzLDQ4aDEzQTkuNTgsOS41OCwwLDAsMCwxNTkuNDksNDUuNDVaIi8+PC9zdmc+) center bottom no-repeat}.lds-spin{width:80px;height:80px}@media screen and (max-width:1200px){.logo{width:100px}#title{font-size:29px}}@media screen and (max-width:770px){.logo{width:70px;margin-bottom:10px}#description,#title{font-size:15px;margin-bottom:10px}#description{font-size:13px}.lds-spin{width:40px;height:40px}}</style></head><body><div class="container"><div class="logo"><img src="data:image/svg+xml;base64,PHN2ZyBpZD0iZGwiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDYuNjIgNy42OSI+Cgk8ZGVmcz4KCQk8c3R5bGU+CgkJCS5jbHMtMSB7CgkJCWlzb2xhdGlvbjogaXNvbGF0ZTsKCQkJfQoJCQkuY2xzLTIgewoJCQlmaWxsOiAjMDBhZGVlOwoJCQl9CgkJCS5jbHMtMyB7C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ZWdpbj0iMHMiIHZhbHVlcz0iMC43IDAuNzsxIDEiIGtleVRpbWVzPSIwOzEiIGR1cj0iMXMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj4KCQkJCTwvYW5pbWF0ZVRyYW5zZm9ybT4KCQkJCTxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImZpbGwtb3BhY2l0eSIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIHZhbHVlcz0iMTswIiBiZWdpbj0iMHMiPgoJCQkJPC9hbmltYXRlPgoJCQk8L2NpcmNsZT4KCQk8L2c+Cgk8L2c+Cjwvc3ZnPgo=" alt></div></div><script type="text/javascript">var lang=navigator.language,host=window.location.hostname;"ru"==lang||"ru-RU"==lang?(document.getElementById("title").innerHTML="Проверка браузера перед переходом на сайт "+host,document.getElementById("description").innerHTML="Это автоматический процесс. Вы будете перенаправлены на запрашиваемый ресурс в ближайшее время.<br>Пожалуйста ожидайте...",document.getElementById("link").innerHTML="Защита от DDoS-атак DDos-Guard"):(document.getElementById("title").innerHTML="Checking your browser accessing "+host,document.getElementById("description").innerHTML="This process is automatic. Your browser will redirect to your requested content shortly.<br>Please allow up to 5 seconds...",document.getElementById("link").innerHTML="DDoS protection by DDos-Guard");</script></body></html>

improve flexibility by using functions instead of response codes
@ClosedPort22 ClosedPort22 force-pushed the kemono-retry branch 2 times, most recently from 2887168 to 48aee6e Compare January 25, 2023 12:22
Comment on lines 167 to 169
if code not in retry_codes and code < 500 and not \
(retry_on and retry_on(response)):
break
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 ifs.
Looks better and makes it easier to appease flake8.

Copy link
Contributor Author

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

@ClosedPort22
Copy link
Contributor Author

Also, the extra cookies (__ddg5_, __ddgmark_ and __ddgid_) sent along with the challenge page can be safely rejected to prevent tracking and possibly further "bot" identification, although I'm not entirely sure how to do this.

@biggestsonicfan
Copy link

Does this help when the initial page url throws a 403 or just items within the page?

@ClosedPort22
Copy link
Contributor Author

Does this help when the initial page url throws a 403 or just items within the page?

Both. You can use the retry-codes option on the latest release and get basically the same effect.

@ClosedPort22 ClosedPort22 marked this pull request as draft January 26, 2023 07:25
@ClosedPort22
Copy link
Contributor Author

Update: Got a slightly different challenge page:

Status: 403 Forbidden

Request Headers
---------------
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.66 Safari/537.36 Edg/103.0.1264.44
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://kemono.party/
Cookie: __ddg1_=***; __ddg2=***; __ddg5_=***

Response Headers
----------------
Server: ddos-guard
Date: Thu, 26 Jan 2023 08:28:18 GMT
Connection: keep-alive
Keep-Alive: timeout=60
Set-Cookie: __ddgid_=***; Domain=.kemono.party; HttpOnly; Path=/; Expires=Fri, 26-Jan-2024 08:28:18 GMT, __ddgmark_=***; Domain=.kemono.party; HttpOnly; Path=/; Expires=Fri, 27-Jan-2023 08:28:18 GMT
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: text/html; charset=UTF-8
Content-Length: 11632

Content
-------
<!DOCTYPE html><html><head><title>DDoS-Guard</title><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><script>var DOMReady=function(t){var e=document,d="addEventListener";e[d]?e[d]("DOMContentLoaded",t):window.attachEvent("onload",t)},loadScript=function(t,e){var d=document.createElement("script");d.type="text/javascript",d.src=t,"string"==typeof e&&""!==e&&(d.id=e),(document.getElementsByTagName("head")[0]||document.body).appendChild(d)};DOMReady(function(){loadScript("/.well-known/ddos-guard/check?context=free_splash","ddg_script_f"),loadScript("https://check.ddos-guard.net/check.js")});</script><style>*{margin:0;padding:0}body,html{font-family:Open Sans,Arial,Helvetica,sans-serif;height:100%;color:#333}#wrap-main{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0 auto;max-width:1000px;padding:0 10px 70px}#link-ddg{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;margin:0 auto 30px;color:#636363}#link-ddg a{text-decoration:none}#link-ddg a:link{color:#3399e0}#link-ddg a:focus{color:#3399e0}.container{background:#fff;margin:0 auto}#dg-load{margin-top:25px}.logo-foot{margin-bottom:10px}@media screen and (max-width:1200px){.main{width:500px}#link-ddg{font-size:12px}}@media screen and (max-width:767px){#description{font-size:13px}#link-ddg{margin-bottom:10px;font-size:9px}}.logo{width:120px;margin-bottom:35px}#title{font-size:32px;font-weight:900;margin-bottom:40px}#description{color:#8f9390;margin-bottom:30px}#link-ddg{white-space:nowrap;margin-bottom:30px;font-size:18px}#link-ddg a:focus:active:hover:visited{color:#00adee}#link-ddg a:active,#link-ddg a:hover,#link-ddg a:visited{color:#00adee}.container{display:-webkit-box;display:-ms-flexbox;display:flex;display:-webkit-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;text-align:center;background:url(data:image/svg+xml;base64,PHN2ZyBpZD0i0KHQu9C+0LlfMSIgZGF0YS1uYW1lPSLQodC70L7QuSAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNjYuNzUgNDcuOTciPjxkZWZzPjxzdHlsZT4uY2xzLTF7ZmlsbDojZmZmO308L3N0eWxlPjwvZGVmcz48dGl0bGU+0JzQvtC90YLQsNC20L3QsNGPINC+0LHQu9Cw0YHRgtGMIDE8L3RpdGxlPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTEzNS41NSwzOS44MmMtLjM4LDAtLjc1LDAtMS4xMywwYTE4LjkxLDE4LjkxLDAsMCwwLTM1LjMzLTQuNTNBMjUuMjYsMjUuMjYsMCwwLDAsNzcuMjEsMjIuN2MtLjgyLDAtMS42MywwLTIuNDMuMTJBMjkuMjYsMjkuMjYsMCwwLDAsMTcsMjkuMjZhMjkuNTksMjkuNTksMCwwLDAsLjE2LDNBMTguNTIsMTguNTIsMCwwLDAsMCw0OEgxNTAuNDNBMTcuNjQsMTcuNjQsMCwwLDAsMTM1LjU1LDM5LjgyWiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE1OS40OSw0NS40NUE5LjU4LDkuNTgsMCwwLDAsMTUzLDQ4aDEzQTkuNTgsOS41OCwwLDAsMCwxNTkuNDksNDUuNDVaIi8+PC9zdmc+) center bottom no-repeat}.lds-spin{width:80px;height:80px}@media screen and (max-width:1200px){.logo{width:100px}#title{font-size:29px}#link-ddg{font-size:20px}}@media screen and (max-width:770px){#title,.logo{margin-bottom:10px}.logo{width:70px}#title{font-size:15px}#description,#link-ddg{margin-bottom:10px;font-size:13px}.lds-spin{width:40px;height:40px}}</style></head><body><div class="container"><div class="logo"><img src="data:image/svg+xml;base64,PHN2ZyBpZD0iZGwiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDYuNjIgNy42OSI+Cgk8ZGVmcz4KCQk8c3R5bGU+CgkJCS5jbHMtMSB7CgkJCWlzb2xhdGlvbjogaXNvbGF0ZTsKCQkJfQoJCQkuY2xzLTIgewoJCQlmaWxsOiAjMDBhZGVlOwoJCQl9CgkJCS5jbHMtMyB7CgkJCWZpbGw6ICNmZmY7CgkJCX0KCQk8L3N0eWxlPgoJPC9kZWZzPgoJPHRpdGxlPgoJCWRkb3NfMwoJPC90aXRsZT4KCTxnIGlkPSJfMjU2MCIgZGF0YS1uYW1lPSIyNTYwIiBjbGFzcz0iY2xzLTEiPgoJCTxnIGlkPSJHMiIgZGF0YS1uYW1lPSJHcjIiPgoJCQk8cGF0aCBjbGFzcz0iY2xzLTIiIGQ9Ik0zLjMsMEE2LDYsMCwwLDEsMCwxLjkxQy4xMyw0LjQ2LDEuNiw3LjQ5LDMuMyw3LjY1LDUsNy40OSw2LjQ3LDQuNDYsNi42LDEuOTFBNiw2LDAsMCwxLDMuMywwWiIgLz4KCQkJPHBvbHlnb24gY2xhc3M9ImNscy0zIiBwb2ludHM9IjQuNTUgNC43MyA0LjU1IDIuNzQgMy4yOSAxLjc5IDIuMDMgMi43MSAyLjAzIDIuOTEgMy4yNSAyLjIgMy4yNSAyLjU5IDIuMDMgMy4xNiAyLjAzIDMuNCAzLjI1IDIuOTUgMy4yNSAzLjI2IDIuMDMgMy42NiAyLjAzIDMuOTEgMy4yNSAzLjY2IDMuMjUgNC4wMSAyLjAzIDQuMTggMi4wMyA0LjQzIDMuMjUgNC4zNiAzLjI1IDQuNzMgMS44OSA0LjczIDEuODkgNS4wOSA0LjcxIDUuMDkgNC43MSA0LjczIDQuNTUgNC43MyIgLz4KCQk8L2c+Cgk8L2c+Cjwvc3ZnPgo=" alt></div><div id="title"></div><div id="description"></div><div id="link-ddg"><a href target="_blank" id="link"></a></div><div class="lds"><img src="data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ibGRzLXNwaW4iIHdpZHRoPSIxMDBweCIgaGVpZ2h0PSIxMDBweCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmlld0JveD0iMCAwIDEwMCA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WJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InNjYWxlIiBiZWdpbj0iMHMiIHZhbHVlcz0iMC43IDAuNzsxIDEiIGtleVRpbWVzPSIwOzEiIGR1cj0iMXMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj4KCQkJCTwvYW5pbWF0ZVRyYW5zZm9ybT4KCQkJCTxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImZpbGwtb3BhY2l0eSIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIHZhbHVlcz0iMTswIiBiZWdpbj0iMHMiPgoJCQkJPC9hbmltYXRlPgoJCQk8L2NpcmNsZT4KCQk8L2c+Cgk8L2c+Cjwvc3ZnPgo=" alt></div></div><script type="text/javascript">var lang=navigator.language,host=window.location.hostname;const link="https://ddos-guard.net?utm_source="+host+"&utm_medium=preloader",linkElement=document.getElementById("link");linkElement.setAttribute("href",link),"ru"==lang||"ru-RU"==lang?(document.getElementById("title").innerHTML="Проверка браузера перед переходом на сайт "+host,document.getElementById("description").innerHTML="Это автоматический процесс. Вы будете перенаправлены на запрашиваемый ресурс в ближайшее время.<br>Пожалуйста ожидайте...",document.getElementById("link").innerHTML="Защита от DDoS-атак DDos-Guard"):(document.getElementById("title").innerHTML="Checking your browser accessing "+host,document.getElementById("description").innerHTML="This process is automatic. Your browser will redirect to your requested content shortly.<br>Please allow up to 5 seconds...",document.getElementById("link").innerHTML="DDoS protection by DDos-Guard");</script></body></html>

@ClosedPort22 ClosedPort22 marked this pull request as ready for review January 26, 2023 11:32
@mikf
Copy link
Owner

mikf commented Jan 28, 2023

I really like the idea of making _http_retry_... a proper Python function, but I'm against hardcoding a check/retry for ddosguard challenges, especially since "retry-codes": [403] kind of has the same effect. This is just bound to cause problems later on.

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.

@ClosedPort22
Copy link
Contributor Author

I'm against hardcoding a check/retry for ddosguard challenges, especially since "retry-codes": [403] kind of has the same effect.

Yeah, those legit 403 errors seem rare enough. I've been running gallery-dl for several days now and they never reappeared.

mikf added a commit that referenced this pull request Mar 10, 2023
and rename '_http_retry_codes' to '_http_retry'

(#3569)
@ClosedPort22 ClosedPort22 deleted the kemono-retry branch March 11, 2023 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants