aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-09-13 21:59:25 +0200
committerdec05eba <dec05eba@protonmail.com>2021-09-13 21:59:25 +0200
commit29d09b45e98eaf4c4659517510f164c5615d7a76 (patch)
tree679697d451da523e60d12a886a9931118a3fac78
parenta28dfef56d2683f05121204415b71d2694f4dc58 (diff)
Fix mangadex chapter listing after mangadex api update
-rwxr-xr-xplugins/mangadex.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/mangadex.py b/plugins/mangadex.py
index 16fa838..f39ceb4 100755
--- a/plugins/mangadex.py
+++ b/plugins/mangadex.py
@@ -89,16 +89,16 @@ def list_chapters(url, chapter_list_input):
break
json_response = response.json()
- results = json_response["results"]
- if len(results) == 0:
- break
- for result_item in results:
- if result_item["result"] != "ok":
- print("Got item with result != ok")
- exit(1)
+ if json_response["result"] != "ok":
+ print("Got result != ok")
+ exit(1)
+
+ data_list = json_response["data"]
+ if len(data_list) == 0:
+ break
- data = result_item["data"]
+ for data in data_list:
id = data["id"]
attributes = data["attributes"]
if attributes["translatedLanguage"] != lang: