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

This commit is contained in:
Mike Fährmann
2020-07-24 17:50:32 +02:00
parent 336e682a7a
commit 493cadb1e7
2 changed files with 18 additions and 2 deletions

View File

@@ -89,7 +89,7 @@ Description A `format string`_ to build the resulting filename
image image
Note: Even if the value of the ``extension`` key is missing or Note: Even if the value of the ``extension`` key is missing or
``None``, it will filled in later when the file download is ``None``, it will be filled in later when the file download is
starting. This key is therefore always available to provide starting. This key is therefore always available to provide
a valid filename extension. a valid filename extension.
=========== ===== =========== =====
@@ -873,6 +873,18 @@ Description Controls whether to choose the GIF or MP4 version of an animation.
=========== ===== =========== =====
extractor.inkbunny.orderby
--------------------------
=========== =====
Type ``string``
Default ``"create_datetime"``
Description Value of the ``orderby`` parameter for submission searches.
(See `API#Search <https://wiki.inkbunny.net/wiki/API#Search>`__
for details)
=========== =====
extractor.instagram.highlights extractor.instagram.highlights
------------------------------ ------------------------------
=========== ===== =========== =====

View File

@@ -128,10 +128,14 @@ class InkbunnyUserExtractor(InkbunnyExtractor):
InkbunnyExtractor.__init__(self, match) InkbunnyExtractor.__init__(self, match)
def posts(self): def posts(self):
orderby = self.config("orderby")
params = { params = {
"username": self.user, "username": self.user,
"scraps": self.scraps, "scraps" : self.scraps,
"orderby" : orderby,
} }
if orderby and orderby.startswith("unread_"):
params["unread_submissions"] = "yes"
return self.api.search(params) return self.api.search(params)