diff --git a/lib/v2/dongqiudi/utils.js b/lib/v2/dongqiudi/utils.js index a70e7704e1..52f12c4a48 100644 --- a/lib/v2/dongqiudi/utils.js +++ b/lib/v2/dongqiudi/utils.js @@ -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,