mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix: 修复懂球帝部分路由图片加载的bug
This commit is contained in:
+19
-25
@@ -84,39 +84,33 @@ const ProcessFeed = async (ctx, link, type) => {
|
||||
} else if (type === 'player') {
|
||||
name = data.playerDetail.base_info.person_name;
|
||||
}
|
||||
const proList = [];
|
||||
|
||||
const out = await Promise.all(
|
||||
list.map((item) => {
|
||||
const url = item.share.replace('www', 'm').replace('articles', 'article');
|
||||
return ctx.cache.tryGet(url, async () => {
|
||||
const res = await got_ins.get(url);
|
||||
const title = item.title;
|
||||
const link = `https://www.dongqiudi.com/news/${item.id}.html`;
|
||||
|
||||
const $ = cheerio.load(res.data);
|
||||
return ctx.cache.tryGet(link, () =>
|
||||
ctx.cache.tryGet(link, () => {
|
||||
const single = {
|
||||
title,
|
||||
link,
|
||||
};
|
||||
|
||||
const author = $('body > header a').text();
|
||||
|
||||
const content = $('article');
|
||||
|
||||
ProcessVideo($);
|
||||
|
||||
ProcessImg($('.data-gif-src'));
|
||||
ProcessImg($('img'));
|
||||
|
||||
ProcessHref(content.find('a'));
|
||||
|
||||
const single = {
|
||||
title: item.title,
|
||||
guid: item.id,
|
||||
link: `https://www.dongqiudi.com/news/${item.id}.html`,
|
||||
description: content.html(),
|
||||
pubDate: parseDate(item.show_time * 1000),
|
||||
author,
|
||||
};
|
||||
return single;
|
||||
});
|
||||
const es = got(link);
|
||||
proList.push(es);
|
||||
return single;
|
||||
})
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
const responses = await got.all(proList);
|
||||
for (let i = 0; i < proList.length; i++) {
|
||||
ProcessFeedType2(out[i], responses[i].data);
|
||||
}
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${name} - 相关新闻`,
|
||||
link,
|
||||
|
||||
Reference in New Issue
Block a user