Skip to main content

Youtube Music

warning

Communication with YT Music is unofficial and not supported or endorsed by Google. This means that this integration may stop working at any time if Google decides to change how YT Music works in the browser.

Scrobble Troubleshooting

Due to monitoring being unofficial, listening history from YTM can be inconsistent and can cause missed scrobbles.

See the FAQ for a detailed explanation, how to see more details about MS's detection of tracks, and how to properly report an issue.

Authentication

Only one of these methods needs to be used.

Use instructions from

to get the Cookie value from a browser.

It is highly recommended to get the cookie from an Incognito/Private Session to limit the chance the session is invalidated from normal browsing.

Add the cookie to your ytmusic.json config in data or as an ENV:

    {
"type": "ytmusic",
"enable": true,
"name": "MyYTM",
"data": {
"cookie": "__Secure-1PSIDTS=sidts-CjEB3EgAEvCd-......"
},
"options": {
"logAuthUpdateChanges": true,
"logDiff": true
}
}

If MS gives you authentication errors (session invalidated) at some point in the future follow the same instructions to get new cookies.

Configuration

Configuration Type

This is configuration for the ENV Config Type.

Environmental VariableTypeDefaultDescription
YTM_IDstringA globally unique ID EX myComponentId
YTM_NAMEstringValue of YTM_IDA vanity name EX My Cool Component
YTM_ENABLEbooleantrueShould this component be used?
YTM_REDIRECT_URIstringGoogle Cloud Console project OAuth Client Authorized redirect URI
YTM_CLIENT_IDstringGoogle Cloud Console project OAuth Client ID
YTM_CLIENT_SECRETstringGoogle Cloud Console project OAuth Client Secret
YTM_COOKIEstringThe cookie retrieved from the Request Headers of music.youtube.com after logging in.

Bold/Italic = Required