Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zoro: only the first episode request is successful #653

Open
shibotto opened this issue Feb 8, 2025 · 8 comments
Open

zoro: only the first episode request is successful #653

shibotto opened this issue Feb 8, 2025 · 8 comments
Labels
bug Something isn't working

Comments

@shibotto
Copy link

shibotto commented Feb 8, 2025

Describe the bug

When querying anime/zoro/watch/ only the first request successfully returns the video and subtitles links. Every other requests returns empty arrays and requires restarting the service.

Steps to reproduce

  1. Request one episode of whatever anime: SUCCESS
  2. Request the same episode again: SUCCESS
  3. Request another episode from the same or from any other anime: FAIL

Restart the service and the same issue occurs: the first request succeeds, every other requests fails.

Expected behavior

Being able to do as many query without having to restart the service.

Actual behavior

Client side:

xubuntu@xubuntu:~$ curl -s 'http://localhost:3000/anime/zoro/watch/rezero-starting-life-in-another-world-season-3-19301$episode$128356$both' | jq
{
  "intro": {
    "start": 0,
    "end": 0
  },
  "outro": {
    "start": 5191,
    "end": 5430
  },
  "sources": [
    {
      "url": "https://ec.netmagcdn.com:2228/hls-playback/629f2848647dbc16b0cd986eb7ccc447fb9a84765ff86358d59769e8fe9013707b89c1b729f681c52676f1504a5539c945538d387105caed81f236c24605efb5bcd837f93d31d8bbc0b44243c741b57c77a8526f801a95c4d44d9cb590ac144cadb2566c2f6fbc9bb981fe8faa0ef965c7a978241083e385ae61711dd7382603a7a622fbf649c4d4b4a4fdb80021195c/master.m3u8",
      "isM3U8": true,
      "type": "hls"
    }
  ],
  "subtitles": [
    {
      "url": "https://s.megastatics.com/subtitle/a218aaf588c99939c550712ca971f5f7/eng-2.vtt",
      "lang": "English"
    },
    {
      "url": "https://s.megastatics.com/subtitle/a218aaf588c99939c550712ca971f5f7/ind-3.vtt",
      "lang": "Indonesian"
    },
    {
      "url": "https://s.megastatics.com/subtitle/a218aaf588c99939c550712ca971f5f7/tha-4.vtt",
      "lang": "Thai"
    },
    {
      "url": "https://s.megastatics.com/thumbnails/ac9f276b021af77c101bc2ac373ff2a4/thumbnails.vtt",
      "lang": "thumbnails"
    }
  ]
}
xubuntu@xubuntu:~$ curl -s 'http://localhost:3000/anime/zoro/watch/rezero-starting-life-in-another-world-season-3-19301$episode$128536$both' | jq
{
  "intro": {
    "start": 0,
    "end": 0
  },
  "outro": {
    "start": 0,
    "end": 0
  },
  "sources": [],
  "subtitles": []
}

Server side:

{"level":30,"time":1739015109694,"pid":7378,"hostname":"xubuntu","reqId":"req-3","req":{"method":"GET","url":"/anime/zoro/watch/rezero-starting-life-in-another-world-season-3-19301$episode$128536$both","hostname":"localhost:3000","remoteAddress":"127.0.0.1","remotePort":59740},"msg":"incoming request"}
Unexpected end of JSON input
{"level":30,"time":1739015110375,"pid":7378,"hostname":"xubuntu","reqId":"req-3","res":{"statusCode":200},"responseTime":680.9204029999673,"msg":"request completed"}

Additional context

Reverting consumet.ts to 47b9a2e fixes the issue. It was probably introduced in either 912691b or ca4360b, although I cannot test the former as the service doesn't start at all for me.

@shibotto shibotto added the bug Something isn't working label Feb 8, 2025
@2004durgesh
Copy link
Contributor

As the author of this PR, I must admit that my changes actually broke the package—until the ca4360b PR was merged. So, I apologize for that.

Now, the Zoro instance of the package correctly logs the sources:

Image

However, as you mentioned, the API doesn't respond correctly:

{"level":30,"time":1739027752940,"pid":16868,"hostname":"DESKTOP-67N7VI9","reqId":"req-q","req":{"method":"GET","url":"/anime/zoro/watch/rezero-starting-life-in-another-world-season-3-19301$episode$128635$both","hostname":"localhost:3000","remoteAddress":"127.0.0.1","remotePort":60643},"msg":"incoming request"}    
Unexpected end of JSON input
{
  intro: { start: 0, end: 0 },
  outro: { start: 0, end: 0 },
  sources: [],
  subtitles: []
}
{"level":30,"time":1739027754427,"pid":16868,"hostname":"DESKTOP-67N7VI9","reqId":"req-q","res":{"statusCode":200},"responseTime":1486.6098999977112,"msg":"request completed"}

Could you also check this using the Node package (consumet.ts)?

@Shikiiii
Copy link

Shikiiii commented Feb 8, 2025

IIRC Aniwatch-api also had the same issue. This is what I could find regarding fixing it.
ghoshRitesh12/aniwatch-api#83 (comment)

@shibotto
Copy link
Author

shibotto commented Feb 9, 2025

Could you also check this using the Node package (consumet.ts)?

You mean by using consumer.ts directly without the api? Unfortunately I know absolutely nothing about JavaScript and TypeScript.

@Toasty360
Copy link
Contributor

I think I changed that method while fixing flixhq. I'll revert it back.

@2004durgesh
Copy link
Contributor

@shibotto fixed as of #650 pls check

@Toasty360
Copy link
Contributor

I'm not sure if it's fixed or not. It's working on localhost but not on vercel.

@2004durgesh
Copy link
Contributor

Works on my vercel instance though

@shibotto
Copy link
Author

@shibotto fixed as of #650 pls check

Yes, looks fixed on my end, thank you very much folks!

@Toasty360 I have never used Vercel, maybe it is caching an old consumet.ts? On Render for example there is a dedicated button to "clear build cache & deploy". If you manage to make it work I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants