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:
parent
f3f27496d6
commit
7d0e5877ce
@ -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}
|
||||||
|
Loading…
Reference in New Issue
Block a user