Private GIT

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

Merge pull request #420 from SickRage/bugfix-174

make sure find returned something before calling other method with bs…
parents a8235800 bac30e81
No related branches found
No related tags found
No related merge requests found
...@@ -142,8 +142,14 @@ class TVChaosUKProvider(TorrentProvider): ...@@ -142,8 +142,14 @@ class TVChaosUKProvider(TorrentProvider):
continue continue
with BS4Parser(data) as html: with BS4Parser(data) as html:
torrent_table = html.find(id='listtorrents').find_all('tr') torrent_table = html.find(id='listtorrents')
for torrent in torrent_table: if not torrent_table:
logger.log(u"Data returned from provider does not contain any torrents", logger.DEBUG)
continue
torrent_rows = torrent_table.find_all('tr')
for torrent in torrent_rows:
try: try:
freeleech = torrent.find('img', alt=re.compile('Free Torrent')) freeleech = torrent.find('img', alt=re.compile('Free Torrent'))
if self.freeleech and not freeleech: if self.freeleech and not freeleech:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment