From 1dda7edf1cda966a8cfc98ce8145586402ec1215 Mon Sep 17 00:00:00 2001 From: Dean Gardiner Date: Sun, 19 Jan 2014 22:45:37 +1300 Subject: [PATCH 1/2] Fixed bug when parsing torrents page in IPT provider --- couchpotato/core/providers/torrent/iptorrents/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/providers/torrent/iptorrents/main.py b/couchpotato/core/providers/torrent/iptorrents/main.py index a02b97f2..6d41c090 100644 --- a/couchpotato/core/providers/torrent/iptorrents/main.py +++ b/couchpotato/core/providers/torrent/iptorrents/main.py @@ -99,7 +99,8 @@ class IPTorrents(TorrentProvider): result = {} for x, col in enumerate(entries[0].find_all('th')): - key = toSafeString(col.text).strip().lower() + name = col.text or col.find('img')['title'] + key = toSafeString(name).strip().lower() if not key: continue From 1f941a5105398856210421814900dbb85116f7f4 Mon Sep 17 00:00:00 2001 From: Dean Gardiner Date: Sun, 19 Jan 2014 21:58:13 +1300 Subject: [PATCH 2/2] Ensure files returned from rTorrent are absolute and inside the torrent directory. --- couchpotato/core/downloaders/rtorrent/main.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/downloaders/rtorrent/main.py b/couchpotato/core/downloaders/rtorrent/main.py index 50276314..853899cb 100755 --- a/couchpotato/core/downloaders/rtorrent/main.py +++ b/couchpotato/core/downloaders/rtorrent/main.py @@ -173,9 +173,16 @@ class rTorrent(Downloader): for torrent in torrents: if torrent.info_hash in ids: + torrent_directory = os.path.normpath(torrent.directory) torrent_files = [] - for file_item in torrent.get_files(): - torrent_files.append(sp(os.path.join(torrent.directory, file_item.path))) + + for file in torrent.get_files(): + if not os.path.normpath(file.path).startswith(torrent_directory): + file_path = os.path.join(torrent_directory, file.path.lstrip('/')) + else: + file_path = file.path + + torrent_files.append(sp(file_path)) status = 'busy' if torrent.complete: