1.4.2-d.3: JSON.parse error on getting new instance
See original GitHub issueExpected Behavior
Create new instace of Innertube without any error
Current Behavior
Got error, while parsing json in SessionBuilder
Failure Information (for bugs)
Logs:
2022-05-19T04:08:15.593234+00:00 app[worker.1]: undefined:1
2022-05-19T04:08:15.593235+00:00 app[worker.1]: undefined
2022-05-19T04:08:15.593236+00:00 app[worker.1]: ^
2022-05-19T04:08:15.593236+00:00 app[worker.1]:
2022-05-19T04:08:15.593237+00:00 app[worker.1]: SyntaxError: Unexpected token u in JSON at position 0
2022-05-19T04:08:15.593237+00:00 app[worker.1]: at JSON.parse (<anonymous>)
2022-05-19T04:08:15.593238+00:00 app[worker.1]: at SessionBuilder.#getYtConfig (/app/node_modules/youtubei.js/lib/core/SessionBuilder.js:79:17)
2022-05-19T04:08:15.593241+00:00 app[worker.1]: at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-05-19T04:08:15.593241+00:00 app[worker.1]: at async Promise.all (index 0)
2022-05-19T04:08:15.593242+00:00 app[worker.1]: at async SessionBuilder.build (/app/node_modules/youtubei.js/lib/core/SessionBuilder.js:25:18)
2022-05-19T04:08:15.593244+00:00 app[worker.1]: at async Innertube.#init (/app/node_modules/youtubei.js/lib/Innertube.js:47:21)
2022-05-19T04:08:15.593244+00:00 app[worker.1]: at async file:///app/build/src/skills/youtube.js:19:28
2022-05-19T04:08:15.618562+00:00 app[worker.1]: error Command failed with exit code 1.
Steps to Reproduce
I trying to do this
private _client
constructor() {
super()
;(async () => {
this._client = await new Innertube()
})()
}
Failure Logs
Please include any relevant log snippets or files here.
Checklist
- I am running the latest version
- I checked the documentation and found no answer
- I checked to make sure that this issue has not already been filed
- I have provided sufficient information
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
JSON.parse() parses a string as JSON. This string has to be valid JSON and will throw this error if incorrect syntax was encountered....
Read more >JSON.parse() not working
Your JsonObject seems is a Json Object. The reasons why you can't parse Json from a String: the String is surround by "...
Read more >What Is JSON and How to Handle an “Unexpected Token” ...
Learn what JSON is and how you can deal with errors occurring when parsing JSON data, such as "Unexpected Token < in JSON...
Read more >pandas.read_json — pandas 1.5.2 documentation
Convert a JSON string to pandas object. Parameters. path_or_bufa valid JSON str, path object or file-like object. Any valid string path is acceptable....
Read more >How to fix Unexpected Token in JSON error (for ... - YouTube
Not a programmer? Read this! ** - If you get this error in an app you didn't make, and/or you're not a web...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It seems like we can obtain api key from
https://www.youtube.com/sw.js_dataAnd then fetch additional info fromhttps://www.youtube.com/youtubei/v1/notification_registration/set_registration?key={key}&prettyPrint=falseif needed.I checked from heroku, this endpoints are available
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.