mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix(route): hitwh (#14519)
This commit is contained in:
+10
-2
@@ -6,7 +6,11 @@ const timezone = require('@/utils/timezone');
|
||||
const baseUrl = 'https://today.hitwh.edu.cn';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got(`${baseUrl}/1024/list.htm`);
|
||||
const response = await got(`${baseUrl}/1024/list.htm`, {
|
||||
https: {
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
});
|
||||
const $ = cheerio.load(response.data);
|
||||
const type = (filename) => filename.split('.').pop();
|
||||
const links = $('.list_list_wrap #wp_news_w10002 ul > li')
|
||||
@@ -25,7 +29,11 @@ module.exports = async (ctx) => {
|
||||
ctx.cache.tryGet(item.link, async () => {
|
||||
if (type(item.link) === 'htm') {
|
||||
try {
|
||||
const { data } = await got(item.link);
|
||||
const { data } = await got(item.link, {
|
||||
https: {
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
});
|
||||
const $ = cheerio.load(data);
|
||||
item.description = $('div.wp_articlecontent').html() && $('div.wp_articlecontent').html().replaceAll('src="/', `src="${baseUrl}/`).replaceAll('href="/', `href="${baseUrl}/`).trim();
|
||||
return item;
|
||||
|
||||
Reference in New Issue
Block a user