[bunkr] detect new maintenance video file (#8802)
* fix(bunkr): catch new maintenance video file during validation Bunkr has performing a large scale maintenance recently, and I've noticed that I would on occasion download a file only to get a short server is in maintenance video instead of the intended file. Debug logs show the filename for the maintenance video has changed: [urllib3.connectionpool][debug] Starting new HTTPS connection (1): 3d09xl1.b-cdn.net:443 [urllib3.connectionpool][debug] https://3d09xl1.b-cdn.net:443 "GET /c4f36040-bdd1-40b6-aea1-034dfbe88ba2/maint.mp4 HTTP/1.1" 200 322509 This commit fixes the detection of that file to properly send the "File server in maintenance mode" warning instead of downloading an unintended file. Signed-off-by: Benjamin VERGNAUD <ben@bvergnaud.fr> * check multiple suffixes with one 'endswith()' call --------- Signed-off-by: Benjamin VERGNAUD <ben@bvergnaud.fr>
This commit is contained in:
committed by
GitHub
parent
5e94bae906
commit
3b316c857f
@@ -202,7 +202,8 @@ class BunkrAlbumExtractor(LolisafeAlbumExtractor):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def _validate(self, response):
|
def _validate(self, response):
|
||||||
if response.history and response.url.endswith("/maintenance-vid.mp4"):
|
if response.history and response.url.endswith(
|
||||||
|
("/maint.mp4", "/maintenance-vid.mp4")):
|
||||||
self.log.warning("File server in maintenance mode")
|
self.log.warning("File server in maintenance mode")
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user