md-y/mangadex-full-api

Can't find chapter with ID even though it exists

Closed this issue · 2 comments

So I'm trying to get info for the chapter with id: 1201238
Here's a link to the chapter on mangadex: https://mangadex.org/chapter/1201238

With the below code I get an error:

let client = api.agent.login(args.username, args.password, false);
let chapter = client.then(async () => {
    return api.Chapter.get(1201238);
});

The error looks like this:

(node:41724) UnhandledPromiseRejectionWarning: API Object (/v2/chapter/1201238) not found or the mangadex.org domain is unavailable. (Status code 404)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:41724) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:41724) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Investigating a bit further I can see that the library uses this link: https://api.mangadex.org/v2/chapter/1201238
Which returns:

{
  "code": 404,
  "status": "error",
  "message": "Chapter not found."
}

While the actual chapter on mangadex uses: https://mangadex.org/api/v2/chapter/1201238

{
  "code": 200,
  "status": "OK",
  "data": {
    <snip>
  }
}

But oddly the library works for 1194683 just fine, very confusing.

md-y commented

According to the devs it's a caching issue on Mangadex's side of things that is also affecting Tachiyomi and other programs trying to get recent chapters. Waiting until it gets resolved seems to be the only real solution.

I don't know why the reader is using the old link (https://mangadex.org/api/v2/) that is deprecated and slated for removal, but I won't be updating to use it since the new link (should) be fixed soon. Regardless, after a while that chapter should become available as the issue seems to only affect recent chapters.

Ah, that's great thanks.
I should've thought to look on the forums 🤦