Added an additional channel for downloading the metadata of an entire post or gallery.

This commit is contained in:
Gio
2019-12-09 00:56:27 -06:00
parent f451be48c3
commit cfc70a97ab
5 changed files with 42 additions and 0 deletions

View File

@@ -97,6 +97,12 @@ class Job():
self.update_kwdict(kwds)
self.handle_urllist(urls, kwds)
elif msg[0] == Message.Metadata:
_, url, kwds = msg
if self.pred_url(url, kwds):
self.update_kwdict(kwds)
self.handle_url(url, kwds)
elif msg[0] == Message.Version:
if msg[1] != 1:
raise "unsupported message-version ({}, {})".format(
@@ -188,6 +194,10 @@ class DownloadJob(Job):
for pp in postprocessors:
pp.prepare(pathfmt)
if kwdict.get("metadata_only"):
self.handle_skip()
return
if pathfmt.exists(archive):
self.handle_skip()
return