mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-13 08:39:38 +08:00
feat: add zaker channel (#2550)
* feat: add zaker channel * feat: add zaker channel * feat: add zaker channel
This commit is contained in:
@@ -3,8 +3,9 @@ const cheerio = require('cheerio');
|
||||
const date_util = require('@/utils/date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const type = ctx.params.type || 'source';
|
||||
const id = ctx.params.id;
|
||||
const link = `http://www.myzaker.com/source/${id}`;
|
||||
const link = `http://www.myzaker.com/${type}/${id}`;
|
||||
|
||||
const response = await got.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
@@ -40,10 +41,13 @@ module.exports = async (ctx) => {
|
||||
method: 'get',
|
||||
headers: {
|
||||
Referer: link,
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0',
|
||||
},
|
||||
});
|
||||
const $ = cheerio.load(response.data);
|
||||
$('img').each((index, elem) => {
|
||||
const $elem = $(elem);
|
||||
$elem.attr('referrerpolicy', 'no-referrer');
|
||||
});
|
||||
const description = $('div.article_content div')
|
||||
.html()
|
||||
.replace(/data-original/g, `src`);
|
||||
|
||||
Reference in New Issue
Block a user