fix: gouhuo (#4148)

This commit is contained in:
Kode
2020-03-03 00:16:36 +08:00
committed by GitHub
parent 04fa4d1852
commit bfa4c9794b
2 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -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];
+5 -5
View File
@@ -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;
});