fix nhentai

This commit is contained in:
2024-11-09 17:30:10 +08:00
parent d17d4954b3
commit 3c76970317
2 changed files with 15 additions and 4 deletions

View File

@@ -33,7 +33,7 @@
"name": "nhentai", "name": "nhentai",
"fileName": "nhentai.js", "fileName": "nhentai.js",
"key": "nhentai", "key": "nhentai",
"version": "1.0.0" "version": "1.0.1"
}, },
{ {
"name": "紳士漫畫", "name": "紳士漫畫",

View File

@@ -7,7 +7,7 @@ class Nhentai extends ComicSource {
// unique id of the source // unique id of the source
key = "nhentai" key = "nhentai"
version = "1.0.0" version = "1.0.1"
minAppVersion = "1.0.0" minAppVersion = "1.0.0"
@@ -385,8 +385,19 @@ class Nhentai extends ComicSource {
let mediaId = data.media_id let mediaId = data.media_id
let images = [] let images = []
for (let image of data.images.pages) { for (let image of data.images.pages) {
let ext = image.t === "j" ? "jpg" : (image.t === "p" ? "png" : "gif") let ext = 'jpg'
images.push(`https://i7.nhentai.net/galleries/${mediaId}/${images.length + 1}.${ext}`) switch(image.t) {
case 'p':
ext = 'png'
break
case 'g':
ext = 'gif'
break
case 'w':
ext = 'webp'
break
}
images.push(`https://i3.nhentai.net/galleries/${mediaId}/${images.length + 1}.${ext}`)
} }
return { return {
images: images, images: images,