aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2025-01-22 17:44:16 +0100
committerGitHub <noreply@github.com>2025-01-22 17:44:16 +0100
commitcd2255a3ade134bea2a1e6573775cc5a2f526d8d (patch)
treeb32f47e98e0cad51251395626030df2241bae77b
parente7c130abcf8c257a5da4c86dae66c3c0a4f76b4e (diff)
parentab380090695ee196967912cb329260055c4778d1 (diff)
Add support for .gzip files and handle URL redirection (#13319)
Co-authored-by: Max <@>
-rw-r--r--src/Jellyfin.LiveTv/Listings/XmlTvListingsProvider.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Jellyfin.LiveTv/Listings/XmlTvListingsProvider.cs b/src/Jellyfin.LiveTv/Listings/XmlTvListingsProvider.cs
index 7dc30f727..7938b7a6e 100644
--- a/src/Jellyfin.LiveTv/Listings/XmlTvListingsProvider.cs
+++ b/src/Jellyfin.LiveTv/Listings/XmlTvListingsProvider.cs
@@ -84,10 +84,11 @@ namespace Jellyfin.LiveTv.Listings
_logger.LogInformation("Downloading xmltv listings from {Path}", info.Path);
using var response = await _httpClientFactory.CreateClient(NamedClient.Default).GetAsync(info.Path, cancellationToken).ConfigureAwait(false);
+ var redirectedUrl = response.RequestMessage?.RequestUri?.ToString() ?? info.Path;
var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
await using (stream.ConfigureAwait(false))
{
- return await UnzipIfNeededAndCopy(info.Path, stream, cacheFile, cancellationToken).ConfigureAwait(false);
+ return await UnzipIfNeededAndCopy(redirectedUrl, stream, cacheFile, cancellationToken).ConfigureAwait(false);
}
}
else
@@ -112,7 +113,8 @@ namespace Jellyfin.LiveTv.Listings
await using (fileStream.ConfigureAwait(false))
{
- if (Path.GetExtension(originalUrl.AsSpan().LeftPart('?')).Equals(".gz", StringComparison.OrdinalIgnoreCase))
+ if (Path.GetExtension(originalUrl.AsSpan().LeftPart('?')).Equals(".gz", StringComparison.OrdinalIgnoreCase) ||
+ Path.GetExtension(originalUrl.AsSpan().LeftPart('?')).Equals(".gzip", StringComparison.OrdinalIgnoreCase))
{
try
{