mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-07-06 13:01:50 -07:00
[cache] Use esc_rfc3986
to encode cache key
This commit is contained in:
parent
97740ca964
commit
9e151f3553
1 changed files with 2 additions and 3 deletions
|
@ -12,10 +12,10 @@ from .compat import (
|
||||||
compat_getenv,
|
compat_getenv,
|
||||||
compat_open as open,
|
compat_open as open,
|
||||||
compat_os_makedirs,
|
compat_os_makedirs,
|
||||||
compat_urllib_parse,
|
|
||||||
)
|
)
|
||||||
from .utils import (
|
from .utils import (
|
||||||
error_to_compat_str,
|
error_to_compat_str,
|
||||||
|
escape_rfc3986,
|
||||||
expand_path,
|
expand_path,
|
||||||
is_outdated_version,
|
is_outdated_version,
|
||||||
traverse_obj,
|
traverse_obj,
|
||||||
|
@ -55,8 +55,7 @@ class Cache(object):
|
||||||
def _get_cache_fn(self, section, key, dtype):
|
def _get_cache_fn(self, section, key, dtype):
|
||||||
assert re.match(r'^[\w.-]+$', section), \
|
assert re.match(r'^[\w.-]+$', section), \
|
||||||
'invalid section %r' % section
|
'invalid section %r' % section
|
||||||
key = compat_urllib_parse.quote(
|
key = escape_rfc3986(key, safe='').replace('%', ',') # encode non-ascii characters
|
||||||
key, safe='').replace('%', ',') # encode non-ascii characters
|
|
||||||
return os.path.join(
|
return os.path.join(
|
||||||
self._get_root_dir(), section, '%s.%s' % (key, dtype))
|
self._get_root_dir(), section, '%s.%s' % (key, dtype))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue