I have grabbed the SAPISID value from the YTM web app.
After inserting this into client initialisation, I get an error:
SyntaxError: Invalid RegExp: Invalid escape
The error points to a line in your zod-to-json-schema dep.
Update 2:
The regex problem seems to be some sort of React Native incompatibility issue. Please ignore.
Next problem:
this.config.INNERTUBE_API_VERSION is undefined. Leading to API reqs to URLs like: https://music.youtube.com/youtubei/undefined/browse?alt=json&key=undefined
I am grabbing the cookies by checking a 200 req in devtools on the YTM web app, copy/pasting the cookie value directly into this package.
Clearly the cookies are failing to be parsed or to authenticate the reqs, but it's not at all clear to me why.
It seems strange that your documentation offers no explanation as to how cookies should be obtained, as if all users would somehow already know...
Please describe the current behaviour of the code.
-
Please describe the expected behaviour of the code.
-
What are the steps to reproduce the error?
-
Additional Information
Discussions are not enabled on this repo, so I was forced to open an issue. Apologies.
I am just getting started with this SDK and want to authenticate calls based on premium YTM accounts.
The
initialize
method looks like this:How should one generate cookies?
Update:
I have grabbed the
SAPISID
value from the YTM web app.After inserting this into client initialisation, I get an error:
SyntaxError: Invalid RegExp: Invalid escape
The error points to a line in your
zod-to-json-schema
dep.Update 2:
The regex problem seems to be some sort of React Native incompatibility issue. Please ignore.
Next problem:
this.config.INNERTUBE_API_VERSION
isundefined
. Leading to API reqs to URLs like:https://music.youtube.com/youtubei/undefined/browse?alt=json&key=undefined
I am grabbing the cookies by checking a 200 req in devtools on the YTM web app, copy/pasting the cookie value directly into this package.
Clearly the cookies are failing to be parsed or to authenticate the reqs, but it's not at all clear to me why.
It seems strange that your documentation offers no explanation as to how cookies should be obtained, as if all users would somehow already know...