diff --git a/lib/routes/dw/news.ts b/lib/routes/dw/news.ts index e9391b0d7..aea7130d6 100644 --- a/lib/routes/dw/news.ts +++ b/lib/routes/dw/news.ts @@ -67,9 +67,7 @@ async function handler(ctx) { const feed = response.data.data.content; cache.set('dw:navigation', feed.topStoriesNavigations, config.cache.routeExpire); - const list = feed.contentComposition.informationSpaces - .flatMap((section) => Object.values(section).flatMap((component) => component[0]?.contents || [])) - .filter((item) => typenames.has(item.__typename) && item.id); + const list = feed.contentComposition.informationSpaces.flatMap((section) => Object.values(section).flatMap((component) => component[0]?.contents || [])).filter((item) => typenames.has(item.__typename) && item.id); const items = await processItems( list.map((item) => { item.link = new URL(item.namedUrl, 'https://www.dw.com').href; diff --git a/lib/routes/dw/utils.ts b/lib/routes/dw/utils.ts index 47637ef1e..87514c626 100644 --- a/lib/routes/dw/utils.ts +++ b/lib/routes/dw/utils.ts @@ -82,7 +82,8 @@ const i18n = (word: string, lang: string) => { } }; -const m3u8tomp4 = (src: string) => src.replace('https://hlsvod.dw.com/i/', 'https://tvdownloaddw-a.akamaihd.net/').replace(',AVC_480x270,AVC_512x288,AVC_640x360,AVC_960x540,AVC_1280x720,AVC_1920x1080,.mp4.csmil/master.m3u8', 'AVC_1920x1080.mp4'); +const m3u8tomp4 = (src: string) => + src.replace('https://hlsvod.dw.com/i/', 'https://tvdownloaddw-a.akamaihd.net/').replace(',AVC_480x270,AVC_512x288,AVC_640x360,AVC_960x540,AVC_1280x720,AVC_1920x1080,.mp4.csmil/master.m3u8', 'AVC_1920x1080.mp4'); const processHtml = ($: CheerioAPI, contentLinks) => { $('img').each((_, elem) => {