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 clientinfo
|
||||||
import utils
|
import utils
|
||||||
import downloadutils
|
import downloadutils
|
||||||
import requests
|
|
||||||
from PlexFunctions import PlexToKodiTimefactor, PMSHttpsEnabled
|
from PlexFunctions import PlexToKodiTimefactor, PMSHttpsEnabled
|
||||||
import embydb_functions as embydb
|
import embydb_functions as embydb
|
||||||
|
|
||||||
|
@ -1238,9 +1237,9 @@ class API():
|
||||||
if res is not None:
|
if res is not None:
|
||||||
try:
|
try:
|
||||||
res = unquote(res).decode('utf-8')
|
res = unquote(res).decode('utf-8')
|
||||||
except UnicodeEncodeError:
|
except UnicodeDecodeError:
|
||||||
# Sometimes, unquote seems to return unicode, not string
|
# Sometimes, Plex seems to have encoded in latin1
|
||||||
res = unquote(res)
|
res = unquote(res).decode('latin1')
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def getTVShowPath(self):
|
def getTVShowPath(self):
|
||||||
|
|
Loading…
Reference in a new issue