core: use proxy for cover/poster images url. resolves #12761 (#12843)

This commit is contained in:
Diego Heras
2022-01-17 00:38:58 +01:00
committed by GitHub
parent 28db1b63f2
commit cb7a4861a0
7 changed files with 104 additions and 14 deletions

View File

@@ -558,6 +558,19 @@ namespace Jackett.Common.Indexers
return response.ContentBytes;
}
public virtual async Task<WebResult> DownloadImage(Uri link)
{
var uncleanLink = UncleanLink(link);
var requestLink = uncleanLink.ToString();
var referer = SiteLink;
var response = await RequestWithCookiesAsync(requestLink, null, RequestType.GET, referer);
if (response.IsRedirect)
await FollowIfRedirect(response);
return response;
}
protected async Task<WebResult> RequestWithCookiesAndRetryAsync(
string url, string cookieOverride = null, RequestType method = RequestType.GET,
string referer = null, IEnumerable<KeyValuePair<string, string>> data = null,