From 62e8a46d9555551e5aea32b832fde16504d3074f Mon Sep 17 00:00:00 2001 From: Omelette Du Fromage Date: Tue, 28 Nov 2023 19:32:17 -0500 Subject: [PATCH] escape uri of path in get_file_path for http, https, ftp, ftps, dav, davs This change aims to import a working path into Kodi if the network shared path is using http, https, ftp, ftps, dav or davs protocol. --- jellyfin_kodi/helper/api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jellyfin_kodi/helper/api.py b/jellyfin_kodi/helper/api.py index ea8e9ee9..c3d5f2a9 100644 --- a/jellyfin_kodi/helper/api.py +++ b/jellyfin_kodi/helper/api.py @@ -3,6 +3,8 @@ from __future__ import division, absolute_import, print_function, unicode_litera ################################################################################################## +from requests.utils import requote_uri + from . import settings, LazyLogger ################################################################################################## @@ -212,6 +214,9 @@ class API(object): if '://' in path: protocol = path.split('://')[0] path = path.replace(protocol, protocol.lower()) + + if protocol.lower() in ("http", "https", "ftp", "ftps", "dav", "davs"): + path = requote_uri(path) return path