mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-02 17:33:37 +00:00
Change decode html entities returned from tvdb api.
This commit is contained in:
parent
8c85e7a9e3
commit
92fcdaf5df
2 changed files with 7 additions and 0 deletions
|
@ -25,6 +25,8 @@ import re
|
|||
from sickbeard.helpers import getURL, tryInt
|
||||
import sickbeard
|
||||
|
||||
from lib.six.moves.html_parser import HTMLParser
|
||||
|
||||
from lib.dateutil.parser import parse
|
||||
from lib.cachecontrol import CacheControl, caches
|
||||
|
||||
|
@ -737,6 +739,8 @@ class Tvdb:
|
|||
return [self._clean_data(d) for d in data]
|
||||
if isinstance(data, dict):
|
||||
return {k: self._clean_data(v) for k, v in data.iteritems()}
|
||||
if isinstance(data, basestring):
|
||||
return HTMLParser().unescape(data).strip()
|
||||
return data if not isinstance(data, (str, unicode)) else data.strip().replace(u'&', u'&')
|
||||
|
||||
def search(self, series):
|
||||
|
|
|
@ -29,6 +29,7 @@ except ImportError:
|
|||
|
||||
from lib.dateutil.parser import parse
|
||||
from lib.cachecontrol import CacheControl, caches
|
||||
from lib.six.moves.html_parser import HTMLParser
|
||||
|
||||
from lib.etreetodict import ConvertXmlToDict
|
||||
from tvdb_ui import BaseUI, ConsoleUI
|
||||
|
@ -637,6 +638,8 @@ class TvdbV1:
|
|||
- Replaces & with &
|
||||
- Trailing whitespace
|
||||
"""
|
||||
if isinstance(data, basestring):
|
||||
return HTMLParser().unescape(data).strip()
|
||||
return data if not isinstance(data, basestring) else data.strip().replace(u'&', u'&')
|
||||
|
||||
def _get_url_artwork(self, image):
|
||||
|
|
Loading…
Reference in a new issue