From 00d83d9588c3fa9ed6b753d0c6baa2dc90ce4a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 30 Dec 2023 18:33:46 +0100 Subject: [PATCH] [rule34us] add fallback for 'video-cdn1' videos (#4985) --- gallery_dl/extractor/rule34us.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/rule34us.py b/gallery_dl/extractor/rule34us.py index 6439a225..cf70cccb 100644 --- a/gallery_dl/extractor/rule34us.py +++ b/gallery_dl/extractor/rule34us.py @@ -38,7 +38,11 @@ class Rule34usExtractor(BooruExtractor): "height" : extr(' x ', 'h'), "file_url": extr(' src="', '"'), } - post["md5"] = post["file_url"].rpartition("/")[2].partition(".")[0] + + url = post["file_url"] + if "//video-cdn1." in url: + post["_fallback"] = (url.replace("//video-cdn1.", "//video."),) + post["md5"] = url.rpartition("/")[2].partition(".")[0] tags = collections.defaultdict(list) for tag_type, tag_name in self._find_tags(page):