mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-23 14:55:20 -07:00
Fixed: Follow 301 redirects when fetching torrents (#1653)
Closes #1564
This commit is contained in:
parent
7af88037bb
commit
28b523b504
1 changed files with 8 additions and 4 deletions
|
@ -33,7 +33,7 @@ namespace NzbDrone.Core.Download
|
||||||
_httpClient = httpClient;
|
_httpClient = httpClient;
|
||||||
_torrentFileInfoReader = torrentFileInfoReader;
|
_torrentFileInfoReader = torrentFileInfoReader;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
|
public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
|
||||||
|
|
||||||
public virtual bool PreferTorrentFile => false;
|
public virtual bool PreferTorrentFile => false;
|
||||||
|
@ -149,7 +149,7 @@ namespace NzbDrone.Core.Download
|
||||||
{
|
{
|
||||||
magnetUrl = torrentInfo.MagnetUrl;
|
magnetUrl = torrentInfo.MagnetUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PreferTorrentFile)
|
if (PreferTorrentFile)
|
||||||
{
|
{
|
||||||
if (torrentUrl.IsNotNullOrWhiteSpace())
|
if (torrentUrl.IsNotNullOrWhiteSpace())
|
||||||
|
@ -221,7 +221,9 @@ namespace NzbDrone.Core.Download
|
||||||
|
|
||||||
var response = _httpClient.Get(request);
|
var response = _httpClient.Get(request);
|
||||||
|
|
||||||
if (response.StatusCode == HttpStatusCode.SeeOther || response.StatusCode == HttpStatusCode.Found)
|
if (response.StatusCode == HttpStatusCode.MovedPermanently ||
|
||||||
|
response.StatusCode == HttpStatusCode.Found ||
|
||||||
|
response.StatusCode == HttpStatusCode.SeeOther)
|
||||||
{
|
{
|
||||||
var locationHeader = response.Headers.GetSingleValue("Location");
|
var locationHeader = response.Headers.GetSingleValue("Location");
|
||||||
|
|
||||||
|
@ -321,7 +323,9 @@ namespace NzbDrone.Core.Download
|
||||||
|
|
||||||
var response = _httpClient.Get(request);
|
var response = _httpClient.Get(request);
|
||||||
|
|
||||||
if (response.StatusCode == HttpStatusCode.SeeOther || response.StatusCode == HttpStatusCode.Found)
|
if (response.StatusCode == HttpStatusCode.MovedPermanently ||
|
||||||
|
response.StatusCode == HttpStatusCode.Found ||
|
||||||
|
response.StatusCode == HttpStatusCode.SeeOther)
|
||||||
{
|
{
|
||||||
var locationHeader = response.Headers.GetSingleValue("Location");
|
var locationHeader = response.Headers.GetSingleValue("Location");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue