diff --git a/lib/routes/bilibili/weekly-recommend.ts b/lib/routes/bilibili/weekly-recommend.ts index ad30fca8cf..104fd9079f 100644 --- a/lib/routes/bilibili/weekly-recommend.ts +++ b/lib/routes/bilibili/weekly-recommend.ts @@ -51,23 +51,25 @@ async function handler(ctx) { title: 'B站每周必看', link: 'https://www.bilibili.com/h5/weekly-recommend', description: 'B站每周必看', - item: data.map(async (item) => { - const subtitles = isJsonFeed && !config.bilibili.excludeSubtitles && item.bvid ? await cache.getVideoSubtitleAttachment(item.bvid) : []; - return { - title: item.title, - description: utils.renderUGCDescription(embed, item.cover, `${weekly_name} ${item.title} - ${item.rcmd_reason}`, item.param, undefined, item.bvid), - link: weekly_number > 60 && item.bvid ? `https://www.bilibili.com/video/${item.bvid}` : `https://www.bilibili.com/video/av${item.param}`, - attachments: item.bvid - ? [ - { - url: getVideoUrl(item.bvid), - mime_type: 'text/html', - duration_in_seconds: parseDuration(item.cover_right_text_1), - }, - ...subtitles, - ] - : undefined, - }; - }), + item: await Promise.all( + data.map(async (item) => { + const subtitles = isJsonFeed && !config.bilibili.excludeSubtitles && item.bvid ? await cache.getVideoSubtitleAttachment(item.bvid) : []; + return { + title: item.title, + description: utils.renderUGCDescription(embed, item.cover, `${weekly_name} ${item.title} - ${item.rcmd_reason}`, item.param, undefined, item.bvid), + link: weekly_number > 60 && item.bvid ? `https://www.bilibili.com/video/${item.bvid}` : `https://www.bilibili.com/video/av${item.param}`, + attachments: item.bvid + ? [ + { + url: getVideoUrl(item.bvid), + mime_type: 'text/html', + duration_in_seconds: parseDuration(item.cover_right_text_1), + }, + ...subtitles, + ] + : undefined, + }; + }) + ), }; }