[thehentaiworld] adjust 'type' according to post URL

This commit is contained in:
Mike Fährmann
2025-09-23 20:04:58 +02:00
parent 889ecd7963
commit c095ff2d9b
2 changed files with 9 additions and 2 deletions

View File

@@ -60,14 +60,16 @@ class ThehentaiworldExtractor(Extractor):
"<li>Posted: ", "<"), "%Y-%m-%d"),
}
if "/videos/" in url:
if (c := url[27]) == "v":
post["type"] = "video"
post["width"] = post["height"] = 0
post["votes"] = text.parse_int(extr("(<strong>", "</strong>"))
post["score"] = text.parse_float(extr("<strong>", "<"))
post["file_url"] = extr('<source src="', '"')
else:
post["type"] = "image"
post["type"] = ("animated" if c == "g" else
"3d cgi" if c == "3" else
"image")
post["width"] = text.parse_int(extr("<li>Size: ", " "))
post["height"] = text.parse_int(extr("x ", "<"))
post["file_url"] = extr('a href="', '"')