1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2025-02-01 12:01:41 +01:00

[acidimg] fix extraction

swap ' and " again (2e309a13)
and add a fallback in case this happens yet another time
This commit is contained in:
Mike Fährmann 2023-07-28 14:23:11 +02:00
parent 62fce6a75f
commit 7eab101144
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -171,10 +171,16 @@ class AcidimgImageExtractor(ImagehostImageExtractor):
_encoding = "utf-8"
def get_info(self, page):
url, pos = text.extract(page, '<img class="centred" src="', '"')
url, pos = text.extract(page, "<img class='centred' src='", "'")
if not url:
raise exception.NotFoundError("image")
filename, pos = text.extract(page, ' alt="', '"', pos)
url, pos = text.extract(page, '<img class="centred" src="', '"')
if not url:
raise exception.NotFoundError("image")
filename, pos = text.extract(page, "alt='", "'", pos)
if not filename:
filename, pos = text.extract(page, 'alt="', '"', pos)
return url, (filename + splitext(url)[1]) if filename else url