1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-03 23:43:21 -04:00

Option --windows-filenames to force use of windows compatible filenames

* Also changed `--trim-file-name` to `--trim-filenames` to be similar to related options

Related: https://web.archive.org/web/20210217190806/https://old.reddit.com/r/youtubedl/comments/llc4o5/do_you_guys_also_have_this_error

:ci skip dl
This commit is contained in:
pukkandan
2021-02-18 00:39:38 +05:30
parent 55e36f035c
commit c2934512c2
5 changed files with 37 additions and 20 deletions

View File

@@ -878,8 +878,20 @@ def parseOpts(overrideArguments=None):
help='Restrict filenames to only ASCII characters, and avoid "&" and spaces in filenames')
filesystem.add_option(
'--no-restrict-filenames',
action='store_false', dest='restrictfilenames', default=False,
action='store_false', dest='restrictfilenames',
help='Allow Unicode characters, "&" and spaces in filenames (default)')
filesystem.add_option(
'--windows-filenames',
action='store_true', dest='windowsfilenames', default=False,
help='Force filenames to be windows compatible')
filesystem.add_option(
'--no-windows-filenames',
action='store_false', dest='windowsfilenames',
help='Make filenames windows compatible only if using windows (default)')
filesystem.add_option(
'--trim-filenames', '--trim-file-names', metavar='LENGTH',
dest='trim_file_name', default=0, type=int,
help='Limit the filename length (excluding extension) to the specified number of characters')
filesystem.add_option(
'-A', '--auto-number',
action='store_true', dest='autonumber', default=False,
@@ -992,10 +1004,6 @@ def parseOpts(overrideArguments=None):
'--rm-cache-dir',
action='store_true', dest='rm_cachedir',
help='Delete all filesystem cache files')
filesystem.add_option(
'--trim-file-name', metavar='LENGTH',
dest='trim_file_name', default=0, type=int,
help='Limit the filename length (extension excluded)')
thumbnail = optparse.OptionGroup(parser, 'Thumbnail Images')
thumbnail.add_option(