1
0
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:
Mike Fährmann 2019-07-13 21:49:26 +02:00
parent fe7805de7c
commit 62097284fe
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
3 changed files with 24 additions and 0 deletions

View File

@ -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
-----------------------
=========== =====

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,