YouTube (Music) has undergone multiple changes that eventually broke the plugins. The most significant changes are:
- Playback. When YT detects direct mass downloads from their site, it will flag the originating IP address. When you try to play from a flagged IP address, you will need to provide a Proof of Origin Token in the streaming URL. This token is generated by satisfying a botguard challenge that is performed when you visit the YT site. The idea is that if you use an external program to download from YT, you won’t have this token and thus get a HTTP 403 error.
- Authentication. Previously, we have been able to sign in through a Device Code. This method obtains OAuth credentials that are used in outgoing requests - e.g. when browsing content. However, YT has now limited the OAuth credentials to YouTube TV requests only. When you browse content, you are not making TV but web requests, and so the requests get blocked with HTTP 400 Invalid Request error.
I have updated both YT and YT Music plugins to deal with the above issues:
- Playback. With aid of amazing projects like BgUtils, the plugins now utilize PO tokens. However, I have not been hit by the 403 playback error myself, so this needs to be tested by those who have.
- Authentication. SInce linking by Device Code no longer works, the plugins now use cookies instead. I have only just implemented this, so its reliability needs to be tested further.
Both YT and YT Music plugins are currently at v2.1.0. So why aren’t they showing up in Volumio? As some have noticed, they are being developed under the bookworm
branch, which is the next OS version to be based upon by Volumio – and more importantly one that runs Node v20.x. As you might know, the YT plugins are based on a customized version of the YouTube.js library. A major customization is to make the library work in a Node v14 environment. But as YouTube.js and other dependencies advance to newer Node versions, it has become difficult and tedious for me to sort things out just to make things work in an environment that’s running an outdated Node version.
So this is the current state of things. Hopefully won’t be too long before the release of Bookworm-based Volumio. And hopefully before that, YouTube doesn’t go about making breaking changes again.