Youtube Music - Media Browser

Hi, i guess I don’t really understand the question. What is your use case? What are you trying to due?
In general yes, you can use Chromecasts
Jkw

I think what you are referring to is dynamic speaker groups…? I was hoping to test that last week but didn’t have time. The docs have some info on it, but it isn’t related to this component, just media players in general.

Is anyone having issues since updating HA to the latest version last night?
Tons of errors. I’m rolling back my test ha instance to see if it still works on that.

Yes, I submitted a new token as was accepted but nothing else works now.

Update: all fixed. tried a couple of different cookies and got it to work.
odd that it accepted the first one and did not work

i use this with my sonos speakers. Its takes a very long time to load the songs by the proxy. Does somebody have a solution? In the past it works perfectly!

Could you paste here the contents of the Data field with an explanation? Thanks!!

I tried both with what I think should be in that field as well as with nothing in that field.

WIth text I get an unspecified error, but with no text in that field I get an API error… extra keys not allowed…


Update: I’m trying but I can’t get it to work… or at least I don’t know how to input the playlist into node red…

So… not sure if I am doing something wrong or if it’s just a limitation. Is there a way to get this to seamlessly work across platforms? So If I start listening from my phone or by just telling google to play something it does not show up in this plugin.

Hi, thats not possible.

This integration enables you to select music from ytubemusic, decode and forward the streaming URL to a generic speaker (chromecast is recommended)

… this isn’t a official google part that will interact with e.g. your phone

1 Like

Yea figured that’s the answer… Just do not really understand why. I mean the add-in makes it as if we were playing from the web. An when I physically play from the web I am able to interact with my google display and phone. Just seems odd…

That’s because the device that initiates the stream is still always in control even though the data is going direct from Googles server to the playback device. It’s no different to starting a stream from your PC (in a Chrome browser window) playing to a Google Home and then opening YouTube Music on your phone, the phone won’t have the ability to seamlessly take over the control of that stream. Using the Google Home app you can skip tracks etc, but it isn’t quite the same as what you are asking for.

1 Like

Can’t get my media library to open anymore, yep tried restarting both HA and the host various times.
Could it be a token issue not connecting to my ytube account or more internal related with HA?

update: token must be fine as I re-submitted the integration and said success. Must be a folder permission issue?
Thanks

Could you please check the log? Works still fine here. Did that happen all of the sudden?
Jkw

Looks like a permissions issue, some links will work others not.
The media browser on HA will not open anything for this integration though.

This error originated from a custom integration.

Logger: custom_components.ytube_music_player.media_player
Source: custom_components/ytube_music_player/media_player.py:1802
Integration: yTubeMediaPlayer (documentation, issues)
First occurred: 2:43:07 PM (2 occurrences)
Last logged: 2:43:42 PM

Traceback (most recent call last): File "/config/custom_components/ytube_music_player/media_player.py", line 1404, in async_play_media self._tracks = await self.hass.async_add_executor_job(lambda: self._api.get_playlist(media_id, limit=self._trackLimit)) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/ytube_music_player/media_player.py", line 1404, in <lambda> self._tracks = await self.hass.async_add_executor_job(lambda: self._api.get_playlist(media_id, limit=self._trackLimit)) File "/usr/local/lib/python3.9/site-packages/ytmusicapi/mixins/playlists.py", line 66, in get_playlist response = self._send_request(endpoint, body) File "/usr/local/lib/python3.9/site-packages/ytmusicapi/ytmusic.py", line 134, in _send_request raise Exception(message + error) Exception: Server returned HTTP 403: Forbidden. The caller does not have permission

That’s almost certainly a cookie problem. Unfortunately the setup won’t detect all those issues.
May I ask: what are you doing with the cookies? :wink: I think I’m still using the first cookie that I’ve created years ago and never had to change it. But the two of us talked quite a bit about cookie problems, haven’t we?
Jkw

1 Like

I resubmitted the integration with the same cookie and said success.
I will try another newly generated cookie, if that fails I’ll reinstall the entire integration.

It’s odd as some tracks are playing fine. I have a nodered automation which turns it on in the morning so plays some of the albums on my account.

Thanks

I’m trying to enter a new cookie since the previous one expired but I get the ‘User input malformed’ error. This was supposed to be fixed in HA 2021.11.2 (I’m running 2021.12.1) so I guess there is something I’m doing wrong? Any tips? I copied as per previous successful times.

Can be tricky. Are you using the POST and with 200 status? Took me quite a few attempts. Used chrome as Firefox did not give me any results

Yes. That is listed above in the ‘general’ section, but not copied into HA.

Thank you. I figured that was kinda going to be the case I just had to ask in case someone much smarter than I found a better way… :wink:

When streaming with ytube_music_player to Chromecast, no progress is shown anymore. I first thought it was the mini media player, but when I stream from my phone or play something with kodi everything is fine. Also only one track is played. Has something changed, or is this a bug? I think the playlist is received in full, but not played continuously.

Debug Log:

2021-12-20 13:55:04 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] TURNON
2021-12-20 13:55:04 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [E] TURNON
2021-12-20 13:55:04 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] play_media, media_type: playlist, media_id: PLqekoEAOX6ZGvysI2YuLVVNnPtMIm-sa7
2021-12-20 13:55:04 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_prepare_play
2021-12-20 13:55:04 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E]
2021-12-20 13:55:04 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_update_remote_player(Input / current media_player.google_group_heimgruppe)  [E]
2021-12-20 13:55:04 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_turn_on_media_player [E]
2021-12-20 13:55:06 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_cipher [E]
2021-12-20 13:55:06 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [E] async_prepare_play
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] get_playlist(playlistId=PLqekoEAOX6ZGvysI2YuLVVNnPtMIm-sa7)
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - shuffle new tracklist
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] _tracks_to_attribute
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_update_extra_sensor [E]
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_update_extra_sensor [E]
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [E] _tracks_to_attribute
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] _play
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_track
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - Playing track nr 1 / 95
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_url
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E]
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - try to find URL on our own
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - self decoded URL via cipher
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [E] async_get_url
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - forwarding url to player media_player.google_group_heimgruppe
2021-12-20 13:55:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_update_extra_sensor [E]
2021-12-20 13:55:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [E] async_get_track
2021-12-20 13:55:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [E] play_media
2021-12-20 13:55:10 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_sync_player ... media_player.google_group_heimgruppe: off -> playing
2021-12-20 13:55:10 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] detected app _id, B45F4572
2021-12-20 13:55:10 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [E] async_sync_player
2021-12-20 13:55:23 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_sync_player ... media_player.google_group_heimgruppe [E]

Correct, that’s a known bug on the new app that Homeassistent is using with the cast integration. It has been raised here: Cast media_players missing attributes in 2021.12.2 · Issue #62054 · home-assistant/core · GitHub

There is nothing I can do about it, I’ve downgraded my system to 2021.11 until this is fixed
Jkw

PS: it might help a comment to the GitHub ticket so the developer can see the magnitude of the issue … :wink:

1 Like