From 2270b2a28bbaddb5b52cadbcf2b482ac425eff8c Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 4 Oct 2014 16:50:01 +0200 Subject: [PATCH] Don't force parser for trailer searching --- couchpotato/core/media/movie/providers/trailer/hdtrailers.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/couchpotato/core/media/movie/providers/trailer/hdtrailers.py b/couchpotato/core/media/movie/providers/trailer/hdtrailers.py index 828f017..4cbb64d 100644 --- a/couchpotato/core/media/movie/providers/trailer/hdtrailers.py +++ b/couchpotato/core/media/movie/providers/trailer/hdtrailers.py @@ -3,7 +3,7 @@ import re from bs4 import SoupStrainer, BeautifulSoup from couchpotato.core.helpers.encoding import tryUrlencode -from couchpotato.core.helpers.variable import mergeDicts, getTitle +from couchpotato.core.helpers.variable import mergeDicts, getTitle, getIdentifier from couchpotato.core.logger import CPLog from couchpotato.core.media.movie.providers.trailer.base import TrailerProvider from requests import HTTPError @@ -29,7 +29,7 @@ class HDTrailers(TrailerProvider): url = self.urls['api'] % self.movieUrlName(movie_name) try: - data = self.getCache('hdtrailers.%s' % group['identifier'], url, show_error = False) + data = self.getCache('hdtrailers.%s' % getIdentifier(group), url, show_error = False) except HTTPError: log.debug('No page found for: %s', movie_name) data = None @@ -59,7 +59,7 @@ class HDTrailers(TrailerProvider): url = "%s?%s" % (self.urls['backup'], tryUrlencode({'s':movie_name})) try: - data = self.getCache('hdtrailers.alt.%s' % group['identifier'], url, show_error = False) + data = self.getCache('hdtrailers.alt.%s' % getIdentifier(group), url, show_error = False) except HTTPError: log.debug('No alternative page found for: %s', movie_name) data = None @@ -68,7 +68,7 @@ class HDTrailers(TrailerProvider): return results try: - html = BeautifulSoup(data, 'html.parser', parse_only = self.only_tables_tags) + html = BeautifulSoup(data, parse_only = self.only_tables_tags) result_table = html.find_all('h2', text = re.compile(movie_name)) for h2 in result_table: @@ -90,7 +90,7 @@ class HDTrailers(TrailerProvider): results = {'480p':[], '720p':[], '1080p':[]} try: - html = BeautifulSoup(data, 'html.parser', parse_only = self.only_tables_tags) + html = BeautifulSoup(data, parse_only = self.only_tables_tags) result_table = html.find('table', attrs = {'class':'bottomTable'}) for tr in result_table.find_all('tr'):