From dac36d7f5546eb18518c051f9a70ab0c5e972a7a Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 22 Jun 2013 14:16:02 +0200 Subject: [PATCH] IPTorrents ignore empty results --- couchpotato/core/providers/torrent/iptorrents/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/providers/torrent/iptorrents/main.py b/couchpotato/core/providers/torrent/iptorrents/main.py index b668747..d22f4bd 100644 --- a/couchpotato/core/providers/torrent/iptorrents/main.py +++ b/couchpotato/core/providers/torrent/iptorrents/main.py @@ -59,7 +59,11 @@ class IPTorrents(TorrentProvider): for result in entries[1:]: - torrent = result.find_all('td')[1].find('a') + torrent = result.find_all('td') + if len(torrent) <= 1: + break + + torrent = torrent[1].find('a') torrent_id = torrent['href'].replace('/details.php?id=', '') torrent_name = torrent.string