eh&nh: fix url open (#142)

This commit is contained in:
Pacalini
2025-08-24 18:09:05 +08:00
committed by GitHub
parent 8a26cff469
commit ca2f626483
3 changed files with 6 additions and 6 deletions

View File

@@ -7,7 +7,7 @@ class Ehentai extends ComicSource {
// unique id of the source // unique id of the source
key = "ehentai" key = "ehentai"
version = "1.1.3" version = "1.1.4"
minAppVersion = "1.0.0" minAppVersion = "1.0.0"
@@ -1182,7 +1182,7 @@ class Ehentai extends ComicSource {
if(url.includes('?')) { if(url.includes('?')) {
url = url.split('?')[0] url = url.split('?')[0]
} }
let reg = RegExp("https?://(e-|ex)hentai.org/g/(\\d+)/(\\w+)/") let reg = RegExp("https?://(e-|ex)hentai.org/g/(\\d+)/(\\w+)/?$")
let match = reg.exec(url) let match = reg.exec(url)
if(match) { if(match) {
return `${this.baseUrl}/g/${match[2]}/${match[3]}/` return `${this.baseUrl}/g/${match[2]}/${match[3]}/`

View File

@@ -27,7 +27,7 @@
"name": "nhentai", "name": "nhentai",
"fileName": "nhentai.js", "fileName": "nhentai.js",
"key": "nhentai", "key": "nhentai",
"version": "1.0.5" "version": "1.0.6"
}, },
{ {
"name": "紳士漫畫", "name": "紳士漫畫",
@@ -40,7 +40,7 @@
"name": "ehentai", "name": "ehentai",
"fileName": "ehentai.js", "fileName": "ehentai.js",
"key": "ehentai", "key": "ehentai",
"version": "1.1.3" "version": "1.1.4"
}, },
{ {
"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.5" version = "1.0.6"
minAppVersion = "1.0.0" minAppVersion = "1.0.0"
@@ -523,7 +523,7 @@ class Nhentai extends ComicSource {
'nhentai.net', 'nhentai.net',
], ],
linkToId: (url) => { linkToId: (url) => {
let regex = /\/g\/(\d+)\//g let regex = /\/g\/(\d+)\/?$/g
let match = regex.exec(url) let match = regex.exec(url)
if(match) { if(match) {
return match[1] return match[1]