]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/utils.py
[outtmpl] Alternate form of format type `l` for `\n` delimited list
[yt-dlp.git] / yt_dlp / utils.py
index 770d7feb9c75a9a3cee49bf2cec0e79bd69bf7af..eba89fb8bc3473781eda308154464d57dc5e96f8 100644 (file)
@@ -2099,7 +2099,9 @@ def sanitize_filename(s, restricted=False, is_id=False):
     def replace_insane(char):
         if restricted and char in ACCENT_CHARS:
             return ACCENT_CHARS[char]
-        if char == '?' or ord(char) < 32 or ord(char) == 127:
+        elif not restricted and char == '\n':
+            return ' '
+        elif char == '?' or ord(char) < 32 or ord(char) == 127:
             return ''
         elif char == '"':
             return '' if restricted else '\''