720pier: fix new layout. resolves #9511 (#9523)

This commit is contained in:
Diego Heras 2020-09-14 00:04:23 +02:00 committed by GitHub
parent 9aaf8a6562
commit de16ba7024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -34,6 +34,7 @@ namespace Jackett.Common.Indexers
Encoding = Encoding.UTF8; Encoding = Encoding.UTF8;
Language = "ru-ru"; Language = "ru-ru";
Type = "private"; Type = "private";
AddCategoryMapping(32, TorznabCatType.TVSport, "Basketball"); AddCategoryMapping(32, TorznabCatType.TVSport, "Basketball");
AddCategoryMapping(34, TorznabCatType.TVSport, "Basketball - NBA"); AddCategoryMapping(34, TorznabCatType.TVSport, "Basketball - NBA");
AddCategoryMapping(87, TorznabCatType.TVSport, "Basketball - NBA Playoffs"); AddCategoryMapping(87, TorznabCatType.TVSport, "Basketball - NBA Playoffs");
@ -111,16 +112,16 @@ namespace Jackett.Common.Indexers
{ {
{ "username", configData.Username.Value }, { "username", configData.Username.Value },
{ "password", configData.Password.Value }, { "password", configData.Password.Value },
{ "redirect", "/" }, { "redirect", "index.php" },
{ "login", "Login" }, { "login", "Login" },
{ "autologin", "on" } { "autologin", "on" }
}; };
var htmlParser = new HtmlParser(); var htmlParser = new HtmlParser();
var loginDocument = htmlParser.ParseDocument((await RequestStringWithCookies(LoginUrl)).Content); var loginDocument = htmlParser.ParseDocument((await RequestStringWithCookies(LoginUrl, "")).Content);
pairs["creation_time"] = loginDocument.GetElementsByName("creation_time")[0].GetAttribute("value"); pairs["creation_time"] = loginDocument.GetElementsByName("creation_time")[0].GetAttribute("value");
pairs["form_token"] = loginDocument.GetElementsByName("form_token")[0].GetAttribute("value"); pairs["form_token"] = loginDocument.GetElementsByName("form_token")[0].GetAttribute("value");
pairs["sid"] = loginDocument.GetElementsByName("sid")[0].GetAttribute("value"); pairs["sid"] = loginDocument.GetElementsByName("sid")[0].GetAttribute("value");
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl, true); var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, CookieHeader, true, null, LoginUrl, true);
await ConfigureIfOK( await ConfigureIfOK(
result.Cookies, result.Content?.Contains("ucp.php?mode=logout&") == true, result.Cookies, result.Content?.Contains("ucp.php?mode=logout&") == true,
() => throw new ExceptionWithConfigData(result.Content, configData)); () => throw new ExceptionWithConfigData(result.Content, configData));
@ -165,7 +166,7 @@ namespace Jackett.Common.Indexers
var detailLink = SiteLink + rowLink.GetAttribute("href"); var detailLink = SiteLink + rowLink.GetAttribute("href");
var detailsResult = await RequestStringWithCookies(detailLink); var detailsResult = await RequestStringWithCookies(detailLink);
var detailsDocument = resultParser.ParseDocument(detailsResult.Content); var detailsDocument = resultParser.ParseDocument(detailsResult.Content);
var detailRow = detailsDocument.QuerySelector("table.table2 > tbody > tr"); var detailRow = detailsDocument.QuerySelector("table.table2 > tbody > tr.bg1");
if (detailRow == null) if (detailRow == null)
continue; //No torrents in result continue; //No torrents in result
var qDownloadLink = detailRow.QuerySelector("a[href^=\"/download/torrent\"]"); var qDownloadLink = detailRow.QuerySelector("a[href^=\"/download/torrent\"]");