-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Youtube Music Desktop API has changed #5401
Comments
An example .http request/response transaction for the new flow is this: # @name requestCode
POST http://127.0.0.1:9863/api/v1/auth/requestcode
Content-Type: application/json
{
"appId": "ohmyposh",
"appName": "Oh-My-Posh",
"appVersion": "0.0.1"
}
###
# @name request
POST http://127.0.0.1:9863/api/v1/auth/request
Content-Type: application/json
{
"appId": "ohmyposh",
"code": "{{requestCode.response.body.code}}"
}
###
GET http://127.0.0.1:9863/api/v1/state
Accept: application/json
Authorization: {{request.response.body.token}} This is in .http format, as per the There is user interaction to approve as part of this flow.
The state response is now far more complex as well - it gives the full playlist. To find the currently playing track, you need to reference {
"player": {
"videoProgress": nn.nnnn // video/song progress in seconds
"queue": {
"items": [ {
"selected": true,
"title": "[Trackname]",
"duration": "m:ss" // length, in text format
} ]
}
}
} To add to the complexity, there's also a rate-limit of once per 5 seconds, with a recommended state getter via Socket.IO... |
I'm continuing to poke at this in my spare time - I think I might be able to build up a test suite similar to that provided for the |
I don't mind. This is on my list somewhere in September anyways. But beware as #5414 might affect this due to changes in how we cache things. So, only focus on getting it working and ignore the caching inside the segment as that will be removed anyways. |
ahh, this is why i couldn't get the segment working from the docs! |
Apologies, I've not had chance to look at this - other things have taken my time. I'm hoping to look at it (if you're not, Jan) in the next week or so. --- Quick edit: And I've been sick, so even less chance! |
Code of Conduct
What happened?
I installed YouTube Music Desktop and expected to be able to enable the "ytm" endpoint. Sadly, this did not appear. It looks like some time late in 2023, there was a new version of the API - documented here - which does not support the
/query
endpoint that was previously used.The endpoint now requires authorisation, with a key/prompt/response process (App sends a key, YTM displays a prompt, returns a token for future use).
I will attempt, when I have time, to build some integration into this myself, but I wanted an issue on the board in-case someone else was aware of this.
Theme
My own
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output
The text was updated successfully, but these errors were encountered: