1
0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-07-02 20:12:53 -05:00

Update to ytdl-commit-de39d128

[extractor/ceskatelevize] Back-port extractor from yt-dlp
de39d1281c

Closes #5361, Closes #4634, Closes #5210
This commit is contained in:
pukkandan
2022-11-07 01:16:33 +05:30
parent a349d4d641
commit db4678e448
12 changed files with 385 additions and 201 deletions

View File

@ -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))