fix: 漫小肆 host 变更 (#5652)
* feat: add router 漫小肆 1. add route 2. add docs 3. add radar * fix: manxiaosi host change * fix: remove dup doc * fix: remove dup doc extra space Co-authored-by: junfeng <junfeng_pan96@qq.com>
This commit is contained in:
commit
3da5e8e1b4
|
|
@ -2257,9 +2257,9 @@
|
|||
},
|
||||
],
|
||||
},
|
||||
'manxiaosi.com': {
|
||||
'pknbc.com': {
|
||||
_name: '漫小肆',
|
||||
'.': [
|
||||
www: [
|
||||
{
|
||||
title: '漫画更新',
|
||||
docs: 'https://docs.rsshub.app/anime.html#man-xiao-si',
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const host = 'http://www.manxiaosi.com';
|
||||
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';
|
||||
const host = 'http://www.pknbc.com';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const id = ctx.params.id;
|
||||
|
|
@ -19,15 +18,17 @@ module.exports = async (ctx) => {
|
|||
link: itemLink,
|
||||
};
|
||||
const details = await ctx.cache.tryGet(itemLink, async () => {
|
||||
// 具体页面限制手机UA
|
||||
const response = await got.get(itemLink, {
|
||||
headers: {
|
||||
'user-agent': ua,
|
||||
},
|
||||
});
|
||||
const response = await got.get(itemLink);
|
||||
const $ = cheerio.load(response.body);
|
||||
const imgs = $('div.comicpage img');
|
||||
let pics = '';
|
||||
imgs.each((_, ele) => {
|
||||
const $ele = $(ele);
|
||||
const src = $ele.attr('data-original');
|
||||
pics += `<img src="${src}" referrerpolicy="no-referrer">`;
|
||||
});
|
||||
return {
|
||||
description: $('div#cp_img').html(),
|
||||
description: `<div>${pics}</div>`,
|
||||
};
|
||||
});
|
||||
return Promise.resolve(Object.assign({}, simple, details));
|
||||
|
|
|
|||
Loading…
Reference in New Issue