From 96c05c2298e655e75f2760d4a73459169b5dcd64 Mon Sep 17 00:00:00 2001 From: Chris DiGiovanni Date: Tue, 27 Oct 2015 20:35:44 -0500 Subject: [PATCH] Added check to ensure we grabbed the correct table During configuration If a user's ratio is dangerously low the page displays an extra table with a warning banner. This extra table throws off the jQuery selection. Since the table does not have any identifiers to write a better selector, I just ensure that the amount of rows returned isn't 4, if it is we select the next table. --- src/Jackett/Indexers/TorrentBytes.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Jackett/Indexers/TorrentBytes.cs b/src/Jackett/Indexers/TorrentBytes.cs index 7ee384627..29a26792a 100644 --- a/src/Jackett/Indexers/TorrentBytes.cs +++ b/src/Jackett/Indexers/TorrentBytes.cs @@ -136,6 +136,11 @@ private async Task ProcessPage(List releases, string searchUrl) CQ dom = results; var rows = dom["#content table:eq(4) tr"]; + // If we return 4 rows the ratio warning banner must be displayed, skip to next table. + if (rows.Length.Equals(4)) + { + rows = dom["#content table:eq(5) tr"]; + } foreach (var row in rows.Skip(1)) { var release = new ReleaseInfo();