YouTube Music Provider
Music Assistant has support for Youtube Music. Contributed and maintained by MarvinSchenkel
DISCLAIMER
Please note that Youtube does not offer an official API to retrieve data and streams. This means that everything is built on a best-effort basis. Unexpected behavior will occur whilst using this provider. For this reason if you have another streaming provider you may find it more convenient to use that instead of this one.
Note
Free accounts are NOT supported.
Features
The highest available stream from Youtube Music will be selected for playback (similar to configuring 'high' in the web-app). This then gets re-encoded by MA to a lossless FLAC.
Configuration
As of Nov 2024, Google has removed OAuth authentication from YT Music. This means using this (somewhat cumbersome) method of cookie authentication is the only way to get YT Music working.
Note
Cookies will expire after some time. This means that you will have to run this process again if YT Music stops working and you see 401: Unauthorized
in your logs.
Obtaining the Cookies
- Open YT Music in your browser.
-
Open the developer tools via View -> Developer -> Developer Tools. Note that this might be named differently based on your browser. It should open a window similar to this:
-
Navigate to the 'Network' tab
- In the filter bar, type "/browse"
- Now navigate to a page in YT Music that requires authentication, for example, on of your library playlists
- A request will show-up in the table:
- Click the request and make sure you are on the 'Headers' tab
- Find the section called 'Request Headers'
- Find the item named 'Cookie' and copy the value. It is VERY important that you copy the exact value. Double check that you do not include any additional spaces or characters at the start/end of the value
Configuring the provider
- Navigate to 'Settings'
- Under Music Providers, click 'Add new', select 'Youtube Music'
- For username, just use your gmail address or use a brand account (see brand account)
- For cookie, paste the value you obtained above.
- Click 'Save'
Using brand accounts
A brand account is a sub-account that lives under your main Google account. You need to find your brand account id if you want to login using your brand account.
- Go to https://myaccount.google.com/
- From the top right menu, select your brand account
- Look at the URL and copy the 21-digit number
- Use this number in the 'Username' field when setting up the provider
Known Issues / Notes
- This provider mimics YouTube Music. Do not expect to see the same search results as you see if using YouTube
- There is no support for the disc and track number in album tracks listings. Currently, the disc number is always 0 and the track number is the order number in which the tracks were returned by Youtube Music. This should generally give the desired result, but could mess up multi-disc albums
- Whether music videos are selected for playback fully depends on what you are playing. If you have saved a specific album in your library, then that exact version will show up in MA and thus you will have the album version. However, if you start a radio on, for example, a playlist, then Youtube Music decides which songs will be played in a 'dynamic radio' playlist which could include videos
- Uploaded Music should be able to be found when it is in a playlist. If it's just a single track being searched for then it may not be found, since often those uploaded songs don't have proper metadata. It will be hard to find them via the UI in MA
- Some low quality artwork can be expected when using this provider. YTM is very inconsistent when it comes to delivering thumbnails. When a Playlist or album is retrieved, the thumbs for the tracks are usually in low quality for all songs. However, when a single track is played the HQ version should be displayed. This provider tries to work around the problem for albums and playlists by loading details for the next enqueued track, but some low quality album art is still expected to be encountered
- By default, only the liked music and 'episodes for later' playlists are added to the YTM library and thus will appear in MA. In order to see other personal playlists in the MA library, you have to go into the YT Music web app and add those personal playlists to your library