diff options
| author | 2022-12-04 23:25:06 -0500 | |
|---|---|---|
| committer | 2022-12-04 23:25:06 -0500 | |
| commit | 3338dfce719c999467ffe08fd45663be8190057a (patch) | |
| tree | fd3235a1379c19508bbb47b8e8b95d5d9164b0d3 /gallery_dl/extractor/hitomi.py | |
| parent | 7af5cc29d1c02d20a6890b7b7ba78ab41532a763 (diff) | |
New upstream version 1.24.1.upstream/1.24.1
Diffstat (limited to 'gallery_dl/extractor/hitomi.py')
| -rw-r--r-- | gallery_dl/extractor/hitomi.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gallery_dl/extractor/hitomi.py b/gallery_dl/extractor/hitomi.py index cc110aa..44459ce 100644 --- a/gallery_dl/extractor/hitomi.py +++ b/gallery_dl/extractor/hitomi.py @@ -115,16 +115,17 @@ class HitomiGalleryExtractor(GalleryExtractor): fmt = self.config("format") or "webp" if fmt == "original": - subdomain, fmt, ext, check = "b", "images", None, False + subdomain, path, ext, check = "b", "images", None, False else: - subdomain, ext, check = "a", fmt, True + subdomain, path, ext, check = "a", fmt, fmt, (fmt != "webp") result = [] for image in self.info["files"]: if check: - if not image.get("has" + fmt): - fmt = ext = "webp" - check = False + if image.get("has" + fmt): + path = ext = fmt + else: + path = ext = "webp" ihash = image["hash"] idata = text.nameext_from_url(image["name"]) if ext: @@ -134,7 +135,7 @@ class HitomiGalleryExtractor(GalleryExtractor): inum = int(ihash[-1] + ihash[-3:-1], 16) url = "https://{}{}.hitomi.la/{}/{}/{}/{}.{}".format( chr(97 + gg_m.get(inum, gg_default)), - subdomain, fmt, gg_b, inum, ihash, idata["extension"], + subdomain, path, gg_b, inum, ihash, idata["extension"], ) result.append((url, idata)) return result |
