Browse Source

Don't show trailer 404 errors

pull/992/merge
Ruud 13 years ago
parent
commit
4dfd8b4cd5
  1. 3
      couchpotato/core/plugins/base.py
  2. 17
      couchpotato/core/providers/trailer/hdtrailers/main.py

3
couchpotato/core/plugins/base.py

@ -239,7 +239,8 @@ class Plugin(object):
self.setCache(cache_key, data, timeout = cache_timeout)
return data
except:
pass
if not kwargs.get('show_error'):
raise
def setCache(self, cache_key, value, timeout = 300):
log.debug('Setting cache %s', cache_key)

17
couchpotato/core/providers/trailer/hdtrailers/main.py

@ -4,6 +4,7 @@ from couchpotato.core.helpers.variable import mergeDicts, getTitle
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.trailer.base import TrailerProvider
from string import digits, ascii_letters
from urllib2 import HTTPError
import re
log = CPLog(__name__)
@ -22,7 +23,12 @@ class HDTrailers(TrailerProvider):
movie_name = getTitle(group['library'])
url = self.urls['api'] % self.movieUrlName(movie_name)
data = self.getCache('hdtrailers.%s' % group['library']['identifier'], url)
try:
data = self.getCache('hdtrailers.%s' % group['library']['identifier'], url, show_error = False)
except HTTPError:
log.debug('No page found for: %s', movie_name)
data = None
result_data = {'480p':[], '720p':[], '1080p':[]}
if not data:
@ -47,7 +53,14 @@ class HDTrailers(TrailerProvider):
movie_name = getTitle(group['library'])
url = "%s?%s" % (self.urls['backup'], tryUrlencode({'s':movie_name}))
data = self.getCache('hdtrailers.alt.%s' % group['library']['identifier'], url)
try:
data = self.getCache('hdtrailers.alt.%s' % group['library']['identifier'], url, show_error = False)
except HTTPError:
log.debug('No alternative page found for: %s', movie_name)
data = None
if not data:
return results
try:
tables = SoupStrainer('div')

Loading…
Cancel
Save