Return when no table is returned. fix #1053
This commit is contained in:
@@ -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+\/'))
|
||||
|
||||
Reference in New Issue
Block a user