diff --git a/gallery_dl/extractor/warosu.py b/gallery_dl/extractor/warosu.py index 3bb635d6..11f0c18f 100644 --- a/gallery_dl/extractor/warosu.py +++ b/gallery_dl/extractor/warosu.py @@ -64,8 +64,7 @@ class WarosuThreadExtractor(Extractor): def parse(self, post): """Build post object by extracting data from an HTML post""" data = self._extract_post(post) - if " File:" in post: - self._extract_image(post, data) + if " File:" in post and self._extract_image(post, data): part = data["image"].rpartition("/")[2] data["tim"], _, data["extension"] = part.partition(".") data["ext"] = "." + data["extension"] @@ -91,6 +90,11 @@ class WarosuThreadExtractor(Extractor): "", "<").rstrip().rpartition(".")[0]) extr("
", "") - data["image"] = url = extr("") - if url[0] == "/": - data["image"] = self.root + url + url = extr("") + if url: + if url[0] == "/": + data["image"] = self.root + url + else: + data["image"] = url + return True + return False diff --git a/test/results/warosu.py b/test/results/warosu.py index efc7f832..fd095183 100644 --- a/test/results/warosu.py +++ b/test/results/warosu.py @@ -54,6 +54,18 @@ __tests__ = ( "w" : 450, }, +{ + "#url" : "https://warosu.org/jp/thread/45886210", + "#comment" : "deleted post (#5289)", + "#category": ("", "warosu", "thread"), + "#class" : warosu.WarosuThreadExtractor, + "#count" : "> 150", + + "board" : "jp", + "board_name": "Otaku Culture", + "title" : "/07/th Expansion Thread", +}, + { "#url" : "https://warosu.org/ic/thread/4604652", "#category": ("", "warosu", "thread"),