redacted: fixed ip ban issue. resolves #9751 resolves #9753 resolves #3345 (#9770)

This commit is contained in:
seeyabye
2020-10-09 04:16:22 +09:00
committed by GitHub
parent 58b79053f4
commit 5be9224bb5
5 changed files with 120 additions and 78 deletions

View File

@@ -381,7 +381,7 @@ namespace Jackett.Common.Indexers
return await Download(uncleanLink, RequestType.GET);
}
protected async Task<byte[]> Download(Uri link, RequestType method, string refererlink = null)
protected async Task<byte[]> Download(Uri link, RequestType method, string refererlink = null, Dictionary<string, string>headers = null)
{
// return magnet link
if (link.Scheme == "magnet")
@@ -392,11 +392,8 @@ namespace Jackett.Common.Indexers
.Replace("(", "%28")
.Replace(")", "%29")
.Replace("'", "%27");
var response = await RequestWithCookiesAndRetryAsync(requestLink, null, method, requestLink);
var response = await RequestWithCookiesAndRetryAsync(requestLink, null, method, refererlink, null, headers);
// if referer link is provied it will be used
if (refererlink != null)
response = await RequestWithCookiesAndRetryAsync(requestLink, null, method, refererlink);
if (response.IsRedirect)
{
await FollowIfRedirect(response);