From 06cbf5f9c4d3e2c4c759355c3880f8e68fda7eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 7 Jan 2019 18:22:33 +0100 Subject: [PATCH] implement 'chapter-reverse' option (#149) Setting it to `true` will start with the latest chapter instead of the first one. --- docs/configuration.rst | 12 ++++++++++++ gallery_dl/extractor/common.py | 3 +++ 2 files changed, 15 insertions(+) diff --git a/docs/configuration.rst b/docs/configuration.rst index f5e188cd..13c8999b 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -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 ================== diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py index fde7aaf2..51234222 100644 --- a/gallery_dl/extractor/common.py +++ b/gallery_dl/extractor/common.py @@ -248,6 +248,9 @@ class MangaExtractor(Extractor): 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