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

getComments will throw out an error when the comment count of the video is 0 #95

Closed
4 tasks done
SuiKaSan opened this issue Jul 11, 2022 · 11 comments
Closed
4 tasks done
Labels
bug Something isn't working priority: medium Stale
Milestone

Comments

@SuiKaSan
Copy link

SuiKaSan commented Jul 11, 2022

Steps to reproduce

Example:
1.find a video that with no coment( for example: Ja2H4xHnX-0 )
2.take its video id and invoke getComents function

Failure Logs

(node:17108) UnhandledPromiseRejectionWarning: Error: Expected to find "onResponseReceivedEndpoints" with content "commentRenderer" but got undefined
    at Object.findNode (D:\code\demo\youtubeReptile\node_modules\youtubei.js\lib\utils\Utils.js:39:22)
    at parseComments (D:\code\demo\youtubeReptile\node_modules\youtubei.js\lib\parser\index.js:281:27)
    at Parser.#processComments (D:\code\demo\youtubeReptile\node_modules\youtubei.js\lib\parser\index.js:351:12)
    at Object.COMMENTS (D:\code\demo\youtubeReptile\node_modules\youtubei.js\lib\parser\index.js:33:48)
    at Parser.parse (D:\code\demo\youtubeReptile\node_modules\youtubei.js\lib\parser\index.js:37:22)
    at Innertube.getComments (D:\code\demo\youtubeReptile\node_modules\youtubei.js\lib\Innertube.js:239:8)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:17108) 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:17108) [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.

Expected behavior

return normal response with 0 comment count.

Current behavior

throw out an error when the comment count of the video is 0

Version

Default

Anything else?

No response

Checklist

  • I am running the latest version.
  • I checked the documentation and found no answer.
  • I have searched the existing issues and made sure this is not a duplicate.
  • I have provided sufficient information.
@SuiKaSan SuiKaSan added the bug Something isn't working label Jul 11, 2022
@LuanRT
Copy link
Owner

LuanRT commented Jul 11, 2022

Hey, thanks for your report.
I believe this has already been fixed in the dev version. See #65, you can try it if you have time.

Edit:
And do note that the structure of the response in the dev version is a bit different, but also much better. You can find examples here.

@SuiKaSan
Copy link
Author

Hey, thanks for your report. I believe this has already been fixed in the dev version. See #65, you can try it if you have time.

Edit: And do note that the structure of the response in the dev version is a bit different, but also much better. You can find examples here.

Hey, thanks for your report. I believe this has already been fixed in the dev version. See #65, you can try it if you have time.

Edit: And do note that the structure of the response in the dev version is a bit different, but also much better. You can find examples here.

I changed to the new version. But it didn't work.

@SuiKaSan
Copy link
Author

SuiKaSan commented Jul 12, 2022

image

@SuiKaSan
Copy link
Author

I get into youtubei.js/node_modules and run npm install. The function works fine now.
But when I use getInfo function , another error comes.
image

LuanRT added a commit that referenced this issue Jul 12, 2022
I don't really like the idea of having yet another config file just so we can get all deps from package.json and mark them as external. So let's add them to the build command manually.

#95
@LuanRT
Copy link
Owner

LuanRT commented Jul 12, 2022

image

Sorry about that, I forgot to mark all dependencies as external in the build command. Should be fixed now (d1f2369).

@LuanRT
Copy link
Owner

LuanRT commented Jul 12, 2022

I get into youtubei.js/node_modules and run npm install. The function works fine now. But when I use getInfo function , another error comes. image

It's just a silent error and doesn't crash/change anything in the results, it's there just to tell you that there is something missing and it should be reported. Anyhow, thank you.

@SuiKaSan
Copy link
Author

I use the newest version. The one with your dependencies repaired.
But pops out a new error.
image

@Wykerd Wykerd added this to the v2 milestone Jul 13, 2022
@SuiKaSan
Copy link
Author

@LuanRT Can you please check this problem?

@LuanRT
Copy link
Owner

LuanRT commented Jul 13, 2022

@LuanRT Can you please check this problem?

Hi there, it's likely a network error. I haven't changed anything related to that in the latest commits so it might be something else. You can try using the debug parameter (...Innertube({ debug: true })) and see how far the library is able to make requests.

@SuiKaSan
Copy link
Author

SuiKaSan commented Jul 15, 2022

Problem above is a network problem, sorry about that,
But when I fixed the problem, another bug pops.
I'm pretty sure is not network issue.
I already intall the lastest version.
Can you tell me how to fix it? Thanks. @LuanRT
image

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

3 participants