From f7620cebc3cac043986e09f99a9593e9e4c7508f Mon Sep 17 00:00:00 2001 From: Kyle Sanderson Date: Sun, 27 Aug 2023 19:45:14 -0700 Subject: [PATCH] escape network paths properly using python --- jellyfin_kodi/helper/api.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jellyfin_kodi/helper/api.py b/jellyfin_kodi/helper/api.py index ea8e9ee9..79e67409 100644 --- a/jellyfin_kodi/helper/api.py +++ b/jellyfin_kodi/helper/api.py @@ -4,6 +4,8 @@ from __future__ import division, absolute_import, print_function, unicode_litera ################################################################################################## from . import settings, LazyLogger +from urllib.parse import quote as urlquote +import re ################################################################################################## @@ -213,6 +215,11 @@ class API(object): protocol = path.split('://')[0] path = path.replace(protocol, protocol.lower()) + if path.startswith('http') or path.startswith('ftp') or path.startswith('sftp'): + rs = re.search("(.*?://.+?/)(.+)", path) + if rs: + path = rs.group(1) + urlquote(rs.group(2)) + return path def get_user_artwork(self, user_id):