mirror of
https://github.com/mikf/gallery-dl.git
synced 2025-02-01 03:51:42 +01:00
[kemonoparty] add 'order-revisions' option (#5334)
This commit is contained in:
parent
1418c0ce38
commit
03a9ce9832
@ -2346,6 +2346,22 @@ Description
|
||||
Note: This requires 1 additional HTTP request per post.
|
||||
|
||||
|
||||
extractor.kemonoparty.order-revisions
|
||||
-------------------------------------
|
||||
Type
|
||||
``string``
|
||||
Default
|
||||
``"desc"``
|
||||
Description
|
||||
Controls the order in which
|
||||
`revisions <extractor.kemonoparty.revisions_>`__
|
||||
are returned.
|
||||
|
||||
* ``"asc"``: Ascending order (oldest first)
|
||||
* ``"desc"``: Descending order (newest first)
|
||||
* ``"reverse"``: Same as ``"asc"``
|
||||
|
||||
|
||||
extractor.khinsider.format
|
||||
--------------------------
|
||||
Type
|
||||
|
@ -40,6 +40,8 @@ class KemonopartyExtractor(Extractor):
|
||||
def _init(self):
|
||||
self.revisions = self.config("revisions")
|
||||
if self.revisions:
|
||||
order = self.config("order-revisions")
|
||||
self.revisions_reverse = order[0] in ("r", "a") if order else False
|
||||
self.revisions_unique = (self.revisions == "unique")
|
||||
self._prepare_ddosguard_cookies()
|
||||
self._find_inline = re.compile(
|
||||
@ -254,6 +256,9 @@ class KemonopartyExtractor(Extractor):
|
||||
rev["revision_count"] = cnt
|
||||
idx -= 1
|
||||
|
||||
if self.revisions_reverse:
|
||||
revs.reverse()
|
||||
|
||||
return revs
|
||||
|
||||
def _revisions_all(self, url):
|
||||
@ -266,6 +271,9 @@ class KemonopartyExtractor(Extractor):
|
||||
rev["revision_count"] = cnt
|
||||
idx -= 1
|
||||
|
||||
if self.revisions_reverse:
|
||||
revs.reverse()
|
||||
|
||||
return revs
|
||||
|
||||
def _revision_hash(self, revision):
|
||||
|
Loading…
x
Reference in New Issue
Block a user