Fix parsing utf8 data from tvdb and tvrage

This commit is contained in:
adam 2014-11-09 00:49:53 +08:00
parent bd723abc9f
commit af1c16c4da
3 changed files with 5 additions and 5 deletions

View file

@ -68,6 +68,7 @@
* Fix progress sort direction for poster layout view on home page * Fix progress sort direction for poster layout view on home page
* Fix invalid use of str() in the Send2Trash library for platforms other * Fix invalid use of str() in the Send2Trash library for platforms other
* Fix dropdown confirm dialogs for restart and shutdown * Fix dropdown confirm dialogs for restart and shutdown
* Fix parsing utf8 data from tvdb and tvrage
### 0.2.1 (2014-10-22 06:41:00 UTC) ### 0.2.1 (2014-10-22 06:41:00 UTC)

View file

@ -619,10 +619,9 @@ class Tvdb:
raise tvdb_error("Bad zip file received from thetvdb.com, could not read it") raise tvdb_error("Bad zip file received from thetvdb.com, could not read it")
else: else:
try: try:
return xmltodict.parse(resp.content.strip().encode('utf-8'), postprocessor=process)
except:
return xmltodict.parse(resp.content.strip(), postprocessor=process) return xmltodict.parse(resp.content.strip(), postprocessor=process)
except:
return dict([(u'data', None)])
def _getetsrc(self, url, params=None, language=None): def _getetsrc(self, url, params=None, language=None):
"""Loads a URL using caching, returns an ElementTree of the source """Loads a URL using caching, returns an ElementTree of the source

View file

@ -479,9 +479,9 @@ class TVRage:
if resp.ok: if resp.ok:
try: try:
return xmltodict.parse(resp.content.strip().encode('utf-8'), postprocessor=remap_keys)
except:
return xmltodict.parse(resp.content.strip(), postprocessor=remap_keys) return xmltodict.parse(resp.content.strip(), postprocessor=remap_keys)
except:
return dict([(u'data', None)])
def _getetsrc(self, url, params=None): def _getetsrc(self, url, params=None):
"""Loads a URL using caching, returns an ElementTree of the source """Loads a URL using caching, returns an ElementTree of the source