From 3c76970317ae60b84a68249b8340f921613bc1d3 Mon Sep 17 00:00:00 2001 From: nyne Date: Sat, 9 Nov 2024 17:30:10 +0800 Subject: [PATCH] fix nhentai --- index.json | 2 +- nhentai.js | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/index.json b/index.json index 4474c3f..3faad95 100644 --- a/index.json +++ b/index.json @@ -33,7 +33,7 @@ "name": "nhentai", "fileName": "nhentai.js", "key": "nhentai", - "version": "1.0.0" + "version": "1.0.1" }, { "name": "紳士漫畫", diff --git a/nhentai.js b/nhentai.js index 7b6c56e..79be0f3 100644 --- a/nhentai.js +++ b/nhentai.js @@ -7,7 +7,7 @@ class Nhentai extends ComicSource { // unique id of the source key = "nhentai" - version = "1.0.0" + version = "1.0.1" minAppVersion = "1.0.0" @@ -385,8 +385,19 @@ class Nhentai extends ComicSource { let mediaId = data.media_id let images = [] for (let image of data.images.pages) { - let ext = image.t === "j" ? "jpg" : (image.t === "p" ? "png" : "gif") - images.push(`https://i7.nhentai.net/galleries/${mediaId}/${images.length + 1}.${ext}`) + let ext = 'jpg' + 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 { images: images,