add 'download' option (#220)

This commit is contained in:
Mike Fährmann
2019-07-13 21:49:26 +02:00
parent fe7805de7c
commit 62097284fe
3 changed files with 24 additions and 0 deletions

View File

@@ -307,7 +307,10 @@ class DownloadJob(Job):
self.pathfmt = util.PathFormat(self.extractor)
if keywords:
self.pathfmt.set_directory(keywords)
self.sleep = self.extractor.config("sleep")
if not self.extractor.config("download", True):
self.download = lambda x: True
skip = self.extractor.config("skip", True)
if skip:

View File

@@ -205,6 +205,11 @@ def build_parser():
help=("Do not set file modification times according to "
"Last-Modified HTTP response headers")
)
downloader.add_argument(
"--no-download",
dest="download", nargs=0, action=ConfigConstAction, const=False,
help=("Do not download any files")
)
downloader.add_argument(
"--no-check-certificate",
dest="verify", nargs=0, action=ConfigConstAction, const=False,