It is well established within the Music Assistant community that YouTube Music integration has presented a number of persistent challenges. The official provider requires Premium credentials and, following Google’s deprecation of OAuth authentication, relies on a somewhat fragile cookie-based setup that additionally necessitates a PO Token Generator add-on. Free-tier accounts remain unsupported entirely.
In light of these constraints, I would like to present an alternative provider — YouTube Music (Free) — which I have developed as an open-source contribution to the Home Assistant ecosystem. The provider is designed around two complementary principles: first, that basic music playback should function without any authentication whatsoever; and second, that users who do wish to access their personal library may optionally authenticate via browser cookies.
Core architecture. The provider leverages ytmusicapi for search and metadata operations alongside yt-dlp with the Android Music client for stream extraction. This particular client configuration does not require PO tokens, login sessions, or Premium subscriptions — the same technique employed by established open-source projects such as NewPipe and SimpMusic.
What works without authentication:
- Search across tracks, albums, artists, and playlists
- Audio streaming (128–256 kbps AAC/Opus)
- Artist discographies and top tracks
- Similar tracks / song radio
- Playlist playback (with yt-dlp fallback for restricted playlists)
What authentication unlocks:
- Library synchronization — liked songs, saved albums, playlists, and a combined view of subscribed and library artists
- Personalized recommendations from the YouTube Music home feed
- Library management — adding and removing items directly from Music Assistant
- Brand account support for users whose YouTube Music libraries reside on a secondary Google account
The authentication mechanism warrants brief elaboration. The provider accepts a browser cookie and constructs a SAPISIDHASH-based authorization header, which ytmusicapi requires for browser-type authentication detection. The implementation ensures graceful degradation: should the cookie expire or prove invalid, the provider falls back to anonymous mode rather than failing outright.
Installation follows the standard pattern for custom MA providers — the files are copied into the Music Assistant container and a companion watcher add-on is provided to automate reinstallation across Home Assistant restarts.
The complete source, documentation, and watcher add-on configuration are available at: GitHub - sproft/music-assistant-ytmusic: Stream YouTube Music without a premium subscription via Music Assistant · GitHub
I welcome any feedback, bug reports, or contributions. It bears noting that this provider interacts with YouTube’s unofficial APIs in a manner that contravenes their Terms of Service, and users should be cognisant of this when choosing to deploy it.