Include show name in episode download error
This commit is contained in:
parent
500f1532b5
commit
0b3d33878c
|
|
@ -28,10 +28,11 @@ interface Manifest {
|
||||||
async function withDownloadLink(episode: OriginalEpisode): Promise<Episode> {
|
async function withDownloadLink(episode: OriginalEpisode): Promise<Episode> {
|
||||||
// getting stream link
|
// getting stream link
|
||||||
const [playbackStatus, playbackResponse] = await get<Manifest>(`https://psapi.nrk.no/playback/manifest/podcast/${episode.episodeId}`)
|
const [playbackStatus, playbackResponse] = await get<Manifest>(`https://psapi.nrk.no/playback/manifest/podcast/${episode.episodeId}`)
|
||||||
|
|
||||||
if (playbackStatus === OK && playbackResponse) {
|
if (playbackStatus === OK && playbackResponse) {
|
||||||
return { ...episode, url: playbackResponse.playable.assets[0].url };
|
return { ...episode, url: playbackResponse.playable.assets[0].url };
|
||||||
} else {
|
} else {
|
||||||
throw `Error getting downloadLink for ${episode.episodeId}`
|
throw `Error getting downloadLink for ${episode.episodeId}, serie: ${episode.originalTitle}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,3 +70,5 @@ export const nrkRadio = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue