From 034edbd32a5fefab8b9c868bd8e87b249fe4ea4a Mon Sep 17 00:00:00 2001 From: kaso17 Date: Tue, 3 Oct 2017 14:23:31 +0200 Subject: [PATCH] DanishBits: fix download --- src/Jackett/Indexers/BaseIndexer.cs | 4 ++-- src/Jackett/Indexers/DanishBits.cs | 11 +++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Jackett/Indexers/BaseIndexer.cs b/src/Jackett/Indexers/BaseIndexer.cs index 5a8aface4..8e2bf24c9 100644 --- a/src/Jackett/Indexers/BaseIndexer.cs +++ b/src/Jackett/Indexers/BaseIndexer.cs @@ -361,7 +361,7 @@ namespace Jackett.Indexers throw lastException; } - protected async Task RequestBytesWithCookies(string url, string cookieOverride = null, RequestType method = RequestType.GET, string referer = null, IEnumerable> data = null, Dictionary headers = null) + protected virtual async Task RequestBytesWithCookies(string url, string cookieOverride = null, RequestType method = RequestType.GET, string referer = null, IEnumerable> data = null, Dictionary 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) diff --git a/src/Jackett/Indexers/DanishBits.cs b/src/Jackett/Indexers/DanishBits.cs index 6ad5bdc0d..ae7021bf2 100644 --- a/src/Jackett/Indexers/DanishBits.cs +++ b/src/Jackett/Indexers/DanishBits.cs @@ -43,15 +43,10 @@ namespace Jackett.Indexers return searchString; } - protected override async Task> PerformQuery(TorznabQuery query) + protected override async Task RequestBytesWithCookies(string url, string cookieOverride = null, RequestType method = RequestType.GET, string referer = null, IEnumerable> data = null, Dictionary 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); } } }