aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/utils.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-11-07 01:16:33 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-11-07 02:18:30 +0530
commitdb4678e448d6e7da9743f4028c94b540fcafc528 (patch)
treea4878669354f77248567eef6c3cd45318659320d /yt_dlp/utils.py
parenta349d4d6415e9aa0fb11c674e405d57fa13cc7fd (diff)
downloadhypervideo-pre-db4678e448d6e7da9743f4028c94b540fcafc528.tar.lz
hypervideo-pre-db4678e448d6e7da9743f4028c94b540fcafc528.tar.xz
hypervideo-pre-db4678e448d6e7da9743f4028c94b540fcafc528.zip
Update to ytdl-commit-de39d128
[extractor/ceskatelevize] Back-port extractor from yt-dlp https://github.com/ytdl-org/youtube-dl/commit/de39d1281cea499cb1adfce5ff7e0a56f1bad5fe Closes #5361, Closes #4634, Closes #5210
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r--yt_dlp/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py
index 1532d22ac..4d1247eea 100644
--- a/yt_dlp/utils.py
+++ b/yt_dlp/utils.py
@@ -685,7 +685,8 @@ def sanitize_filename(s, restricted=False, is_id=NO_DEFAULT):
return '\0_'
return char
- if restricted and is_id is NO_DEFAULT:
+ # Replace look-alike Unicode glyphs
+ if restricted and (is_id is NO_DEFAULT or not is_id):
s = unicodedata.normalize('NFKC', s)
s = re.sub(r'[0-9]+(?::[0-9]+)+', lambda m: m.group(0).replace(':', '_'), s) # Handle timestamps
result = ''.join(map(replace_insane, s))