[warosu] Simpler/less costly hostname check

This commit is contained in:
NecRaul
2025-06-20 14:26:04 +04:00
parent 3c85032b9b
commit 5ba7c98bc2

View File

@@ -39,7 +39,7 @@ class WarosuThreadExtractor(Extractor):
yield Message.Directory, data
for post in posts:
if "image" in post and "warosu" in post["image"]:
if "image" in post:
for key in ("w", "h", "no", "time", "tim"):
post[key] = text.parse_int(post[key])
dt = text.parse_timestamp(post["time"])
@@ -98,6 +98,8 @@ class WarosuThreadExtractor(Extractor):
if url:
if url[0] == "/":
data["image"] = self.root + url
elif "warosu." not in url:
return False
else:
data["image"] = url
return True