From 7a1b58912d16e181cef750493d4510f8bea40e97 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 12 May 2021 19:59:56 +0200 Subject: Fix mangadex download --- plugins/lhtranslation.py | 6 +++--- plugins/mangadex.py | 9 +++++---- plugins/mangakatana.py | 6 +++--- plugins/manganelo.py | 6 +++--- plugins/manganelos.py | 6 +++--- plugins/mangaplus.py | 6 +++--- plugins/mangatown.py | 6 +++--- plugins/mangawindow.py | 6 +++--- plugins/readm.py | 6 +++--- 9 files changed, 29 insertions(+), 28 deletions(-) diff --git a/plugins/lhtranslation.py b/plugins/lhtranslation.py index 082b865..4416e94 100755 --- a/plugins/lhtranslation.py +++ b/plugins/lhtranslation.py @@ -54,9 +54,9 @@ def list_chapters(url, chapter_list_input): seen_urls = set() for item in chapter_list_input: - url = item.get("url") - if url and len(url) > 0: - seen_urls.add(url) + chapter_url = item.get("url") + if chapter_url and len(chapter_url) > 0: + seen_urls.add(chapter_url) tree = etree.HTML(response.text) chapters = [] diff --git a/plugins/mangadex.py b/plugins/mangadex.py index 04bc800..2eeeaa5 100755 --- a/plugins/mangadex.py +++ b/plugins/mangadex.py @@ -57,6 +57,7 @@ def sort_chapters(chapter): return chapter["chapter"] def list_chapters(url, chapter_list_input): + manga_id = url seen_titles = set() seen_chapter_numbers = set() for item in chapter_list_input: @@ -69,9 +70,9 @@ def list_chapters(url, chapter_list_input): seen_urls = set() for item in chapter_list_input: - url = item.get("url") - if url and len(url) > 0: - seen_urls.add(url) + chapter_url = item.get("url") + if chapter_url and len(chapter_url) > 0: + seen_urls.add(chapter_url) lang = "en" @@ -79,7 +80,7 @@ def list_chapters(url, chapter_list_input): prev_chapter_number = "" chapters = [] while True: - url = "https://api.mangadex.org/chapter?manga=" + url + "&limit=100&offset=%d&order[publishAt]=desc" % (i * 100) + url = "https://api.mangadex.org/manga/" + manga_id + "/feed?&limit=100&offset=%d&locales[]=%s&order[chapter]=desc" % (i * 100, lang) response = requests.get(url, headers=headers) response.raise_for_status() diff --git a/plugins/mangakatana.py b/plugins/mangakatana.py index e90d916..f4db8cf 100755 --- a/plugins/mangakatana.py +++ b/plugins/mangakatana.py @@ -58,9 +58,9 @@ def list_chapters(url, chapter_list_input): seen_urls = set() for item in chapter_list_input: - url = item.get("url") - if url and len(url) > 0: - seen_urls.add(url) + chapter_url = item.get("url") + if chapter_url and len(chapter_url) > 0: + seen_urls.add(chapter_url) tree = etree.HTML(response.text) chapters = [] diff --git a/plugins/manganelo.py b/plugins/manganelo.py index 57eb0cc..b742995 100755 --- a/plugins/manganelo.py +++ b/plugins/manganelo.py @@ -68,9 +68,9 @@ def list_chapters(url, chapter_list_input): seen_urls = set() for item in chapter_list_input: - url = item.get("url") - if url and len(url) > 0: - seen_urls.add(url.replace("mangakakalot", "manganelo")) + chapter_url = item.get("url") + if chapter_url and len(chapter_url) > 0: + seen_urls.add(chapter_url.replace("mangakakalot", "manganelo")) tree = etree.HTML(response.text) chapters = [] diff --git a/plugins/manganelos.py b/plugins/manganelos.py index 54c2625..37d615a 100755 --- a/plugins/manganelos.py +++ b/plugins/manganelos.py @@ -60,9 +60,9 @@ def list_chapters(url, chapter_list_input): seen_urls = set() for item in chapter_list_input: - url = item.get("url") - if url and len(url) > 0: - seen_urls.add(url) + chapter_url = item.get("url") + if chapter_url and len(chapter_url) > 0: + seen_urls.add(chapter_url) tree = etree.HTML(response.text) chapters = [] diff --git a/plugins/mangaplus.py b/plugins/mangaplus.py index 0d87ddc..9409989 100755 --- a/plugins/mangaplus.py +++ b/plugins/mangaplus.py @@ -223,9 +223,9 @@ def list_chapters(url, chapter_list_input): seen_urls = set() for item in chapter_list_input: - url = item.get("url") - if url and len(url) > 0: - seen_urls.add(url) + chapter_url = item.get("url") + if chapter_url and len(chapter_url) > 0: + seen_urls.add(chapter_url) resp_data = resp.success.title_detail all_chapters = [] diff --git a/plugins/mangatown.py b/plugins/mangatown.py index 1a7eae9..87a1173 100755 --- a/plugins/mangatown.py +++ b/plugins/mangatown.py @@ -60,9 +60,9 @@ def list_chapters(url, chapter_list_input): seen_urls = set() for item in chapter_list_input: - url = item.get("url") - if url and len(url) > 0: - seen_urls.add(url) + chapter_url = item.get("url") + if chapter_url and len(chapter_url) > 0: + seen_urls.add(chapter_url) tree = etree.HTML(response.text) chapters = [] diff --git a/plugins/mangawindow.py b/plugins/mangawindow.py index 3a8c30f..2ff950e 100755 --- a/plugins/mangawindow.py +++ b/plugins/mangawindow.py @@ -55,9 +55,9 @@ def list_chapters(url, chapter_list_input): seen_urls = set() for item in chapter_list_input: - url = item.get("url") - if url and len(url) > 0: - seen_urls.add(url) + chapter_url = item.get("url") + if chapter_url and len(chapter_url) > 0: + seen_urls.add(chapter_url) tree = etree.HTML(response.text) chapters = [] diff --git a/plugins/readm.py b/plugins/readm.py index 74ae43c..8b8d024 100755 --- a/plugins/readm.py +++ b/plugins/readm.py @@ -60,9 +60,9 @@ def list_chapters(url, chapter_list_input): seen_urls = set() for item in chapter_list_input: - url = item.get("url") - if url and len(url) > 0: - seen_urls.add(url) + chapter_url = item.get("url") + if chapter_url and len(chapter_url) > 0: + seen_urls.add(chapter_url) tree = etree.HTML(response.text) chapters = [] -- cgit v1.2.3