From cfbc0db5d4da80719d3ec6f38852a690739cf87f Mon Sep 17 00:00:00 2001 From: nyne Date: Wed, 6 Nov 2024 22:14:08 +0800 Subject: [PATCH] fix link --- ehentai.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ehentai.js b/ehentai.js index de0fce9..78564d6 100644 --- a/ehentai.js +++ b/ehentai.js @@ -1058,9 +1058,10 @@ class Ehentai extends ComicSource { if(url.includes('?')) { url = url.split('?')[0] } - let uri = new URL(url) - if(uri.pathname.startsWith('/g/')) { - return url + let reg = RegExp("https?://(e-|ex)hentai.org/g/(\\d+)/(\\w+)/") + let match = reg.exec(url) + if(match) { + return `https://e-hentai.org/g/${match[2]}/${match[3]}/` } return null }