diff options
| author | 2025-04-27 20:34:08 -0400 | |
|---|---|---|
| committer | 2025-04-27 20:34:08 -0400 | |
| commit | 4a18b5837c1dd82f5964afcfc3fecc53cd97e79c (patch) | |
| tree | 44019190a44fd449daa0efd07c65bbe524688c33 /gallery_dl/extractor/gelbooru.py | |
| parent | b830dc03b3b7c9dd119648e1be9c1145d56e096c (diff) | |
New upstream version 1.29.5.upstream/1.29.5
Diffstat (limited to 'gallery_dl/extractor/gelbooru.py')
| -rw-r--r-- | gallery_dl/extractor/gelbooru.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/gallery_dl/extractor/gelbooru.py b/gallery_dl/extractor/gelbooru.py index eb07739..f24b696 100644 --- a/gallery_dl/extractor/gelbooru.py +++ b/gallery_dl/extractor/gelbooru.py @@ -107,22 +107,16 @@ class GelbooruBase(): return params["pid"] += self.per_page - @staticmethod - def _file_url(post): + def _file_url(self, post): url = post["file_url"] if url.endswith((".webm", ".mp4")): + post["_fallback"] = (url,) md5 = post["md5"] + root = text.root_from_url(post["preview_url"]) path = "/images/{}/{}/{}.webm".format(md5[0:2], md5[2:4], md5) - post["_fallback"] = GelbooruBase._video_fallback(path) - url = "https://img4.gelbooru.com" + path + url = root + path return url - @staticmethod - def _video_fallback(path): - yield "https://img3.gelbooru.com" + path - yield "https://img2.gelbooru.com" + path - yield "https://img1.gelbooru.com" + path - def _notes(self, post, page): notes_data = text.extr(page, '<section id="notes"', '</section>') if not notes_data: |
