|
|
|
@ -29,7 +29,11 @@ class BooruExtractor(BaseExtractor):
|
|
|
|
|
|
|
|
|
|
url_key = self.config("url")
|
|
|
|
|
if url_key:
|
|
|
|
|
self._file_url = operator.itemgetter(url_key)
|
|
|
|
|
if isinstance(url_key, (list, tuple)):
|
|
|
|
|
self._file_url = self._file_url_list
|
|
|
|
|
self._file_url_keys = url_key
|
|
|
|
|
else:
|
|
|
|
|
self._file_url = operator.itemgetter(url_key)
|
|
|
|
|
|
|
|
|
|
for post in self.posts():
|
|
|
|
|
try:
|
|
|
|
@ -74,6 +78,11 @@ class BooruExtractor(BaseExtractor):
|
|
|
|
|
|
|
|
|
|
_file_url = operator.itemgetter("file_url")
|
|
|
|
|
|
|
|
|
|
def _file_url_list(self, post):
|
|
|
|
|
urls = (post[key] for key in self._file_url_keys if post.get(key))
|
|
|
|
|
post["_fallback"] = it = iter(urls)
|
|
|
|
|
return next(it)
|
|
|
|
|
|
|
|
|
|
def _prepare(self, post):
|
|
|
|
|
"""Prepare a 'post's metadata"""
|
|
|
|
|
|
|
|
|
|