remove 'Message.Metadata' (#866)

pull/1331/head
Mike Fährmann 4 years ago
parent 1d145a6186
commit 56a8968435
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2015-2018 Mike Fährmann
# Copyright 2015-2021 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
@ -52,4 +52,4 @@ class Message():
# Cookies = 5
Queue = 6
# Urllist = 7
Metadata = 8
# Metadata = 8

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2019-2020 Mike Fährmann
# Copyright 2019-2021 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
@ -38,8 +38,6 @@ class PatreonExtractor(Extractor):
hashes = set()
yield Message.Directory, post
yield Message.Metadata, post
for kind, url, name in itertools.chain(
self._images(post),
self._attachments(post),

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2015-2020 Mike Fährmann
# Copyright 2015-2021 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
@ -111,10 +111,6 @@ class Job():
if self.pred_queue(url, kwds):
self.handle_queue(url, kwds)
elif msg[0] == Message.Metadata:
self.update_kwdict(msg[1])
self.handle_metadata(msg[1])
elif msg[0] == Message.Version:
if msg[1] != 1:
raise "unsupported message-version ({}, {})".format(
@ -128,9 +124,6 @@ class Job():
def handle_directory(self, kwdict):
"""Handle Message.Directory"""
def handle_metadata(self, kwdict):
"""Handle Message.Metadata"""
def handle_queue(self, url, kwdict):
"""Handle Message.Queue"""
@ -280,15 +273,6 @@ class DownloadJob(Job):
for callback in self.hooks["post"]:
callback(self.pathfmt)
def handle_metadata(self, kwdict):
"""Run postprocessors with metadata from 'kwdict'"""
if "metadata" in self.hooks:
kwdict["extension"] = "metadata"
pathfmt = self.pathfmt
pathfmt.set_filename(kwdict)
for callback in self.hooks["metadata"]:
callback(pathfmt)
def handle_queue(self, url, kwdict):
if url in self.visited:
return
@ -624,8 +608,5 @@ class DataJob(Job):
def handle_directory(self, kwdict):
self.data.append((Message.Directory, self.filter(kwdict)))
def handle_metadata(self, kwdict):
self.data.append((Message.Metadata, self.filter(kwdict)))
def handle_queue(self, url, kwdict):
self.data.append((Message.Queue, url, self.filter(kwdict)))

Loading…
Cancel
Save