[imagefap] don't return anything for empty profiles (#9034)

This commit is contained in:
Mike Fährmann
2026-02-10 10:28:49 +01:00
parent 640d5f1621
commit ce8d61df66
3 changed files with 13 additions and 4 deletions

View File

@@ -233,12 +233,14 @@ class ImagefapUserExtractor(ImagefapExtractor):
page = response.text
folders = text.extr(
page, ' id="tgl_all" value="', '"').rstrip("|").split("|")
if folders and folders[-1] == "-1":
if folders[-1] == "-1":
last = folders.pop()
if not pnum:
folders.insert(0, last)
elif not folders[0]:
break
yield from folders
params["page"] = pnum = pnum + 1
if f'href="?page={pnum}">{pnum+1}</a>' not in page:
return
break

View File

@@ -114,8 +114,8 @@ __tests__ = (
"#comment" : "empty 'var g_th = $.parseJSON('');' (#8951)",
"#category": ("IMHentai", "hentaienvy", "gallery"),
"#class" : imhentai.ImhentaiGalleryExtractor,
"#metadata": "post",
"#count" : 0,
"#pattern" : r"https://m8.hentaienvy.com/026/3zf1yedx5m/\d+\.jpg",
"#count" : 188,
"#log" : "1119432: Missing image data",
"artist" : [],

View File

@@ -217,4 +217,11 @@ __tests__ = (
"#count" : 100,
},
{
"#url" : "https://www.imagefap.com/profile/Tiffany_and_me",
"#comment" : "empty profile (#9034)",
"#class" : imagefap.ImagefapUserExtractor,
"#count" : 0,
},
)