From c0dd922c1344999ae86b768aae89e60f16f6bd28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 1 Feb 2018 22:00:44 +0100 Subject: [PATCH] add '--download-archive' cmdline option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … as well as a config file equivalent --- docs/configuration.rst | 15 +++++++++++++++ docs/gallery-dl.conf | 1 + gallery_dl/option.py | 6 ++++++ 3 files changed, 22 insertions(+) diff --git a/docs/configuration.rst b/docs/configuration.rst index 7befd998..5eaea443 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -344,6 +344,20 @@ Description User-Agent header value to be used for HTTP requests. =========== ===== +extractor.*.archive +------------------- +=========== ===== +Type ``string`` +Default ``null`` +Description File to store IDs of downloaded files in. Downloads of files + already recorded in this archive file will be skipped_. + + The resulting archive file is not a plain text file but an SQLite3 + database, as lookup operations are significantly faster when the + amount of stored IDs gets reasonably large. +=========== ===== + + Extractor-specific Options ========================== @@ -779,6 +793,7 @@ How To - login and visit Tumblr's Applications_ section .. |datetime.max| replace:: ``datetime.max`` .. |strptime| replace:: strftime() and strptime() Behavior +.. _skipped: `extractor.*.skip`_ .. _`date-min and date-max`: `extractor.reddit.date-min & .date-max`_ .. _date-format: extractor.reddit.date-format_ diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index f0a7baff..22f7276d 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -16,6 +16,7 @@ }, "extractor": { + "archive": null, "skip": true, "sleep": 0, diff --git a/gallery_dl/option.py b/gallery_dl/option.py index 3379ca75..b464a28a 100644 --- a/gallery_dl/option.py +++ b/gallery_dl/option.py @@ -206,6 +206,12 @@ def build_parser(): ) selection = parser.add_argument_group("Selection Options") + selection.add_argument( + "--download-archive", + metavar="FILE", dest="archive", action=ConfigAction, + help=("Record all downloaded files in the archive file and " + "skip downloading any file already in it.") + ) selection.add_argument( "--range", metavar="RANGE", dest="image_range",