fix: gouhuo (#4148)
This commit is contained in:
@@ -31,12 +31,12 @@ module.exports = async (ctx) => {
|
||||
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: `https://gouhuo.qq.com/content/getHomeMainContent?tabId=${tabId}`,
|
||||
url: `https://gouhuo.qq.com/content/getContentByTab?tabId=${tabId}`,
|
||||
headers: {
|
||||
Referer: `https://gouhuo.qq.com/`,
|
||||
},
|
||||
});
|
||||
const list = response.data.data;
|
||||
const list = response.data.data.list;
|
||||
|
||||
const staffs = await cache.getStaffs(ctx, tabId);
|
||||
const title = staffs[0];
|
||||
|
||||
@@ -16,13 +16,13 @@ module.exports = async (ctx) => {
|
||||
|
||||
// eslint-disable-next-line no-eval
|
||||
const obj = eval(body.match(/(?<=<script>\s*window\.__NUXT__=)[\s\S]*?(?=<\/script>)/g)[0]);
|
||||
const items = obj.data[0].new_topic_list.map((item) => {
|
||||
const img_url = item.media_list && item.media_list[0].img_url;
|
||||
const items = obj.data[0].newGuides.map((item) => {
|
||||
const img_url = item.img_url;
|
||||
const single = {
|
||||
title: item.title,
|
||||
description: `${item.summary}<br><img src="${img_url}">`,
|
||||
pubDate: new Date(item.edit_time * 1000).toUTCString(),
|
||||
link: `${url}/detail/${item.topic_id}`,
|
||||
description: `${item.title}<br><img src="${img_url}">`,
|
||||
pubDate: new Date(item.publish_ts * 1000).toUTCString(),
|
||||
link: `${url}${item.link}`,
|
||||
};
|
||||
return single;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user