From 37893bb0c9afdeead29e3707d2dfb67596f03897 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Thu, 23 Dec 2021 09:03:46 +0530 Subject: [outtmpl] Change filename sanitization type to `S` `F` is already used for float! Bug in e0fd95737d1a3c4a2bfb470c5408a396c8545ca5 --- yt_dlp/YoutubeDL.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'yt_dlp/YoutubeDL.py') diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 3bbde9b00..6fcd52b99 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -1006,7 +1006,7 @@ class YoutubeDL(object): def validate_outtmpl(cls, outtmpl): ''' @return None or Exception object ''' outtmpl = re.sub( - STR_FORMAT_RE_TMPL.format('[^)]*', '[ljqBUDF]'), + STR_FORMAT_RE_TMPL.format('[^)]*', '[ljqBUDS]'), lambda mobj: f'{mobj.group(0)[:-1]}s', cls._outtmpl_expandpath(outtmpl)) try: @@ -1048,7 +1048,7 @@ class YoutubeDL(object): } TMPL_DICT = {} - EXTERNAL_FORMAT_RE = re.compile(STR_FORMAT_RE_TMPL.format('[^)]*', f'[{STR_FORMAT_TYPES}ljqBUDF]')) + EXTERNAL_FORMAT_RE = re.compile(STR_FORMAT_RE_TMPL.format('[^)]*', f'[{STR_FORMAT_TYPES}ljqBUDS]')) MATH_FUNCTIONS = { '+': float.__add__, '-': float.__sub__, @@ -1167,7 +1167,7 @@ class YoutubeDL(object): value), str_fmt elif fmt[-1] == 'D': # decimal suffix value, fmt = format_decimal_suffix(value, f'%{fmt[:-1]}f%s' if fmt[:-1] else '%d%s'), 's' - elif fmt[-1] == 'F': # filename sanitization + elif fmt[-1] == 'S': # filename sanitization value, fmt = filename_sanitizer(initial_field, value, restricted='#' in flags), str_fmt elif fmt[-1] == 'c': if value: -- cgit v1.2.3