1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

[newgrounds] add more fallback URLs for 'art-images' files

This commit is contained in:
Mike Fährmann 2024-10-01 08:01:45 +02:00
parent f3f27496d6
commit 7d0e5877ce
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -244,9 +244,12 @@ class NewgroundsExtractor(Extractor):
url = text.ensure_http_scheme(url)
url = url.replace("/medium_views/", "/images/", 1)
if text.ext_from_url(url) == "webp":
fallback = [url.replace(".webp", "." + e)
for e in ("jpg", "png", "gif") if e != ext]
fallback.append(url)
yield {
"image" : url.replace(".webp", "." + ext),
"_fallback": (url,),
"_fallback": fallback,
}
else:
yield {"image": url}