mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Added DownloadFile method to HttpProvider.
Fixed Link that is returned from NzbMatrixProvider.NzbDownloadUrl. IndexerProvider will now download the NZB to the disk if SABnzbd is not configured.
This commit is contained in:
@@ -50,6 +50,20 @@ namespace NzbDrone.Core.Providers.Core
|
||||
return response.GetResponseStream();
|
||||
}
|
||||
|
||||
|
||||
public virtual bool DownloadFile(string address, string fileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
var webClient = new WebClient();
|
||||
webClient.DownloadFile(address, fileName);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Warn("Failed to get response from: {0}", address);
|
||||
Logger.TraceException(ex.Message, ex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user