aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/hitomi.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/hitomi.py')
-rw-r--r--gallery_dl/extractor/hitomi.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/gallery_dl/extractor/hitomi.py b/gallery_dl/extractor/hitomi.py
index f8b0c3b..cc110aa 100644
--- a/gallery_dl/extractor/hitomi.py
+++ b/gallery_dl/extractor/hitomi.py
@@ -115,12 +115,16 @@ class HitomiGalleryExtractor(GalleryExtractor):
fmt = self.config("format") or "webp"
if fmt == "original":
- subdomain, fmt, ext = "b", "images", None
+ subdomain, fmt, ext, check = "b", "images", None, False
else:
- subdomain, ext = "a", fmt
+ subdomain, ext, check = "a", fmt, True
result = []
for image in self.info["files"]:
+ if check:
+ if not image.get("has" + fmt):
+ fmt = ext = "webp"
+ check = False
ihash = image["hash"]
idata = text.nameext_from_url(image["name"])
if ext: