mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-11-09 18:06:35 +00:00
escape network paths properly using python
This commit is contained in:
parent
68c49ea4b7
commit
f7620cebc3
1 changed files with 7 additions and 0 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue