mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
replace Jellyfin raw streamUrl with /download endpoint
This commit is contained in:
@@ -1039,21 +1039,23 @@ 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}`;
|
||||||
`${server?.url}/audio` +
|
|
||||||
`/${id}/universal` +
|
|
||||||
`?userId=${server?.userId}` +
|
|
||||||
`&deviceId=${deviceId}` +
|
|
||||||
'&audioCodec=aac' +
|
|
||||||
`&apiKey=${server?.credential}` +
|
|
||||||
`&playSessionId=${deviceId}` +
|
|
||||||
'&container=opus,mp3,aac,m4a,m4b,flac,wav,ogg';
|
|
||||||
|
|
||||||
if (transcode) {
|
if (transcode) {
|
||||||
// Some format appears to be required. Fall back to trusty MP3 if not specified
|
// Some format appears to be required. Fall back to trusty MP3 if not specified
|
||||||
// Otherwise, ffmpeg appears to crash
|
// Otherwise, ffmpeg appears to crash
|
||||||
const realFormat = format || 'mp3';
|
const realFormat = format || 'mp3';
|
||||||
|
|
||||||
|
url =
|
||||||
|
`${server?.url}/audio` +
|
||||||
|
`/${id}/universal` +
|
||||||
|
`?userId=${server?.userId}` +
|
||||||
|
`&deviceId=${deviceId}` +
|
||||||
|
'&audioCodec=aac' +
|
||||||
|
`&apiKey=${server?.credential}` +
|
||||||
|
`&playSessionId=${deviceId}` +
|
||||||
|
'&container=opus,mp3,aac,m4a,m4b,flac,wav,ogg';
|
||||||
|
|
||||||
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(
|
||||||
|
|||||||
Reference in New Issue
Block a user