diff --git a/docs/options.md b/docs/options.md index 67bf3b1c..c339d788 100644 --- a/docs/options.md +++ b/docs/options.md @@ -24,6 +24,10 @@ ('/O' for "original" filenames) -d, --destination PATH Target location for file downloads -D, --directory PATH Exact location for file downloads + --restrict-filenames VALUE Replace restricted filename characters with + underscores. One of 'windows', 'unix', 'ascii', + 'ascii+', or a custom set of characters + --windows-filenames Force filenames to be Windows-compatible -X, --extractors PATH Load external extractors from PATH --clear-cache MODULE Delete cached login sessions, cookies, etc. for MODULE (ALL to delete everything) diff --git a/gallery_dl/option.py b/gallery_dl/option.py index 7adca7eb..08bbe1bc 100644 --- a/gallery_dl/option.py +++ b/gallery_dl/option.py @@ -268,6 +268,19 @@ def build_parser(): dest="directory", metavar="PATH", help="Exact location for file downloads", ) + general.add_argument( + "--restrict-filenames", + dest="path-restrict", metavar="VALUE", action=ConfigAction, + help=("Replace restricted filename characters with underscores. " + "One of 'windows', 'unix', 'ascii', 'ascii+', " + "or a custom set of characters"), + ) + general.add_argument( + "--windows-filenames", + dest="path-restrict", nargs=0, action=ConfigConstAction, + const="windows", + help="Force filenames to be Windows-compatible", + ) general.add_argument( "-X", "--extractors", dest="extractor_sources", metavar="PATH", action="append",