Skip to content

Commit

Permalink
style: auto format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 15, 2024
1 parent 7ce029a commit af7e399
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions lib/routes/dw/news.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion lib/routes/dw/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit af7e399

Please sign in to comment.