diff --git a/couchpotato/core/providers/torrent/thepiratebay/main.py b/couchpotato/core/providers/torrent/thepiratebay/main.py index a4ce3631..29a8c8ef 100644 --- a/couchpotato/core/providers/torrent/thepiratebay/main.py +++ b/couchpotato/core/providers/torrent/thepiratebay/main.py @@ -57,7 +57,7 @@ class ThePirateBay(TorrentProvider): data = '' try: - data = self.urlopen(proxy, timeout = 3) + data = self.urlopen(proxy, timeout = 3, show_error = False) except: log.debug('Failed tpb proxy %s', proxy) @@ -88,6 +88,10 @@ class ThePirateBay(TorrentProvider): try: soup = BeautifulSoup(data) results_table = soup.find('table', attrs = {'id': 'searchResult'}) + + if not results_table: + return results + entries = results_table.find_all('tr') for result in entries[1:]: link = result.find(href = re.compile('torrent\/\d+\/'))