replace Jellyfin raw streamUrl with /download endpoint

This commit is contained in:
jeffvli
2025-12-12 00:43:39 -08:00
parent 4b66c86fd6
commit e147a78ee0
@@ -1039,7 +1039,14 @@ export const JellyfinController: InternalControllerEndpoint = {
const { bitrate, format, id, transcode } = query; const { bitrate, format, id, transcode } = query;
const deviceId = ''; const deviceId = '';
let url = let url = `${server?.url}/Items/${id}/Download?api_key=${server?.credential}&playSessionId=${deviceId}`;
if (transcode) {
// Some format appears to be required. Fall back to trusty MP3 if not specified
// Otherwise, ffmpeg appears to crash
const realFormat = format || 'mp3';
url =
`${server?.url}/audio` + `${server?.url}/audio` +
`/${id}/universal` + `/${id}/universal` +
`?userId=${server?.userId}` + `?userId=${server?.userId}` +
@@ -1049,11 +1056,6 @@ export const JellyfinController: InternalControllerEndpoint = {
`&playSessionId=${deviceId}` + `&playSessionId=${deviceId}` +
'&container=opus,mp3,aac,m4a,m4b,flac,wav,ogg'; '&container=opus,mp3,aac,m4a,m4b,flac,wav,ogg';
if (transcode) {
// Some format appears to be required. Fall back to trusty MP3 if not specified
// Otherwise, ffmpeg appears to crash
const realFormat = format || 'mp3';
url += `&transcodingProtocol=http&transcodingContainer=${realFormat}`; url += `&transcodingProtocol=http&transcodingContainer=${realFormat}`;
url = url.replace('audioCodec=aac', `audioCodec=${realFormat}`); url = url.replace('audioCodec=aac', `audioCodec=${realFormat}`);
url = url.replace( url = url.replace(