From 13fc916177892b216d073f3579a7e14fba9d8a82 Mon Sep 17 00:00:00 2001 From: Diego Heras Date: Sun, 1 Nov 2020 13:41:52 +0100 Subject: [PATCH] iptorrents: fix new layout. resolves #10050 (#10054) * files column removed * fix date parsing * include first results * add uploader into description --- src/Jackett.Common/Indexers/IPTorrents.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Jackett.Common/Indexers/IPTorrents.cs b/src/Jackett.Common/Indexers/IPTorrents.cs index f206fcd61..ec054fcca 100644 --- a/src/Jackett.Common/Indexers/IPTorrents.cs +++ b/src/Jackett.Common/Indexers/IPTorrents.cs @@ -207,7 +207,7 @@ namespace Jackett.Common.Indexers var doc = parser.ParseDocument(results); var rows = doc.QuerySelectorAll("table[id='torrents'] > tbody > tr"); - foreach (var row in rows.Skip(1)) + foreach (var row in rows) { var qTitleLink = row.QuerySelector("a.hv"); if (qTitleLink == null) // no results @@ -221,8 +221,10 @@ namespace Jackett.Common.Indexers var link = new Uri(SiteLink + qLink.GetAttribute("href").TrimStart('/')); var descrSplit = row.QuerySelector("div.sub").TextContent.Split('|'); - var publishDate = DateTimeUtil.FromTimeAgo(descrSplit.Last()); + var dateSplit = descrSplit.Last().Split(new [] {" by "}, StringSplitOptions.None); + var publishDate = DateTimeUtil.FromTimeAgo(dateSplit.First()); var description = descrSplit.Length > 1 ? "Tags: " + descrSplit.First().Trim() : ""; + description += dateSplit.Length > 1 ? " Uploaded by: " + dateSplit.Last().Trim() : ""; var catIcon = row.QuerySelector("td:nth-of-type(1) a"); if (catIcon == null) @@ -233,10 +235,9 @@ namespace Jackett.Common.Indexers var cat = MapTrackerCatToNewznab(catIcon.GetAttribute("href").Substring(1)); var size = ReleaseInfo.GetBytes(row.Children[5].TextContent); - var files = ParseUtil.CoerceInt(row.Children[6].TextContent.Replace("Go to files", "")); - var grabs = ParseUtil.CoerceInt(row.Children[7].TextContent); - var seeders = ParseUtil.CoerceInt(row.Children[8].TextContent); - var leechers = ParseUtil.CoerceInt(row.Children[9].TextContent); + var grabs = ParseUtil.CoerceInt(row.Children[6].TextContent); + var seeders = ParseUtil.CoerceInt(row.Children[7].TextContent); + var leechers = ParseUtil.CoerceInt(row.Children[8].TextContent); var dlVolumeFactor = row.QuerySelector("span.free") != null ? 0 : 1; var release = new ReleaseInfo @@ -249,7 +250,6 @@ namespace Jackett.Common.Indexers Category = cat, Description = description, Size = size, - Files = files, Grabs = grabs, Seeders = seeders, Peers = seeders + leechers,