Jackett icon indicating copy to clipboard operation
Jackett copied to clipboard

TorrentBytes.net - Added check to ensure we grabbed the correct table

Open digi691 opened this issue 10 years ago • 5 comments

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.

digi691 avatar Oct 28 '15 01:10 digi691

Is there a better way to do this? What happens if you search returns 3 torrents ie. 4 rows? Won't it skip all three results believing its the table warning banner

ghost avatar Oct 29 '15 08:10 ghost

I see your point and if it hit that it would return no results. Though the configuration check would still pass as the browse page will always have 15 releases on the first page. Looking at the page's html the one thing I could check for is the bgcolor attribute of the table. The banner table is set to bgcolor="red" where the table with the content that we are looking for does not have that attribute. I could skip the table and go to the next if the bgcolor="red" I don't think this is the greatest idea either because if they change the color of the banner it will break. The only other option I see is to take the first table after the

element. All of this is highly susceptible to breakage if the page's layout changes as they are not using any unique IDs or Classes for the table with the content we are trying to parse. I can work on another PR that is based on one of these methods but at least with this PR it is in an almost working state for someone that has a low ratio.

digi691 avatar Oct 29 '15 14:10 digi691

I think this project is in hibernation... This fork will be active for now : https://github.com/Jackett/Jackett

ghost avatar Oct 30 '15 07:10 ghost

@digi691 those sort of sites are such a pain to scrape. I think it's better to get it working right than worrying about future changes. When scraping a page you can never to cater to all changes. Returning 3 results is going to be fairly common in sonarr, so the current isn't a great solution. Could you do if 4 rows and red go to next table? Willing to have a look if you put the html in a pastebin or have an invite.

ghost avatar Oct 31 '15 05:10 ghost

I give a vote in favor I am interested also in that they work Spanish torrent

josel2000 avatar Sep 11 '17 17:09 josel2000