Skip to content

Commit

Permalink
[bunkr] fail downloads for 'maintenance' files (#5952)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Aug 7, 2024
1 parent 575e5df commit 34433f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gallery_dl/extractor/bunkr.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def fetch_album(self, album_id):
"album_name" : text.unescape(info[0]),
"album_size" : size[1:-1],
"count" : len(urls),
"_http_validate": self._validate,
}

def _extract_files(self, urls):
Expand All @@ -74,6 +75,12 @@ def _extract_file(self, url):
text.rextract(page, ' href="', '"', page.rindex("Download"))[0]
)

def _validate(self, response):
if response.history and response.url.endswith("/maintenance-vid.mp4"):
self.log.warning("File server in maintenance mode")
return False
return True


class BunkrMediaExtractor(BunkrAlbumExtractor):
"""Extractor for bunkr.sk media links"""
Expand All @@ -95,4 +102,5 @@ def fetch_album(self, album_id):
"album_size" : -1,
"description": "",
"count" : 1,
"_http_validate": self._validate,
}

0 comments on commit 34433f5

Please sign in to comment.