diff options
-rwxr-xr-x | plugins/mangadex.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/mangadex.py b/plugins/mangadex.py index be0e2ce..238a264 100755 --- a/plugins/mangadex.py +++ b/plugins/mangadex.py @@ -75,6 +75,7 @@ def list_chapters(url, chapter_list_input): tree = etree.HTML(response.text) chapters = [] + prev_chapter_number = None for element in tree.xpath("//div[@data-manga-id='%s']" % manga_id): chapter_lang = element.attrib.get("data-lang") if chapter_lang != lang: @@ -83,6 +84,9 @@ def list_chapters(url, chapter_list_input): chapter_url = "https://mangadex.org/chapter/%s" % chapter_id chapter_title = element.attrib.get("data-title") # optional chapter_number = element.attrib.get("data-chapter") + if prev_chapter_number and chapter_number == prev_chapter_number: + continue + prev_chapter_number = chapter_number chapter_name = "Ch. %s" % chapter_number if chapter_title: chapter_name += " - %s" % chapter_title |