diff --git a/lib/v2/2048/index.js b/lib/v2/2048/index.js index 186f7ab4abc27c..7587a8c5047c38 100644 --- a/lib/v2/2048/index.js +++ b/lib/v2/2048/index.js @@ -11,7 +11,11 @@ module.exports = async (ctx) => { const rootUrl = 'https://hjd2048.com'; const entranceDomain = await ctx.cache.tryGet('2048:entranceDomain', async () => { - const { data: response } = await got('https://hjd.tw'); + const { data: response } = await got('https://hjd.tw', { + headers: { + accept: '*/*', + }, + }); const $ = cheerio.load(response); return $('ul li a') .toArray() @@ -43,7 +47,9 @@ module.exports = async (ctx) => { link: `${currentHost}/2048/${item.attr('href')}`, guid: `${rootUrl}/2048/${item.attr('href')}`, }; - }); + }) + .filter((item) => !item.link.includes('undefined')); + const items = await Promise.all( list.map((item) => ctx.cache.tryGet(item.guid, async () => {