From d1dbf3745a892b0755016af7dd5f77ba4f2e76e5 Mon Sep 17 00:00:00 2001 From: Dean Gardiner Date: Wed, 22 Jan 2014 22:24:22 +1300 Subject: [PATCH 1/2] Updated rtorrent-python library --- libs/rtorrent/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/rtorrent/__init__.py b/libs/rtorrent/__init__.py index 683ef1c7..2c0f3fa9 100755 --- a/libs/rtorrent/__init__.py +++ b/libs/rtorrent/__init__.py @@ -199,7 +199,7 @@ class RTorrent: return(func_name) - def load_torrent(self, torrent, start=False, verbose=False, verify_load=True): + def load_torrent(self, torrent, start=False, verbose=False, verify_load=True, verify_retries=3): """ Loads torrent into rTorrent (with various enhancements) @@ -244,9 +244,8 @@ class RTorrent: getattr(p, func_name)(torrent) if verify_load: - MAX_RETRIES = 3 i = 0 - while i < MAX_RETRIES: + while i < verify_retries: self.get_torrents() if info_hash in [t.info_hash for t in self.torrents]: break From d860680823e0f42d156fc083b4e0035e2af7f08b Mon Sep 17 00:00:00 2001 From: Dean Gardiner Date: Wed, 22 Jan 2014 22:27:19 +1300 Subject: [PATCH 2/2] Increased rTorrent load_torrent max waiting time to 10 retries/seconds --- couchpotato/core/downloaders/rtorrent/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/couchpotato/core/downloaders/rtorrent/main.py b/couchpotato/core/downloaders/rtorrent/main.py index ff801db7..27177756 100755 --- a/couchpotato/core/downloaders/rtorrent/main.py +++ b/couchpotato/core/downloaders/rtorrent/main.py @@ -134,7 +134,7 @@ class rTorrent(Downloader): # Send request to rTorrent try: # Send torrent to rTorrent - torrent = self.rt.load_torrent(filedata) + torrent = self.rt.load_torrent(filedata, verify_retries=10) if not torrent: log.error('Unable to find the torrent, did it fail to load?')