mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
Fixed TorrentBlackhole failing fatally on magnet link instead of falling back to torrent url.
This commit is contained in:
parent
36ac4f0a8d
commit
a3873634b0
@ -115,7 +115,7 @@ public HttpResponse Execute(HttpRequest request)
|
|||||||
response.StatusCode == HttpStatusCode.MovedPermanently ||
|
response.StatusCode == HttpStatusCode.MovedPermanently ||
|
||||||
response.StatusCode == HttpStatusCode.Found))
|
response.StatusCode == HttpStatusCode.Found))
|
||||||
{
|
{
|
||||||
throw new Exception("Server requested a redirect to [" + response.Headers["Location"] + "]. Update the request URL to avoid this redirect.");
|
_logger.Error("Server requested a redirect to [" + response.Headers["Location"] + "]. Update the request URL to avoid this redirect.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!request.SuppressHttpError && response.HasHttpError)
|
if (!request.SuppressHttpError && response.HasHttpError)
|
||||||
|
@ -69,9 +69,16 @@ public override String Download(RemoteEpisode remoteEpisode)
|
|||||||
String hash = null;
|
String hash = null;
|
||||||
|
|
||||||
if (magnetUrl.IsNotNullOrWhiteSpace())
|
if (magnetUrl.IsNotNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
hash = DownloadFromMagnetUrl(remoteEpisode, magnetUrl);
|
hash = DownloadFromMagnetUrl(remoteEpisode, magnetUrl);
|
||||||
}
|
}
|
||||||
|
catch (NotSupportedException ex)
|
||||||
|
{
|
||||||
|
_logger.Debug("Magnet not supported by download client, trying torrent. ({0})", ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (hash == null && !torrentUrl.IsNullOrWhiteSpace())
|
if (hash == null && !torrentUrl.IsNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user