diff --git a/lib/routes/nhentai/util.js b/lib/routes/nhentai/util.js index 83d3e4b4f..dba2af215 100644 --- a/lib/routes/nhentai/util.js +++ b/lib/routes/nhentai/util.js @@ -91,7 +91,7 @@ const parseSimpleDetail = ($ele) => { const link = resolve('https://nhentai.net', $ele.attr('href')); const thumb = $ele.children('img'); const thumbSrc = thumb.attr('data-src') || thumb.attr('src'); - const highResoThumbSrc = thumbSrc.replace('thumb', '1').replace('t.nhentai.net', 'i.nhentai.net'); + const highResoThumbSrc = thumbSrc.replace('thumb', '1').replace(/t\d+\.nhentai\.net/, 'i.nhentai.net'); return { title: $ele.children('.caption').text(), link, @@ -121,7 +121,7 @@ const getDetail = async (simple) => { .map((_, ele) => resolve('https://nhentai.net', $(ele).attr('data-src'))) .get() .map((src) => src.replace(/(.+)(\d+)t\.(.+)/, (_, p1, p2, p3) => `${p1}${p2}.${p3}`)) // thumb to high-quality - .map((src) => src.replace('t.nhentai.net', 'i.nhentai.net')); + .map((src) => src.replace(/t\d+\.nhentai\.net/, 'i.nhentai.net')); const renderImg = (src) => `
`; return {