diff --git a/lib/v2/bangumi/tv/group/topic.js b/lib/v2/bangumi/tv/group/topic.js index f99093989..1ec21d6b7 100644 --- a/lib/v2/bangumi/tv/group/topic.js +++ b/lib/v2/bangumi/tv/group/topic.js @@ -10,24 +10,26 @@ module.exports = async (ctx) => { const $ = cheerio.load(html); const title = 'Bangumi - ' + $('.SecondaryNavTitle').text(); - const items = await Promise.all($('.topic_list .topic') - .toArray() - .map(async (elem) => { - const link = new URL($('.subject a', elem).attr('href'), base_url).href; - const fullText = await ctx.cache.tryGet(link, async () => { - const { data: html } = await got(link); - const $ = cheerio.load(html); - return $('.postTopic .topic_content').html(); - }); - const summary = 'Reply: ' + $('.posts', elem).text(); - return { - link, - title: $('.subject a', elem).attr('title'), - pubDate: parseDate($('.lastpost .time', elem).text()), - description: fullText ? summary + '

' + fullText : summary, - author: $('.author a', elem).text(), - }; - })); + const items = await Promise.all( + $('.topic_list .topic') + .toArray() + .map(async (elem) => { + const link = new URL($('.subject a', elem).attr('href'), base_url).href; + const fullText = await ctx.cache.tryGet(link, async () => { + const { data: html } = await got(link); + const $ = cheerio.load(html); + return $('.postTopic .topic_content').html(); + }); + const summary = 'Reply: ' + $('.posts', elem).text(); + return { + link, + title: $('.subject a', elem).attr('title'), + pubDate: parseDate($('.lastpost .time', elem).text()), + description: fullText ? summary + '

' + fullText : summary, + author: $('.author a', elem).text(), + }; + }) + ); ctx.state.data = { title,