question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
LuanRTcommented, 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.

0reactions
github-actions[bot]commented, Aug 14, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get comments from videos using YouTube API v3 and ...
Im using this code import os import pickle import google.oauth2.credentials from googleapiclient.discovery import build from ...
Read more >
get_comments_number() | Function
Retrieves the amount of comments a post has.
Read more >
Handle and return errors from your custom function
In this article. Detect and throw an error; The CustomFunctions.Error object; Use try...catch blocks; Next steps; See also.
Read more >
Post & interact with comments - Computer - YouTube Help
If a video's owner has turned on comments, you can post comments and like, dislike, or reply to other people's comments on a...
Read more >
How to Get More Comments on Instagram - 8 Hacks!
First, when people scroll past your post in their Instagram feed, they'll see a higher number of comments on the post – including...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found