cinecalidad: fix relative links. resolves #10595 (#10607)

This commit is contained in:
Diego Heras 2020-12-22 18:21:00 +01:00 committed by GitHub
parent 9743c8bb96
commit 63b20c1aa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 4 deletions

View File

@ -142,8 +142,7 @@ namespace Jackett.Common.Indexers
var linkParts = protectedLink.Split('=');
protectedLink = protectedLink.Replace(linkParts[0] + "=", "");
}
if (protectedLink.StartsWith("/"))
protectedLink = SiteLink + protectedLink.TrimStart('/');
protectedLink = GetAbsoluteUrl(protectedLink);
results = await RequestWithCookiesAsync(protectedLink);
dom = parser.ParseDocument(results.ContentString);
@ -179,8 +178,8 @@ namespace Jackett.Common.Indexers
title += _language.Equals("castellano") ? " MULTi/SPANiSH" : " MULTi/LATiN SPANiSH";
title += " 1080p BDRip x264";
var poster = new Uri(qImg.GetAttribute("src"));
var link = new Uri(row.QuerySelector("a").GetAttribute("href"));
var poster = new Uri(GetAbsoluteUrl(qImg.GetAttribute("src")));
var link = new Uri(GetAbsoluteUrl(row.QuerySelector("a").GetAttribute("href")));
var release = new ReleaseInfo
{
@ -226,6 +225,14 @@ namespace Jackett.Common.Indexers
return queryWords.All(word => titleWords.Contains(word));
}
private string GetAbsoluteUrl(string url)
{
url = url.Trim();
if (!url.StartsWith("http"))
return SiteLink + url.TrimStart('/');
return url;
}
}
}