iptorrents: new results selectors. resolves #10040

This commit is contained in:
Garfield69
2020-11-01 19:11:52 +13:00
parent 4c3637e4b6
commit 4464d97e2f

View File

@@ -209,7 +209,7 @@ namespace Jackett.Common.Indexers
var rows = doc.QuerySelectorAll("table[id='torrents'] > tbody > tr"); var rows = doc.QuerySelectorAll("table[id='torrents'] > tbody > tr");
foreach (var row in rows.Skip(1)) foreach (var row in rows.Skip(1))
{ {
var qTitleLink = row.QuerySelector("a[href^=\"/details.php?id=\"]"); var qTitleLink = row.QuerySelector("a.hv");
if (qTitleLink == null) // no results if (qTitleLink == null) // no results
continue; continue;
@@ -220,13 +220,9 @@ namespace Jackett.Common.Indexers
var qLink = row.QuerySelector("a[href^=\"/download.php/\"]"); var qLink = row.QuerySelector("a[href^=\"/download.php/\"]");
var link = new Uri(SiteLink + qLink.GetAttribute("href").TrimStart('/')); var link = new Uri(SiteLink + qLink.GetAttribute("href").TrimStart('/'));
var descrSplit = row.QuerySelector(".t_ctime").TextContent.Split('|'); var descrSplit = row.QuerySelector("div.sub").TextContent.Split('|');
var dateSplit = descrSplit.Last().Trim().Split(new[] { " by " }, StringSplitOptions.None); var publishDate = DateTimeUtil.FromTimeAgo(descrSplit.Last());
var publishDate = DateTimeUtil.FromTimeAgo(dateSplit.First());
var description = descrSplit.Length > 1 ? "Tags: " + descrSplit.First().Trim() : ""; var description = descrSplit.Length > 1 ? "Tags: " + descrSplit.First().Trim() : "";
if (dateSplit.Length > 1)
description += " Uploader: " + dateSplit.Last();
description = description.Trim();
var catIcon = row.QuerySelector("td:nth-of-type(1) a"); var catIcon = row.QuerySelector("td:nth-of-type(1) a");
if (catIcon == null) if (catIcon == null)
@@ -237,10 +233,11 @@ namespace Jackett.Common.Indexers
var cat = MapTrackerCatToNewznab(catIcon.GetAttribute("href").Substring(1)); var cat = MapTrackerCatToNewznab(catIcon.GetAttribute("href").Substring(1));
var size = ReleaseInfo.GetBytes(row.Children[5].TextContent); var size = ReleaseInfo.GetBytes(row.Children[5].TextContent);
var grabs = ParseUtil.CoerceInt(row.Children[6].TextContent); var files = ParseUtil.CoerceInt(row.Children[6].TextContent.Replace("Go to files", ""));
var seeders = ParseUtil.CoerceInt(row.QuerySelector(".t_seeders").TextContent.Trim()); var grabs = ParseUtil.CoerceInt(row.Children[7].TextContent);
var leechers = ParseUtil.CoerceInt(row.QuerySelector(".t_leechers").TextContent.Trim()); var seeders = ParseUtil.CoerceInt(row.Children[8].TextContent);
var dlVolumeFactor = row.QuerySelector("span.t_tag_free_leech") != null ? 0 : 1; var leechers = ParseUtil.CoerceInt(row.Children[9].TextContent);
var dlVolumeFactor = row.QuerySelector("span.free") != null ? 0 : 1;
var release = new ReleaseInfo var release = new ReleaseInfo
{ {
@@ -252,6 +249,7 @@ namespace Jackett.Common.Indexers
Category = cat, Category = cat,
Description = description, Description = description,
Size = size, Size = size,
Files = files,
Grabs = grabs, Grabs = grabs,
Seeders = seeders, Seeders = seeders,
Peers = seeders + leechers, Peers = seeders + leechers,