mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
This reverts commit 22bced9ca3
.
This commit is contained in:
@@ -412,7 +412,7 @@ namespace Jackett.Common.Indexers
|
||||
return response.ContentBytes;
|
||||
}
|
||||
|
||||
protected async Task<WebResult> RequestBytesWithCookiesAndRetry(string url, string cookieOverride = null, RequestType method = RequestType.GET, string referer = null, IEnumerable<KeyValuePair<string, string>> data = null)
|
||||
protected async Task<BaseWebResult> RequestBytesWithCookiesAndRetry(string url, string cookieOverride = null, RequestType method = RequestType.GET, string referer = null, IEnumerable<KeyValuePair<string, string>> data = null)
|
||||
{
|
||||
Exception lastException = null;
|
||||
for (var i = 0; i < 3; i++)
|
||||
@@ -432,7 +432,7 @@ namespace Jackett.Common.Indexers
|
||||
throw lastException;
|
||||
}
|
||||
|
||||
protected async Task<WebResult> RequestStringWithCookies(string url, string cookieOverride = null, string referer = null, Dictionary<string, string> headers = null)
|
||||
protected async Task<BaseWebResult> RequestStringWithCookies(string url, string cookieOverride = null, string referer = null, Dictionary<string, string> headers = null)
|
||||
{
|
||||
var request = new Utils.Clients.WebRequest()
|
||||
{
|
||||
@@ -452,7 +452,7 @@ namespace Jackett.Common.Indexers
|
||||
return result;
|
||||
}
|
||||
|
||||
protected async Task<WebResult> RequestStringWithCookiesAndRetry(string url, string cookieOverride = null, string referer = null, Dictionary<string, string> headers = null)
|
||||
protected async Task<BaseWebResult> RequestStringWithCookiesAndRetry(string url, string cookieOverride = null, string referer = null, Dictionary<string, string> headers = null)
|
||||
{
|
||||
Exception lastException = null;
|
||||
for (var i = 0; i < 3; i++)
|
||||
@@ -472,7 +472,7 @@ namespace Jackett.Common.Indexers
|
||||
throw lastException;
|
||||
}
|
||||
|
||||
protected virtual async Task<WebResult> 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<BaseWebResult> 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()
|
||||
{
|
||||
@@ -492,7 +492,7 @@ namespace Jackett.Common.Indexers
|
||||
return result;
|
||||
}
|
||||
|
||||
protected async Task<WebResult> PostDataWithCookies(string url, IEnumerable<KeyValuePair<string, string>> data, string cookieOverride = null, string referer = null, Dictionary<string, string> headers = null, string rawbody = null, bool? emulateBrowser = null)
|
||||
protected async Task<BaseWebResult> PostDataWithCookies(string url, IEnumerable<KeyValuePair<string, string>> data, string cookieOverride = null, string referer = null, Dictionary<string, string> headers = null, string rawbody = null, bool? emulateBrowser = null)
|
||||
{
|
||||
var request = new Utils.Clients.WebRequest()
|
||||
{
|
||||
@@ -514,7 +514,7 @@ namespace Jackett.Common.Indexers
|
||||
return result;
|
||||
}
|
||||
|
||||
protected async Task<WebResult> PostDataWithCookiesAndRetry(string url, IEnumerable<KeyValuePair<string, string>> data, string cookieOverride = null, string referer = null, Dictionary<string, string> headers = null, string rawbody = null, bool? emulateBrowser = null)
|
||||
protected async Task<BaseWebResult> PostDataWithCookiesAndRetry(string url, IEnumerable<KeyValuePair<string, string>> data, string cookieOverride = null, string referer = null, Dictionary<string, string> headers = null, string rawbody = null, bool? emulateBrowser = null)
|
||||
{
|
||||
Exception lastException = null;
|
||||
for (var i = 0; i < 3; i++)
|
||||
@@ -534,7 +534,7 @@ namespace Jackett.Common.Indexers
|
||||
throw lastException;
|
||||
}
|
||||
|
||||
protected async Task<WebResult> RequestLoginAndFollowRedirect(string url, IEnumerable<KeyValuePair<string, string>> data, string cookies, bool returnCookiesFromFirstCall, string redirectUrlOverride = null, string referer = null, bool accumulateCookies = false)
|
||||
protected async Task<BaseWebResult> RequestLoginAndFollowRedirect(string url, IEnumerable<KeyValuePair<string, string>> data, string cookies, bool returnCookiesFromFirstCall, string redirectUrlOverride = null, string referer = null, bool accumulateCookies = false)
|
||||
{
|
||||
var request = new Utils.Clients.WebRequest()
|
||||
{
|
||||
@@ -566,7 +566,7 @@ namespace Jackett.Common.Indexers
|
||||
return response;
|
||||
}
|
||||
|
||||
protected void CheckTrackerDown(WebResult response)
|
||||
protected void CheckTrackerDown(BaseWebResult response)
|
||||
{
|
||||
if (response.Status == System.Net.HttpStatusCode.BadGateway
|
||||
|| response.Status == System.Net.HttpStatusCode.GatewayTimeout
|
||||
@@ -584,7 +584,7 @@ namespace Jackett.Common.Indexers
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task FollowIfRedirect(WebResult response, string referrer = null, string overrideRedirectUrl = null, string overrideCookies = null, bool accumulateCookies = false)
|
||||
protected async Task FollowIfRedirect(BaseWebResult response, string referrer = null, string overrideRedirectUrl = null, string overrideCookies = null, bool accumulateCookies = false)
|
||||
{
|
||||
// Follow up to 5 redirects
|
||||
for (var i = 0; i < 5; i++)
|
||||
@@ -629,7 +629,7 @@ namespace Jackett.Common.Indexers
|
||||
}
|
||||
}
|
||||
|
||||
private async Task DoFollowIfRedirect(WebResult incomingResponse, string referrer = null, string overrideRedirectUrl = null, string overrideCookies = null, bool accumulateCookies = false)
|
||||
private async Task DoFollowIfRedirect(BaseWebResult incomingResponse, string referrer = null, string overrideRedirectUrl = null, string overrideCookies = null, bool accumulateCookies = false)
|
||||
{
|
||||
if (incomingResponse.IsRedirect)
|
||||
{
|
||||
|
Reference in New Issue
Block a user