From 4448be4755169295269cf031c37e1ea9a4fddbcb Mon Sep 17 00:00:00 2001
From: Luca <l.dimarino@gmail.com>
Date: Thu, 9 May 2013 11:55:46 +0200
Subject: [PATCH] IPT & TL use html5 parser for bs4

---
 sickbeard/providers/iptorrents.py   | 4 ++--
 sickbeard/providers/torrentleech.py | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sickbeard/providers/iptorrents.py b/sickbeard/providers/iptorrents.py
index 9ad9cf742..1a7298bff 100644
--- a/sickbeard/providers/iptorrents.py
+++ b/sickbeard/providers/iptorrents.py
@@ -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 []
diff --git a/sickbeard/providers/torrentleech.py b/sickbeard/providers/torrentleech.py
index 356b09326..759d37596 100644
--- a/sickbeard/providers/torrentleech.py
+++ b/sickbeard/providers/torrentleech.py
@@ -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 []
-- 
GitLab