Skip to content

Commit

Permalink
[nhentai] support ',webp' files (#6442)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Nov 8, 2024
1 parent 9e72968 commit 1ddbcda
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gallery_dl/extractor/nhentai.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def metadata(self, page):
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")), {
Expand Down
13 changes: 13 additions & 0 deletions test/results/nhentai.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@
"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"),
Expand Down

0 comments on commit 1ddbcda

Please sign in to comment.