enable '--chapter-filter'

The same filter infrastructure that can be applied to image URLS now
also works for manga chapters and other delegated URLs.

TODO: actually provide any metadata (currently supported is only
deviantart and imagefap).
This commit is contained in:
Mike Fährmann
2017-09-12 16:19:00 +02:00
parent 31cd5b1c1d
commit 0dedbe759c
11 changed files with 43 additions and 27 deletions

View File

@@ -44,8 +44,9 @@ class DeviantartExtractor(Extractor):
def items(self):
yield Message.Version, 1
for deviation in self.deviations():
if isinstance(deviation, str):
yield Message.Queue, deviation
if isinstance(deviation, tuple):
url, data = deviation
yield Message.Queue, url, data
continue
self.prepare(deviation)
@@ -159,7 +160,7 @@ class DeviantartExtractor(Extractor):
def _folder_urls(self, folders, category):
url = "https://{}.deviantart.com/{}/0/".format(self.user, category)
return [url + folder["name"] for folder in folders]
return [(url + folder["name"], folder) for folder in folders]
class DeviantartGalleryExtractor(DeviantartExtractor):