[imagevenue] improve error for dead images (#8477)

This commit is contained in:
Mike Fährmann
2025-10-29 09:20:14 +01:00
parent f692380950
commit d7a7557f93
2 changed files with 14 additions and 1 deletions

View File

@@ -174,7 +174,11 @@ class ImagevenueImageExtractor(ImagehostImageExtractor):
example = "https://www.imagevenue.com/ME123456789"
def get_info(self, page):
pos = page.index('class="card-body')
try:
pos = page.index('class="card-body')
except ValueError:
raise exception.NotFoundError("image")
url, pos = text.extract(page, '<img src="', '"', pos)
if url.endswith("/loader.svg"):
url, pos = text.extract(page, '<img src="', '"', pos)

View File

@@ -5,6 +5,7 @@
# published by the Free Software Foundation.
from gallery_dl.extractor import imagehosts
from gallery_dl import exception
__tests__ = (
@@ -46,4 +47,12 @@ __tests__ = (
"#sha1_content": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
},
{
"#url" : "http://img42.imagevenue.com/img.php?loc=loc1003%E2%84%91=20377_Alessandra_Ambrosio_Celebrity_City_Arriving_Mokai_Nightclub_17_13_1003lo.jpg",
"#comment" : "dead link / '404 Image Unavailable' redirect (#8477)",
"#category": ("imagehost", "imagevenue", "image"),
"#class" : imagehosts.ImagevenueImageExtractor,
"#exception": exception.NotFoundError,
},
)