Fix UnicodeDecodeError with file paths on sync
- Plex sometimes seems to encode in latin1 instead of utf-8. What the heck?!? - Fixes #20
This commit is contained in:
parent
496aa2593a
commit
47409e1535
1 changed files with 3 additions and 4 deletions
|
@ -46,7 +46,6 @@ import xbmcvfs
|
|||
import clientinfo
|
||||
import utils
|
||||
import downloadutils
|
||||
import requests
|
||||
from PlexFunctions import PlexToKodiTimefactor, PMSHttpsEnabled
|
||||
import embydb_functions as embydb
|
||||
|
||||
|
@ -1238,9 +1237,9 @@ class API():
|
|||
if res is not None:
|
||||
try:
|
||||
res = unquote(res).decode('utf-8')
|
||||
except UnicodeEncodeError:
|
||||
# Sometimes, unquote seems to return unicode, not string
|
||||
res = unquote(res)
|
||||
except UnicodeDecodeError:
|
||||
# Sometimes, Plex seems to have encoded in latin1
|
||||
res = unquote(res).decode('latin1')
|
||||
return res
|
||||
|
||||
def getTVShowPath(self):
|
||||
|
|
Loading…
Reference in a new issue