Skip to content

Commit

Permalink
implement 'chapter-reverse' option (#149)
Browse files Browse the repository at this point in the history
Setting it to `true` will start with the latest chapter instead of the
first one.
  • Loading branch information
mikf committed Jan 7, 2019
1 parent e95b24f commit 06cbf5f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,18 @@ Description Categorize tags by their respective types
=========== =====


extractor.[manga-extractor].chapter-reverse
-------------------------------------------
=========== =====
Type ``bool``
Default ``false``
Description Reverse the order of chapter URLs extracted from manga pages.

* `true`: Start with the latest chapter
* `false`: Start with the first chapter
=========== =====



Downloader Options
==================
Expand Down
3 changes: 3 additions & 0 deletions gallery_dl/extractor/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ def __init__(self, match, url=None):
Extractor.__init__(self)
self.url = url or self.scheme + "://" + match.group(1)

if self.config("chapter-reverse", False):
self.reverse = not self.reverse

def items(self):
page = self.request(self.url).text

Expand Down

0 comments on commit 06cbf5f

Please sign in to comment.