diff --git a/Jellyfin.Plugin.SRFPlay/Api/SRFApiClient.cs b/Jellyfin.Plugin.SRFPlay/Api/SRFApiClient.cs index 925a8a8..b58f424 100644 --- a/Jellyfin.Plugin.SRFPlay/Api/SRFApiClient.cs +++ b/Jellyfin.Plugin.SRFPlay/Api/SRFApiClient.cs @@ -2,6 +2,7 @@ using System; using System.Globalization; using System.Net; using System.Net.Http; +using System.Text.Encodings.Web; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -51,7 +52,8 @@ public class SRFApiClient : IDisposable _jsonOptions = new JsonSerializerOptions { - PropertyNameCaseInsensitive = true + PropertyNameCaseInsensitive = true, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping }; } @@ -110,6 +112,7 @@ public class SRFApiClient : IDisposable client.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"); client.DefaultRequestHeaders.Accept.ParseAdd("*/*"); client.DefaultRequestHeaders.AcceptLanguage.ParseAdd("en-US,en;q=0.9"); + client.DefaultRequestHeaders.Add("Accept-Charset", "utf-8"); _logger.LogInformation( "HttpClient created with HTTP/1.1 and headers - User-Agent: {UserAgent}, Accept: {Accept}, Accept-Language: {AcceptLanguage}", diff --git a/Jellyfin.Plugin.SRFPlay/Controllers/StreamProxyController.cs b/Jellyfin.Plugin.SRFPlay/Controllers/StreamProxyController.cs index d799429..88d8186 100644 --- a/Jellyfin.Plugin.SRFPlay/Controllers/StreamProxyController.cs +++ b/Jellyfin.Plugin.SRFPlay/Controllers/StreamProxyController.cs @@ -148,7 +148,7 @@ public class StreamProxyController : ControllerBase AddManifestCacheHeaders(actualItemId); _logger.LogDebug("Returning master manifest for item {ItemId} ({Length} bytes)", itemId, manifestContent.Length); - return Content(manifestContent, "application/vnd.apple.mpegurl"); + return Content(manifestContent, "application/vnd.apple.mpegurl; charset=utf-8"); } catch (Exception ex) { @@ -201,7 +201,7 @@ public class StreamProxyController : ControllerBase AddManifestCacheHeaders(actualItemId); _logger.LogDebug("Returning variant manifest for item {ItemId} ({Length} bytes)", itemId, rewrittenContent.Length); - return Content(rewrittenContent, "application/vnd.apple.mpegurl"); + return Content(rewrittenContent, "application/vnd.apple.mpegurl; charset=utf-8"); } catch (Exception ex) {