From 1d7523cd48bd6f36af9ddccde7e203466fd5e1da Mon Sep 17 00:00:00 2001 From: Ade Date: Sun, 4 Aug 2013 17:07:47 +1200 Subject: [PATCH] Piratebay getting stuck if no results found --- headphones/searcher.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index ca08504f..8e9c2869 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -1102,9 +1102,11 @@ def searchTorrent(albumid=None, new=False, losslessOnly=False): soup = BeautifulSoup(data) table = soup.find('table') - rows = table.findAll('tr') + rows = None + if table: + rows = table.findAll('tr') - if len(rows) == '1': + if not rows or len(rows) == '1': logger.info(u"No results found from %s for %s" % (provider, term)) pass