aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/cache.py
diff options
context:
space:
mode:
authordirkf <fieldhouse@gmx.net>2025-04-07 16:02:10 +0100
committerdirkf <fieldhouse@gmx.net>2025-04-08 01:59:00 +0100
commit570b8680780eba23d9e991eff99983af499f7ff0 (patch)
treead22c425e32636547bfdb38993e0e944df3072da /youtube_dl/cache.py
parent2190e892603d238e1a1fc40477bf30d131c22acc (diff)
[cache] Use `esc_rfc3986` to encode cache key
Diffstat (limited to 'youtube_dl/cache.py')
-rw-r--r--youtube_dl/cache.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/youtube_dl/cache.py b/youtube_dl/cache.py
index 6169461b9..54c24b7e4 100644
--- a/youtube_dl/cache.py
+++ b/youtube_dl/cache.py
@@ -12,10 +12,10 @@ from .compat import (
compat_getenv,
compat_open as open,
compat_os_makedirs,
- compat_urllib_parse,
)
from .utils import (
error_to_compat_str,
+ escape_rfc3986,
expand_path,
is_outdated_version,
traverse_obj,
@@ -55,8 +55,7 @@ class Cache(object):
def _get_cache_fn(self, section, key, dtype):
assert re.match(r'^[\w.-]+$', section), \
'invalid section %r' % section
- key = compat_urllib_parse.quote(
- key, safe='').replace('%', ',') # encode non-ascii characters
+ key = escape_rfc3986(key, safe='').replace('%', ',') # encode non-ascii characters
return os.path.join(
self._get_root_dir(), section, '%s.%s' % (key, dtype))