diff --git a/gallery_dl/__init__.py b/gallery_dl/__init__.py index 8154afc7..be60a603 100644 --- a/gallery_dl/__init__.py +++ b/gallery_dl/__init__.py @@ -126,6 +126,8 @@ def main(): config.set((), "postprocessors", args.postprocessors) if args.abort: config.set((), "skip", "abort:" + str(args.abort)) + if args.terminate: + config.set((), "skip", "terminate:" + str(args.terminate)) for opts in args.options: config.set(*opts) diff --git a/gallery_dl/option.py b/gallery_dl/option.py index 52a9e697..2e5ff758 100644 --- a/gallery_dl/option.py +++ b/gallery_dl/option.py @@ -203,13 +203,6 @@ def build_parser(): help=("Maximum number of retries for failed HTTP requests " "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( "--http-timeout", dest="timeout", metavar="SECONDS", type=float, action=ConfigAction, @@ -301,7 +294,19 @@ def build_parser(): "--download-archive", dest="archive", metavar="FILE", action=ConfigAction, 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( "--range",