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

add '-T/--terminate' command-line option (#1399)

This commit is contained in:
Mike Fährmann 2021-06-05 04:00:29 +02:00
parent 6ecb710a7f
commit dfe1e09df0
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 15 additions and 8 deletions

View File

@ -126,6 +126,8 @@ def main():
config.set((), "postprocessors", args.postprocessors) config.set((), "postprocessors", args.postprocessors)
if args.abort: if args.abort:
config.set((), "skip", "abort:" + str(args.abort)) config.set((), "skip", "abort:" + str(args.abort))
if args.terminate:
config.set((), "skip", "terminate:" + str(args.terminate))
for opts in args.options: for opts in args.options:
config.set(*opts) config.set(*opts)

View File

@ -203,13 +203,6 @@ def build_parser():
help=("Maximum number of retries for failed HTTP requests " help=("Maximum number of retries for failed HTTP requests "
"or -1 for infinite retries (default: 4)"), "or -1 for infinite retries (default: 4)"),
) )
downloader.add_argument(
"-A", "--abort",
dest="abort", metavar="N", type=int,
help=("Abort extractor run after N consecutive file downloads have "
"been skipped, e.g. if files with the same filename already "
"exist"),
)
downloader.add_argument( downloader.add_argument(
"--http-timeout", "--http-timeout",
dest="timeout", metavar="SECONDS", type=float, action=ConfigAction, dest="timeout", metavar="SECONDS", type=float, action=ConfigAction,
@ -301,7 +294,19 @@ def build_parser():
"--download-archive", "--download-archive",
dest="archive", metavar="FILE", action=ConfigAction, dest="archive", metavar="FILE", action=ConfigAction,
help=("Record all downloaded files in the archive file and " help=("Record all downloaded files in the archive file and "
"skip downloading any file already in it."), "skip downloading any file already in it"),
)
selection.add_argument(
"-A", "--abort",
dest="abort", metavar="N", type=int,
help=("Stop current extractor run "
"after N consecutive file downloads were skipped"),
)
selection.add_argument(
"-T", "--terminate",
dest="terminate", metavar="N", type=int,
help=("Stop current and parent extractor runs "
"after N consecutive file downloads were skipped"),
) )
selection.add_argument( selection.add_argument(
"--range", "--range",