Skip to content

Commit

Permalink
[mangadex] handle manga pages without chapters
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jan 3, 2019
1 parent 0afa913 commit a303efb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gallery_dl/extractor/mangadex.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# Copyright 2018 Mike Fährmann
# Copyright 2018-2019 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
Expand Down Expand Up @@ -114,7 +114,7 @@ class MangadexMangaExtractor(MangadexExtractor):
r"/(?:title|manga)/(\d+)"]
test = [
("https://mangadex.org/manga/2946/souten-no-koumori", {
"count": ">= 1",
"pattern": r"https://mangadex.org/chapter/\d+",
"keywords": {
"manga": "Souten no Koumori",
"manga_id": 2946,
Expand All @@ -132,6 +132,9 @@ class MangadexMangaExtractor(MangadexExtractor):
("https://mangadex.org/manga/13318/dagashi-kashi/chapters/2/", {
"count": ">= 100",
}),
("https://mangadex.org/title/13004/yorumori-no-kuni-no-sora-ni", {
"count": 0,
}),
("https://mangadex.org/title/2946/souten-no-koumori", None),
]

Expand All @@ -148,6 +151,8 @@ def items(self):
def chapters(self):
"""Return a sorted list of chapter-metadata dicts"""
data = self.manga_data(self.manga_id)
if "chapter" not in data:
return ()
manga = data["manga"]

results = []
Expand Down

0 comments on commit a303efb

Please sign in to comment.