1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 04:02:32 +01:00

replace '\f' in --filename arguments with form feed character

to make it easier to use special type format strings on command-line

(#2396)
This commit is contained in:
Mike Fährmann 2022-04-28 21:54:05 +02:00
parent 61afa973b7
commit 9e6c981388
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -116,9 +116,12 @@ def main():
if args.yamlfiles:
config.load(args.yamlfiles, strict=True, fmt="yaml")
if args.filename:
if args.filename == "/O":
args.filename = "{filename}.{extension}"
config.set((), "filename", args.filename)
filename = args.filename
if filename == "/O":
filename = "{filename}.{extension}"
elif filename.startswith("\\f"):
filename = "\f" + filename[2:]
config.set((), "filename", filename)
if args.directory:
config.set((), "base-directory", args.directory)
config.set((), "directory", ())