diff --git a/gallery_dl/extractor/nhentai.py b/gallery_dl/extractor/nhentai.py index 09b2b167..90c5420f 100644 --- a/gallery_dl/extractor/nhentai.py +++ b/gallery_dl/extractor/nhentai.py @@ -61,7 +61,7 @@ class NhentaiGalleryExtractor(GalleryExtractor): def images(self, _): ufmt = ("https://i.nhentai.net/galleries/" + self.data["media_id"] + "/{}.{}") - extdict = {"j": "jpg", "p": "png", "g": "gif"} + extdict = {"j": "jpg", "p": "png", "g": "gif", "w": "webp"} return [ (ufmt.format(num, extdict.get(img["t"], "jpg")), { diff --git a/test/results/nhentai.py b/test/results/nhentai.py index 946acb3a..02667ac4 100644 --- a/test/results/nhentai.py +++ b/test/results/nhentai.py @@ -34,6 +34,19 @@ __tests__ = ( "height" : int, }, +{ + "#url" : "https://nhentai.net/g/538045/", + "#comment" : "webp (#6442)", + "#class" : nhentai.NhentaiGalleryExtractor, + "#range" : "4-7", + "#urls" : ( + "https://i.nhentai.net/galleries/3115523/4.jpg", + "https://i.nhentai.net/galleries/3115523/5.webp", + "https://i.nhentai.net/galleries/3115523/6.webp", + "https://i.nhentai.net/galleries/3115523/7.jpg", + ), +}, + { "#url" : "https://nhentai.net/tag/sole-female/", "#category": ("", "nhentai", "tag"),