Skip to content

Commit

Permalink
Use content_url
Browse files Browse the repository at this point in the history
Returning web url we can download video using yt-dlp which prefers it to direct CDN urls that are heavier to compute since we've to try every url to check for MP4 files (that exist no more)
  • Loading branch information
maxcanna committed Mar 2, 2024
1 parent ff085cd commit 7a247f0
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions raiapi.js
Original file line number Diff line number Diff line change
@@ -158,13 +158,11 @@ class RaiApi {
return [];
}
return Promise.all(programmi
.filter(({ video: { content_url: url } = {} }) => url)
.map(({ name, time_published: orario, video: { content_url: url } }) => getEffectiveUrl(url)
.then(effectiveUrl => ({
name,
orario,
url: effectiveUrl,
}))
.map(({ name, time_published: orario, weblink: url }) => ({
name,
orario,
url: `${baseURL}${url}`,
})
))
})
}

0 comments on commit 7a247f0

Please sign in to comment.