Private GIT

Skip to content
Snippets Groups Projects
Commit 4448be47 authored by Luca's avatar Luca
Browse files

IPT & TL use html5 parser for bs4

parent 9fbd5e95
No related branches found
No related tags found
No related merge requests found
......@@ -156,7 +156,7 @@ class IPTorrentsProvider(generic.TorrentProvider):
continue
try:
html = BeautifulSoup(data)
html = BeautifulSoup(data, features=["html5lib", "permissive"])
if not html:
logger.log(u"Invalid HTML data: " + str(data) , logger.DEBUG)
......@@ -254,7 +254,7 @@ class IPTorrentsCache(tvcache.TVCache):
return []
try:
html = BeautifulSoup(data)
html = BeautifulSoup(data, features=["html5lib", "permissive"])
torrent_table = html.find('table', attrs = {'class' : 'torrents'})
torrents = torrent_table.find_all('tr') if torrent_table else []
......
......@@ -156,7 +156,7 @@ class TorrentLeechProvider(generic.TorrentProvider):
continue
try:
html = BeautifulSoup(data)
html = BeautifulSoup(data, features=["html5lib", "permissive"])
torrent_table = html.find('table', attrs = {'id' : 'torrenttable'})
torrent_rows = torrent_table.find_all('tr') if torrent_table else []
......@@ -241,7 +241,7 @@ class TorrentLeechCache(tvcache.TVCache):
return []
try:
html = BeautifulSoup(data)
html = BeautifulSoup(data, features=["html5lib", "permissive"])
torrent_table = html.find('table', attrs = {'id' : 'torrenttable'})
torrent_rows = torrent_table.find_all('tr') if torrent_table else []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment