From 5ba7c98bc2cc2d727928f9883d855b49cbbc3c39 Mon Sep 17 00:00:00 2001 From: NecRaul Date: Fri, 20 Jun 2025 14:26:04 +0400 Subject: [PATCH] [warosu] Simpler/less costly hostname check --- gallery_dl/extractor/warosu.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/warosu.py b/gallery_dl/extractor/warosu.py index 3791de6e..677f8994 100644 --- a/gallery_dl/extractor/warosu.py +++ b/gallery_dl/extractor/warosu.py @@ -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