1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 10:42:34 +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 = text.ensure_http_scheme(url)
url = url.replace("/medium_views/", "/images/", 1) url = url.replace("/medium_views/", "/images/", 1)
if text.ext_from_url(url) == "webp": 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 { yield {
"image" : url.replace(".webp", "." + ext), "image" : url.replace(".webp", "." + ext),
"_fallback": (url,), "_fallback": fallback,
} }
else: else:
yield {"image": url} yield {"image": url}