Private GIT

Skip to content
Snippets Groups Projects
Commit cf9c8625 authored by miigotu's avatar miigotu
Browse files

Fix AttributeError in ttn when no results are found

parent 91ebd57c
Branches
Tags
No related merge requests found
......@@ -108,6 +108,10 @@ class TransmitTheNetProvider(generic.TorrentProvider):
try:
with BS4Parser(data, features=["html5lib", "permissive"]) as html:
torrent_table = html.find('table', {'id':'torrent_table'})
if not torrent_table:
logger.log(u"Data returned from %s does not contain any torrents" % self.name, logger.DEBUG)
continue
torrent_rows = torrent_table.findAll('tr', {'class':'torrent'})
# Continue only if one Release is found
if not torrent_rows:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment