mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
add 'download' option (#220)
This commit is contained in:
parent
fe7805de7c
commit
62097284fe
@ -334,6 +334,22 @@ Description Controls whether to verify SSL/TLS certificates for HTTPS requests.
|
||||
=========== =====
|
||||
|
||||
|
||||
extractor.*.download
|
||||
--------------------
|
||||
=========== =====
|
||||
Type ``bool``
|
||||
Default ``true``
|
||||
Description Controls whether to download media files.
|
||||
|
||||
Setting this to ``false`` won't download any files, but all other
|
||||
functions (postprocessors_, `download archive`_, etc.)
|
||||
will be executed as normal.
|
||||
=========== =====
|
||||
|
||||
.. _postprocessors: `extractor.*.postprocessors`_
|
||||
.. _download archive: `extractor.*.archive`_
|
||||
|
||||
|
||||
extractor.*.image-range
|
||||
-----------------------
|
||||
=========== =====
|
||||
|
@ -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:
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user