From eb5e4c609be1b93dd574c5ef60ac1b874f6a6f5b Mon Sep 17 00:00:00 2001 From: User <36217117+123hi123@users.noreply.github.com> Date: Wed, 9 Apr 2025 20:41:28 +0800 Subject: [PATCH] fix: A bug fix ,fix nhentai image link error (#18805) * fix nhentai image link error * bring yml back * fix: add an empty line at the end --------- Co-authored-by: Joe --- lib/routes/nhentai/util.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/routes/nhentai/util.ts b/lib/routes/nhentai/util.ts index 5cdd34783..e59245404 100644 --- a/lib/routes/nhentai/util.ts +++ b/lib/routes/nhentai/util.ts @@ -133,7 +133,9 @@ const getDetail = async (simple) => { .toArray() .map((ele) => new URL($(ele).attr('data-src'), baseUrl).href) .map((src) => src.replace(/(.+)(\d+)t\.(.+)/, (_, p1, p2, p3) => `${p1}${p2}.${p3}`)) // thumb to high-quality - .map((src) => src.replace(/t(\d+)\.nhentai\.net/, 'i$1.nhentai.net')); + .map((src) => src.replace(/t(\d+)\.nhentai\.net/, 'i$1.nhentai.net')) + .map((src) => src.replace(/\.(jpg|png|gif)\.webp$/, '.$1')) // 移除重複的.webp後綴 + .map((src) => src.replace(/\.webp\.webp$/, '.webp')); // 處理.webp.webp的情況 return { ...simple,