Skip to content

Commit

Permalink
Update for the latest MangaDex API
Browse files Browse the repository at this point in the history
  • Loading branch information
doroshenko committed Sep 14, 2021
1 parent 2bd20dc commit cabe04c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mangadex-dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ def dl(manga_id, lang_code, zip_up, ds):
while offset < total: # if more than 500 chapters!
r = requests.get("https://api.mangadex.org/manga/{}/feed?order[chapter]=asc&order[volume]=asc&limit=500&translatedLanguage[]={}&offset={}".format(uuid, lang_code, offset))
chaps = r.json()
for chapter in chaps["results"]:
chap_num = chapter["data"]["attributes"]["chapter"]
chap_uuid = chapter["data"]["id"]
for chapter in chaps["data"]:
chap_num = chapter["attributes"]["chapter"]
chap_uuid = chapter["id"]
chap_list.append(("Oneshot", chap_uuid) if chap_num == None else (chap_num, chap_uuid))
offset += 500
chap_list.sort(key=float_conversion) # sort numerically by chapter #
Expand Down Expand Up @@ -183,7 +183,7 @@ def dl(manga_id, lang_code, zip_up, ds):

# get group names & make combined name
group_uuids = []
for entry in chapter["relationships"]:
for entry in chapter["data"]["relationships"]:
if entry["type"] == "scanlation_group":
group_uuids.append(entry["id"])

Expand Down

0 comments on commit cabe04c

Please sign in to comment.