DanishBits: fix download

This commit is contained in:
kaso17
2017-10-03 14:23:31 +02:00
parent ecc438b21e
commit 034edbd32a
2 changed files with 5 additions and 10 deletions

View File

@@ -361,7 +361,7 @@ namespace Jackett.Indexers
throw lastException; throw lastException;
} }
protected async Task<WebClientByteResult> RequestBytesWithCookies(string url, string cookieOverride = null, RequestType method = RequestType.GET, string referer = null, IEnumerable<KeyValuePair<string, string>> data = null, Dictionary<string, string> headers = null) protected virtual async Task<WebClientByteResult> RequestBytesWithCookies(string url, string cookieOverride = null, RequestType method = RequestType.GET, string referer = null, IEnumerable<KeyValuePair<string, string>> data = null, Dictionary<string, string> headers = null)
{ {
var request = new Utils.Clients.WebRequest() var request = new Utils.Clients.WebRequest()
{ {
@@ -511,7 +511,7 @@ namespace Jackett.Indexers
} }
// Update CookieHeader with new cookies and save the config if something changed (e.g. a new CloudFlare clearance cookie was issued) // Update CookieHeader with new cookies and save the config if something changed (e.g. a new CloudFlare clearance cookie was issued)
protected void UpdateCookieHeader(string newCookies, string cookieOverride = null) protected virtual void UpdateCookieHeader(string newCookies, string cookieOverride = null)
{ {
string newCookieHeader = ResolveCookies((cookieOverride != null && cookieOverride != "" ? cookieOverride + " " : "") + newCookies); string newCookieHeader = ResolveCookies((cookieOverride != null && cookieOverride != "" ? cookieOverride + " " : "") + newCookies);
if (CookieHeader != newCookieHeader) if (CookieHeader != newCookieHeader)

View File

@@ -43,15 +43,10 @@ namespace Jackett.Indexers
return searchString; return searchString;
} }
protected override async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query) protected override async Task<WebClientByteResult> RequestBytesWithCookies(string url, string cookieOverride = null, RequestType method = RequestType.GET, string referer = null, IEnumerable<KeyValuePair<string, string>> data = null, Dictionary<string, string> headers = null)
{ {
var newQuery = query; CookieHeader = null; // Download fill fail with cookies set
if (string.IsNullOrEmpty(query.SearchTerm) && string.IsNullOrEmpty(query.ImdbID)) return await base.RequestBytesWithCookies(url, cookieOverride, method, referer, data, headers);
{
newQuery = query.Clone();
newQuery.SearchTerm = "%";
}
return await base.PerformQuery(newQuery);
} }
} }
} }