Skip to content

Commit

Permalink
MangaDex deprecation: Fast Edition™
Browse files Browse the repository at this point in the history
  • Loading branch information
Proxymiity committed Sep 13, 2021
1 parent 7ba3e48 commit 5d64067
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions MangaDexPy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ def get_chapters(self, ids: List[str], includes: list = None) -> List[Chapter]:
time.sleep(self.rate_limit)
if req.status_code == 200:
resp = req.json()
chapters += [x for x in resp["results"]]
chapters += [x for x in resp["data"]]
elif req.status_code == 204:
pass
else:
raise APIError(req)
if not sub or not chapters:
raise NoResultsError()
return [Chapter(x["data"], self) for x in chapters]
return [Chapter(x, self) for x in chapters]

def get_manga_chapters(self, mg: Manga, params: dict = None, includes: list = None) -> List[Chapter]:
"""Gets chapters associated with a specific Manga."""
Expand Down Expand Up @@ -291,7 +291,7 @@ def _retrieve_pages(self, url: str, obj: Type[Union[Manga, Chapter, Group, Autho
req = self.session.get(url, params=p)
if req.status_code == 200:
resp = req.json()
data += [x for x in resp["results"]]
data += [x for x in resp["data"]]
elif req.status_code == 204:
pass
else:
Expand All @@ -307,4 +307,4 @@ def _retrieve_pages(self, url: str, obj: Type[Union[Manga, Chapter, Group, Autho
time.sleep(self.rate_limit)
if not data:
raise NoResultsError()
return [obj(x["data"], self) for x in data]
return [obj(x, self) for x in data]

0 comments on commit 5d64067

Please sign in to comment.