mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
HttpProvider - Added Download File.
SabProvider - Added AddById (Newzbin) Fixes to RssItemProcessingProvider Can either download NZB to file or send to SAB...
This commit is contained in:
parent
84f0dfed4e
commit
4f2f5a3d71
11 changed files with 240 additions and 75 deletions
|
@ -39,5 +39,40 @@ namespace NzbDrone.Core.Providers
|
|||
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public bool DownloadFile(string request, string filename)
|
||||
{
|
||||
try
|
||||
{
|
||||
var webClient = new WebClient();
|
||||
webClient.DownloadFile(request, filename);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Warn("Failed to get response from: {0}", request);
|
||||
Logger.TraceException(ex.Message, ex);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool DownloadFile(string request, string filename, string username, string password)
|
||||
{
|
||||
try
|
||||
{
|
||||
var webClient = new WebClient();
|
||||
webClient.Credentials = new NetworkCredential(username, password);
|
||||
webClient.DownloadFile(request, filename);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Warn("Failed to get response from: {0}", request);
|
||||
Logger.TraceException(ex.Message, ex);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue