From 1ddbcda58b4002d771e01d84404f18648bece6c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 8 Nov 2024 17:41:16 +0100 Subject: [PATCH] [nhentai] support ',webp' files (#6442) --- gallery_dl/extractor/nhentai.py | 2 +- test/results/nhentai.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) 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"),