utf-8 decdoding
This commit is contained in:
parent
9146830546
commit
dbbdd7eb6d
@ -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}",
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user