add '--items' option

this allows to specify which manga-chapters/comic-issues to download
when using gallery-dl on a manga/comic URL
This commit is contained in:
Mike Fährmann
2017-02-20 22:02:49 +01:00
parent 96baea0959
commit 2a32b12043
3 changed files with 61 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2015, 2016 Mike Fährmann
# Copyright 2015-2017 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -8,7 +8,7 @@
import json
import hashlib
from . import extractor, downloader, path, output, exception
from . import extractor, downloader, config, util, path, output, exception
from .extractor.message import Message
@@ -81,6 +81,9 @@ class DownloadJob(Job):
def run(self):
Job.run(self)
if self.queue:
itemspec = config.get(("items",))
if itemspec:
self.queue = util.apply_range(self.queue, str(itemspec))
for url in self.queue:
try:
DownloadJob(url).run()