[rule34us] add fallback for 'video-cdn1' videos (#4985)

This commit is contained in:
Mike Fährmann
2023-12-30 18:33:46 +01:00
parent caceb14fc2
commit 00d83d9588

View File

@@ -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):