summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/gelbooru.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/gelbooru.py')
-rw-r--r--gallery_dl/extractor/gelbooru.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/gallery_dl/extractor/gelbooru.py b/gallery_dl/extractor/gelbooru.py
index edadd31..c32ba5c 100644
--- a/gallery_dl/extractor/gelbooru.py
+++ b/gallery_dl/extractor/gelbooru.py
@@ -33,6 +33,15 @@ class GelbooruExtractor(booru.XmlParserMixin,
self.session.cookies["fringeBenefits"] = "yup"
self.per_page = 42
+ @staticmethod
+ def get_file_url(image):
+ url = image["file_url"]
+ if url.startswith("https://mp4.gelbooru.com/"):
+ ihash = image["md5"]
+ return "https://img2.gelbooru.com/images/{}/{}/{}.webm".format(
+ ihash[0:2], ihash[2:4], ihash)
+ return url
+
def items_noapi(self):
yield Message.Version, 1
data = self.get_metadata()