fix(route): nhentai Images host (#9257)

fix(route): nhentai Images host
This commit is contained in:
Black_Yuzia 2022-03-07 09:51:55 +02:00 committed by GitHub
parent 2c2bf4ed09
commit ed5ceb6f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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) => `<img src="${src}" /><br />`;
return {