[inkbunny] add 'metadata' option (#283)

This commit is contained in:
Mike Fährmann
2020-07-24 18:05:53 +02:00
parent 493cadb1e7
commit c4ed9f4faa
2 changed files with 14 additions and 0 deletions

View File

@@ -873,6 +873,15 @@ Description Controls whether to choose the GIF or MP4 version of an animation.
=========== =====
extractor.inkbunny.metadata
---------------------------
=========== =====
Type ``bool``
Default ``false``
Description Fetch ``description``, ``writing``, and ``pools`` metadata fields.
=========== =====
extractor.inkbunny.orderby
--------------------------
=========== =====

View File

@@ -171,10 +171,15 @@ class InkbunnyAPI():
def __init__(self, extractor):
self.extractor = extractor
self.session_id = None
self.metadata = extractor.config("metadata")
def detail(self, submission_ids):
"""Get full details about submissions with the given IDs"""
params = {"submission_ids": submission_ids}
if self.metadata:
params["show_description"] = "yes"
params["show_writing"] = "yes"
params["show_pools"] = "yes"
return self._call("submissions", params)["submissions"]
def search(self, params):