1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-01-18 13:43:50 +00:00

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;
}
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()
{
@ -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)
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);
if (CookieHeader != newCookieHeader)

View file

@ -43,15 +43,10 @@ namespace Jackett.Indexers
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;
if (string.IsNullOrEmpty(query.SearchTerm) && string.IsNullOrEmpty(query.ImdbID))
{
newQuery = query.Clone();
newQuery.SearchTerm = "%";
}
return await base.PerformQuery(newQuery);
CookieHeader = null; // Download fill fail with cookies set
return await base.RequestBytesWithCookies(url, cookieOverride, method, referer, data, headers);
}
}
}