Fix Headphones Download Auth, Add Special Parsing (#152)

* Add Secondary Backup Parsing Method if Regex Fails

* Add BasicAuth info to release for nzb download handling
This commit is contained in:
Qstick
2017-12-17 18:34:58 -05:00
committed by GitHub
parent ba3d6362af
commit ded7574227
11 changed files with 147 additions and 7 deletions
+10 -1
View File
@@ -8,6 +8,7 @@ using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Configuration;
using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.RemotePathMappings;
namespace NzbDrone.Core.Download
@@ -43,7 +44,15 @@ namespace NzbDrone.Core.Download
try
{
nzbData = _httpClient.Get(new HttpRequest(url)).ResponseData;
var nzbDataRequest = new HttpRequest(url);
// TODO: Look into moving download request handling to indexer
if (remoteAlbum.Release.BasicAuthString.IsNotNullOrWhiteSpace())
{
nzbDataRequest.Headers.Set("Authorization", "Basic " + remoteAlbum.Release.BasicAuthString);
}
nzbData = _httpClient.Get(nzbDataRequest).ResponseData;
_logger.Debug("Downloaded nzb for release '{0}' finished ({1} bytes from {2})", remoteAlbum.Release.Title, nzbData.Length, url);
}