fix: 漫小肆 host 变更 (#5973)
Co-authored-by: junfeng <junfeng_pan96@qq.com>
This commit is contained in:
parent
6083f0f250
commit
0d2cc88e2c
|
|
@ -2293,7 +2293,7 @@
|
|||
},
|
||||
],
|
||||
},
|
||||
'pknbc.com': {
|
||||
'jjmhw.cc': {
|
||||
_name: '漫小肆',
|
||||
www: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue