diff --git a/assets/radar-rules.js b/assets/radar-rules.js index 95ee4c7fe..ced4d2191 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -2293,7 +2293,7 @@ }, ], }, - 'pknbc.com': { + 'jjmhw.cc': { _name: '漫小肆', www: [ { diff --git a/lib/routes/manxiaosi/book.js b/lib/routes/manxiaosi/book.js index bdb1f7433..f7fe949b4 100644 --- a/lib/routes/manxiaosi/book.js +++ b/lib/routes/manxiaosi/book.js @@ -1,6 +1,7 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); -const host = 'http://www.pknbc.com'; +const host = 'http://www.jjmhw.cc'; +const ua = 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Mobile Safari/537.36'; module.exports = async (ctx) => { const id = ctx.params.id; @@ -18,9 +19,14 @@ module.exports = async (ctx) => { link: itemLink, }; const details = await ctx.cache.tryGet(itemLink, async () => { - const response = await got.get(itemLink); + // 具体页面限制手机UA + const response = await got.get(itemLink, { + headers: { + 'user-agent': ua, + }, + }); const $ = cheerio.load(response.body); - const imgs = $('div.comicpage img'); + const imgs = $('div#cp_img img'); let pics = ''; imgs.each((_, ele) => { const $ele = $(ele);