[hitomi] fix image URLs and URL pattern

- non-webp files are now hosted on [a-c]b.hitomi.la
- removed ampersand from invalid slug characters
This commit is contained in:
Mike Fährmann
2020-10-22 15:15:34 +02:00
parent bac8af69e8
commit ffd38215a4

View File

@@ -21,10 +21,10 @@ class HitomiGalleryExtractor(GalleryExtractor):
root = "https://hitomi.la" root = "https://hitomi.la"
pattern = (r"(?:https?://)?hitomi\.la" pattern = (r"(?:https?://)?hitomi\.la"
r"/(?:manga|doujinshi|cg|gamecg|galleries|reader)" r"/(?:manga|doujinshi|cg|gamecg|galleries|reader)"
r"/(?:[^/?&#]+-)?(\d+)") r"/(?:[^/?#]+-)?(\d+)")
test = ( test = (
("https://hitomi.la/galleries/867789.html", { ("https://hitomi.la/galleries/867789.html", {
"pattern": r"https://[a-c]a.hitomi.la/images/./../[0-9a-f]+.jpg", "pattern": r"https://[a-c]b.hitomi.la/images/./../[0-9a-f]+.jpg",
"keyword": "4873ef9a523621fc857b114e0b2820ba4066e9ae", "keyword": "4873ef9a523621fc857b114e0b2820ba4066e9ae",
"count": 16, "count": 16,
}), }),
@@ -35,12 +35,12 @@ class HitomiGalleryExtractor(GalleryExtractor):
}), }),
# Game CG with scenes (#321) # Game CG with scenes (#321)
("https://hitomi.la/galleries/733697.html", { ("https://hitomi.la/galleries/733697.html", {
"url": "b4cbc76032852db4a655bf6a2c4d58eae8153c8e", "url": "ec3fe9b708ee376ec579b90d053ad485c0777552",
"count": 210, "count": 210,
}), }),
# fallback for galleries only available through /reader/ URLs # fallback for galleries only available through /reader/ URLs
("https://hitomi.la/galleries/1045954.html", { ("https://hitomi.la/galleries/1045954.html", {
"url": "f3aa914ad148437f72d307268fa0d250eabe8dab", "url": "bf4ed4e726204da5bc37a236ca476a2a96081388",
"count": 1413, "count": 1413,
}), }),
# gallery with "broken" redirect # gallery with "broken" redirect
@@ -143,7 +143,7 @@ class HitomiGalleryExtractor(GalleryExtractor):
frontends = 2 if inum < 0x30 else 3 frontends = 2 if inum < 0x30 else 3
inum = 1 if inum < 0x09 else inum inum = 1 if inum < 0x09 else inum
url = "https://{}a.hitomi.la/images/{}/{}/{}.{}".format( url = "https://{}b.hitomi.la/images/{}/{}/{}.{}".format(
chr(97 + (inum % frontends)), chr(97 + (inum % frontends)),
ihash[-1], ihash[-3:-1], ihash, ihash[-1], ihash[-3:-1], ihash,
idata["extension"], idata["extension"],