|
|
@ -173,28 +173,6 @@ def build_parser():
|
|
|
|
action="version", version=version.__version__,
|
|
|
|
action="version", version=version.__version__,
|
|
|
|
help="Print program version and exit",
|
|
|
|
help="Print program version and exit",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if util.EXECUTABLE:
|
|
|
|
|
|
|
|
general.add_argument(
|
|
|
|
|
|
|
|
"-U", "--update",
|
|
|
|
|
|
|
|
dest="update", action="store_const", const="latest",
|
|
|
|
|
|
|
|
help="Update to the latest version",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
general.add_argument(
|
|
|
|
|
|
|
|
"--update-to",
|
|
|
|
|
|
|
|
dest="update", metavar="[CHANNEL@]TAG",
|
|
|
|
|
|
|
|
help="Upgrade/downgrade to a specific version",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
general.add_argument(
|
|
|
|
|
|
|
|
"--update-check",
|
|
|
|
|
|
|
|
dest="update", action="store_const", const="check",
|
|
|
|
|
|
|
|
help="Check if a newer version is available",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
general.add_argument(
|
|
|
|
|
|
|
|
"-U", "--update-check",
|
|
|
|
|
|
|
|
dest="update", action="store_const", const="check",
|
|
|
|
|
|
|
|
help="Check if a newer version is available",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
general.add_argument(
|
|
|
|
general.add_argument(
|
|
|
|
"-f", "--filename",
|
|
|
|
"-f", "--filename",
|
|
|
|
dest="filename", metavar="FORMAT",
|
|
|
|
dest="filename", metavar="FORMAT",
|
|
|
@ -216,16 +194,6 @@ def build_parser():
|
|
|
|
dest="extractor_sources", metavar="PATH", action="append",
|
|
|
|
dest="extractor_sources", metavar="PATH", action="append",
|
|
|
|
help="Load external extractors from PATH",
|
|
|
|
help="Load external extractors from PATH",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
general.add_argument(
|
|
|
|
|
|
|
|
"--proxy",
|
|
|
|
|
|
|
|
dest="proxy", metavar="URL", action=ConfigAction,
|
|
|
|
|
|
|
|
help="Use the specified proxy",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
general.add_argument(
|
|
|
|
|
|
|
|
"--source-address",
|
|
|
|
|
|
|
|
dest="source-address", metavar="IP", action=ConfigAction,
|
|
|
|
|
|
|
|
help="Client-side IP address to bind to",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
general.add_argument(
|
|
|
|
general.add_argument(
|
|
|
|
"--user-agent",
|
|
|
|
"--user-agent",
|
|
|
|
dest="user-agent", metavar="UA", action=ConfigAction,
|
|
|
|
dest="user-agent", metavar="UA", action=ConfigAction,
|
|
|
@ -238,6 +206,31 @@ def build_parser():
|
|
|
|
"(ALL to delete everything)",
|
|
|
|
"(ALL to delete everything)",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
update = parser.add_argument_group("Update Options")
|
|
|
|
|
|
|
|
if util.EXECUTABLE or 1:
|
|
|
|
|
|
|
|
update.add_argument(
|
|
|
|
|
|
|
|
"-U", "--update",
|
|
|
|
|
|
|
|
dest="update", action="store_const", const="latest",
|
|
|
|
|
|
|
|
help="Update to the latest version",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
update.add_argument(
|
|
|
|
|
|
|
|
"--update-to",
|
|
|
|
|
|
|
|
dest="update", metavar="CHANNEL[@TAG]",
|
|
|
|
|
|
|
|
help=("Switch to a dfferent release channel (stable or dev) "
|
|
|
|
|
|
|
|
"or upgrade/downgrade to a specific version"),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
update.add_argument(
|
|
|
|
|
|
|
|
"--update-check",
|
|
|
|
|
|
|
|
dest="update", action="store_const", const="check",
|
|
|
|
|
|
|
|
help="Check if a newer version is available",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
update.add_argument(
|
|
|
|
|
|
|
|
"-U", "--update-check",
|
|
|
|
|
|
|
|
dest="update", action="store_const", const="check",
|
|
|
|
|
|
|
|
help="Check if a newer version is available",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
input = parser.add_argument_group("Input Options")
|
|
|
|
input = parser.add_argument_group("Input Options")
|
|
|
|
input.add_argument(
|
|
|
|
input.add_argument(
|
|
|
|
"urls",
|
|
|
|
"urls",
|
|
|
@ -353,23 +346,45 @@ def build_parser():
|
|
|
|
help=("Do not emit ANSI color codes in output"),
|
|
|
|
help=("Do not emit ANSI color codes in output"),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
downloader = parser.add_argument_group("Downloader Options")
|
|
|
|
networking = parser.add_argument_group("Networking Options")
|
|
|
|
downloader.add_argument(
|
|
|
|
networking.add_argument(
|
|
|
|
"-r", "--limit-rate",
|
|
|
|
|
|
|
|
dest="rate", metavar="RATE", action=ConfigAction,
|
|
|
|
|
|
|
|
help="Maximum download rate (e.g. 500k or 2.5M)",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
downloader.add_argument(
|
|
|
|
|
|
|
|
"-R", "--retries",
|
|
|
|
"-R", "--retries",
|
|
|
|
dest="retries", metavar="N", type=int, action=ConfigAction,
|
|
|
|
dest="retries", metavar="N", type=int, action=ConfigAction,
|
|
|
|
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(
|
|
|
|
networking.add_argument(
|
|
|
|
"--http-timeout",
|
|
|
|
"--http-timeout",
|
|
|
|
dest="timeout", metavar="SECONDS", type=float, action=ConfigAction,
|
|
|
|
dest="timeout", metavar="SECONDS", type=float, action=ConfigAction,
|
|
|
|
help="Timeout for HTTP connections (default: 30.0)",
|
|
|
|
help="Timeout for HTTP connections (default: 30.0)",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
networking.add_argument(
|
|
|
|
|
|
|
|
"--proxy",
|
|
|
|
|
|
|
|
dest="proxy", metavar="URL", action=ConfigAction,
|
|
|
|
|
|
|
|
help="Use the specified proxy",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
networking.add_argument(
|
|
|
|
|
|
|
|
"--source-address",
|
|
|
|
|
|
|
|
dest="source-address", metavar="IP", action=ConfigAction,
|
|
|
|
|
|
|
|
help="Client-side IP address to bind to",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
networking.add_argument(
|
|
|
|
|
|
|
|
"--no-check-certificate",
|
|
|
|
|
|
|
|
dest="verify", nargs=0, action=ConfigConstAction, const=False,
|
|
|
|
|
|
|
|
help="Disable HTTPS certificate validation",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
downloader = parser.add_argument_group("Downloader Options")
|
|
|
|
|
|
|
|
downloader.add_argument(
|
|
|
|
|
|
|
|
"-r", "--limit-rate",
|
|
|
|
|
|
|
|
dest="rate", metavar="RATE", action=ConfigAction,
|
|
|
|
|
|
|
|
help="Maximum download rate (e.g. 500k or 2.5M)",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
downloader.add_argument(
|
|
|
|
|
|
|
|
"--chunk-size",
|
|
|
|
|
|
|
|
dest="chunk-size", metavar="SIZE", action=ConfigAction,
|
|
|
|
|
|
|
|
help="Size of in-memory data chunks (default: 32k)",
|
|
|
|
|
|
|
|
)
|
|
|
|
downloader.add_argument(
|
|
|
|
downloader.add_argument(
|
|
|
|
"--sleep",
|
|
|
|
"--sleep",
|
|
|
|
dest="sleep", metavar="SECONDS", action=ConfigAction,
|
|
|
|
dest="sleep", metavar="SECONDS", action=ConfigAction,
|
|
|
@ -389,21 +404,6 @@ def build_parser():
|
|
|
|
help=("Number of seconds to wait before starting data extraction "
|
|
|
|
help=("Number of seconds to wait before starting data extraction "
|
|
|
|
"for an input URL"),
|
|
|
|
"for an input URL"),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
downloader.add_argument(
|
|
|
|
|
|
|
|
"--filesize-min",
|
|
|
|
|
|
|
|
dest="filesize-min", metavar="SIZE", action=ConfigAction,
|
|
|
|
|
|
|
|
help="Do not download files smaller than SIZE (e.g. 500k or 2.5M)",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
downloader.add_argument(
|
|
|
|
|
|
|
|
"--filesize-max",
|
|
|
|
|
|
|
|
dest="filesize-max", metavar="SIZE", action=ConfigAction,
|
|
|
|
|
|
|
|
help="Do not download files larger than SIZE (e.g. 500k or 2.5M)",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
downloader.add_argument(
|
|
|
|
|
|
|
|
"--chunk-size",
|
|
|
|
|
|
|
|
dest="chunk-size", metavar="SIZE", action=ConfigAction,
|
|
|
|
|
|
|
|
help="Size of in-memory data chunks (default: 32k)",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
downloader.add_argument(
|
|
|
|
downloader.add_argument(
|
|
|
|
"--no-part",
|
|
|
|
"--no-part",
|
|
|
|
dest="part", nargs=0, action=ConfigConstAction, const=False,
|
|
|
|
dest="part", nargs=0, action=ConfigConstAction, const=False,
|
|
|
@ -425,16 +425,6 @@ def build_parser():
|
|
|
|
dest="download", nargs=0, action=ConfigConstAction, const=False,
|
|
|
|
dest="download", nargs=0, action=ConfigConstAction, const=False,
|
|
|
|
help=("Do not download any files")
|
|
|
|
help=("Do not download any files")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
downloader.add_argument(
|
|
|
|
|
|
|
|
"--no-postprocessors",
|
|
|
|
|
|
|
|
dest="postprocess", nargs=0, action=ConfigConstAction, const=False,
|
|
|
|
|
|
|
|
help=("Do not run any post processors")
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
downloader.add_argument(
|
|
|
|
|
|
|
|
"--no-check-certificate",
|
|
|
|
|
|
|
|
dest="verify", nargs=0, action=ConfigConstAction, const=False,
|
|
|
|
|
|
|
|
help="Disable HTTPS certificate validation",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
configuration = parser.add_argument_group("Configuration Options")
|
|
|
|
configuration = parser.add_argument_group("Configuration Options")
|
|
|
|
configuration.add_argument(
|
|
|
|
configuration.add_argument(
|
|
|
@ -525,12 +515,6 @@ def build_parser():
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
selection = parser.add_argument_group("Selection Options")
|
|
|
|
selection = parser.add_argument_group("Selection Options")
|
|
|
|
selection.add_argument(
|
|
|
|
|
|
|
|
"--download-archive",
|
|
|
|
|
|
|
|
dest="archive", metavar="FILE", action=ConfigAction,
|
|
|
|
|
|
|
|
help=("Record all downloaded or skipped files in FILE and "
|
|
|
|
|
|
|
|
"skip downloading any file already in it"),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
selection.add_argument(
|
|
|
|
selection.add_argument(
|
|
|
|
"-A", "--abort",
|
|
|
|
"-A", "--abort",
|
|
|
|
dest="abort", metavar="N", type=int,
|
|
|
|
dest="abort", metavar="N", type=int,
|
|
|
@ -543,6 +527,22 @@ def build_parser():
|
|
|
|
help=("Stop current and parent extractor runs "
|
|
|
|
help=("Stop current and parent extractor runs "
|
|
|
|
"after N consecutive file downloads were skipped"),
|
|
|
|
"after N consecutive file downloads were skipped"),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
selection.add_argument(
|
|
|
|
|
|
|
|
"--filesize-min",
|
|
|
|
|
|
|
|
dest="filesize-min", metavar="SIZE", action=ConfigAction,
|
|
|
|
|
|
|
|
help="Do not download files smaller than SIZE (e.g. 500k or 2.5M)",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
selection.add_argument(
|
|
|
|
|
|
|
|
"--filesize-max",
|
|
|
|
|
|
|
|
dest="filesize-max", metavar="SIZE", action=ConfigAction,
|
|
|
|
|
|
|
|
help="Do not download files larger than SIZE (e.g. 500k or 2.5M)",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
selection.add_argument(
|
|
|
|
|
|
|
|
"--download-archive",
|
|
|
|
|
|
|
|
dest="archive", metavar="FILE", action=ConfigAction,
|
|
|
|
|
|
|
|
help=("Record all downloaded or skipped files in FILE and "
|
|
|
|
|
|
|
|
"skip downloading any file already in it"),
|
|
|
|
|
|
|
|
)
|
|
|
|
selection.add_argument(
|
|
|
|
selection.add_argument(
|
|
|
|
"--range",
|
|
|
|
"--range",
|
|
|
|
dest="image-range", metavar="RANGE", action=ConfigAction,
|
|
|
|
dest="image-range", metavar="RANGE", action=ConfigAction,
|
|
|
@ -583,6 +583,11 @@ def build_parser():
|
|
|
|
dest="postprocessors", metavar="NAME", action="append", default=[],
|
|
|
|
dest="postprocessors", metavar="NAME", action="append", default=[],
|
|
|
|
help="Activate the specified post processor",
|
|
|
|
help="Activate the specified post processor",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
postprocessor.add_argument(
|
|
|
|
|
|
|
|
"--no-postprocessors",
|
|
|
|
|
|
|
|
dest="postprocess", nargs=0, action=ConfigConstAction, const=False,
|
|
|
|
|
|
|
|
help=("Do not run any post processors")
|
|
|
|
|
|
|
|
)
|
|
|
|
postprocessor.add_argument(
|
|
|
|
postprocessor.add_argument(
|
|
|
|
"-O", "--postprocessor-option",
|
|
|
|
"-O", "--postprocessor-option",
|
|
|
|
dest="options_pp", metavar="KEY=VALUE",
|
|
|
|
dest="options_pp", metavar="KEY=VALUE",
|
|
|
|