Backport pull request #11857 from jellyfin/release-10.9.z

Fix ffprobe -user_agent parameter

Original-merge: d0336cd67e

Merged-by: Bond-009 <bond.009@outlook.com>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
gnattu 2024-06-01 18:41:05 -04:00 committed by Joshua M. Boniface
parent b123f7ffcd
commit 8424ff5b61
2 changed files with 4 additions and 4 deletions

View File

@ -456,9 +456,9 @@ namespace MediaBrowser.MediaEncoding.Encoder
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)

View File

@ -35,7 +35,7 @@ namespace Jellyfin.MediaEncoding.Tests.Probing
Protocol = MediaProtocol.Http,
RequiredHttpHeaders = new Dictionary<string, string>()
{
{ "user_agent", userAgent },
{ "User-Agent", userAgent },
}
},
ExtractChapters = false,
@ -44,7 +44,7 @@ namespace Jellyfin.MediaEncoding.Tests.Probing
var extraArg = encoder.GetExtraArguments(req);
Assert.Contains(userAgent, extraArg, StringComparison.InvariantCulture);
Assert.Contains($"-user_agent \"{userAgent}\"", extraArg, StringComparison.InvariantCulture);
}
}
}