mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Merge pull request #11857 from gnattu/fix-ffprobe-useragent
Fix ffprobe -user_agent parameter
This commit is contained in:
commit
d0336cd67e
@ -456,9 +456,9 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
extraArgs += " -probesize " + ffmpegProbeSize;
|
extraArgs += " -probesize " + ffmpegProbeSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request.MediaSource.RequiredHttpHeaders.TryGetValue("user_agent", out var userAgent))
|
if (request.MediaSource.RequiredHttpHeaders.TryGetValue("User-Agent", out var userAgent))
|
||||||
{
|
{
|
||||||
extraArgs += " -user_agent " + userAgent;
|
extraArgs += $" -user_agent \"{userAgent}\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request.MediaSource.Protocol == MediaProtocol.Rtsp)
|
if (request.MediaSource.Protocol == MediaProtocol.Rtsp)
|
||||||
|
@ -35,7 +35,7 @@ namespace Jellyfin.MediaEncoding.Tests.Probing
|
|||||||
Protocol = MediaProtocol.Http,
|
Protocol = MediaProtocol.Http,
|
||||||
RequiredHttpHeaders = new Dictionary<string, string>()
|
RequiredHttpHeaders = new Dictionary<string, string>()
|
||||||
{
|
{
|
||||||
{ "user_agent", userAgent },
|
{ "User-Agent", userAgent },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ExtractChapters = false,
|
ExtractChapters = false,
|
||||||
@ -44,7 +44,7 @@ namespace Jellyfin.MediaEncoding.Tests.Probing
|
|||||||
|
|
||||||
var extraArg = encoder.GetExtraArguments(req);
|
var extraArg = encoder.GetExtraArguments(req);
|
||||||
|
|
||||||
Assert.Contains(userAgent, extraArg, StringComparison.InvariantCulture);
|
Assert.Contains($"-user_agent \"{userAgent}\"", extraArg, StringComparison.InvariantCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user