Return when no table is returned. fix #1053

This commit is contained in:
Ruud
2012-11-20 21:07:21 +01:00
parent 95c5db2d17
commit daaa2154e5
@@ -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+\/'))