Rutracker_check plug-in upgrade

shwetha17

Member
May 24, 2018
785
0
16
Dear ruTorrent Developers,

First of all, I would like to say thank you. The project is excellent. It is so convenient to use the GUI to control torrents.

I also would like to contribute to rutracker_check plug-in code. I did some improvements, which make this plug-in useful in periodically check mode and simultaneous check of many files.

There are some limitation in rutracker.org site, which should be taken into account:
1) Maximum number of torrents files you can download per day is 100.
2) “Antibot”. The site recognize robot and each time you make search etc, it ask to fill the form with number on image first.

So, I improve plugin to avoid such problems.
1) To check that the torrent is changed or not, I use hash_search condition before downloading torrent file in check.php. This solution helps to avoid problem 1.
2) To avoid “antibot” I'm taking randomly a few files in list to check in update.php. New option were added to conf.php file averageUpdateTime. The average time each torrent will be checked for update.

I've tested the plug-in for a few weeks with ~300 torrents from rutracker.org and it seems to work.
$updateInterval = 30;
$averageUpdateTime = 1440;

Some notes:
1) Each updateInterval the plugin checks approximately $updateInterval/$averageUpdateTime * <number_of_rutracker_torrents> torrents. In my case it is around 4 and it is OK for the tracker (problem 2).
2) The value $updateInterval can be even 1. In this case the average torrents updates per interval will be less than 1 and it is working fine. But I not suggest you to set such small values because of (maybe) computational resources and authorization issues. You will be automatically log out from the site after check.php execution. So, it not so nice to login to the tracker every few minutes.
3) Never do simultaneous check of all you files (problem 2). If you still got the problem, just wait. The “antibot” behavior is temporary. In a few ours (may be day) it should gone.

I will really appreciate if you will check the code, possibly test and include it in you project.

Best regards,
 

dsouvik215

Member
May 25, 2018
896
0
16
First of all, one question - do you understand Russian? wink.gif
1) To check that the torrent is changed or not, I use hash_search condition before downloading torrent file in check.php. This solution helps to avoid problem 1.
Sorry, but i can't see this in your code. Anyway, svn version of plugin doesn't check torrents date more. And doesn't make unnecessary loading of torrents. Try to check it.
 

das329717

Member
May 25, 2018
928
0
16
Yes, I understand Russian. grin.gif When I registered at the forum I just accept rules without reading it. Should I continue in English or Russian?

The changes is really compact. The difference is in line 98-99 (check.php in attachment).
$client = self::makeClient("http://rutracker.org/forum/viewtopic.php?h=".$hash);
if($client->lastredirectaddr != $torrent->comment())

and in the end of the file, where I just close this if statement


diff -b check.php ../rutracker_check_old/check.php
98,100d97
< $client = self::makeClient("http://rutracker.org/forum/viewtopic.php?h=".$hash);
< if($client->lastredirectaddr != $torrent->comment())
< {
153,155d149
< $state = self::STE_UPTODATE;
< }
< else

I checked your code in svn. I'm really new in web-programming, so I have some simple question about your solution.
As I understand AJAX technology, your request will give you positive answer (the page should be updated) in case of new comment, changing topic header, may be, even, banners in the page etc. My request will give you positive answer only when torrent itself is changed. From another side it looks like that your request is much safer from problem (2) point of view. May be the best solution will be to combine both approaches?
 

das329717

Member
May 25, 2018
928
0
16
Yes, I understand Russian. grin.gif When I registered at the forum I just accept rules without reading it. Should I continue in English or Russian?
Я, вообщем, тоже не читал, что там написано wink.gif
Should I continue in English or Russian?
Приличней бы, конечно, на русскую форума часть перебраться, но, думаю, это не обязательно. Просто мой английский безобразен, возможно разного рода недопонимание. А большинству англоязычных участников данного форума подробности реализации малоинтересны, IMHO.
The changes is really compact. The difference is in line 98-99 (check.php in attachment).
$client = self::makeClient("http://rutracker.org/forum/viewtopic.php?h=".$hash);
if($client->lastredirectaddr != $torrent->comment())
Это не совсем корректно, т.к. несоответствие редиректа комментарию может означать сразу несколько вещей - клиенту не удалось залогиниться, форум на техобслуживании, хеш поменялся, торрент удален и т.д. Опять же не очень понятно, что будет, если на трекере имеются две разные страницы с торрентами, у которых хеш одинаков (не знаю, возможно ли это, но мало ли?)
Но в целом метод хороший, подумаю.
As I understand AJAX technology, your request will give you positive answer (the page should be updated) in case of new comment, changing topic header, may be, even, banners in the page etc.
Нет. Там напрямую запрашивается хеш торрента, лежащего на странице.