I spoke too soon. When I choose playlist radio, it plays the playlist songs only and fails to generate a radio list… Frustrating
Can anyone else confirm this issue? It still works here. Please (as always) add your debug log. Or even better, let’s solve this at the GitHub ticket.
I have a different issue. First time using this. Getting this error after clicking the Playlist Button:
Failed to call service media_player/play_media. not a valid value for dictionary value @ data['entity_id']
I’ve also found this in my log:
2021-03-26 14:07:58 ERROR (SyncWorker_3) [custom_components.ytube_music_player.media_player] (input_select.ytube_music_player_speakers) is not a valid input_select entity.
Please enable debug output and send me the log. Also which is the “playlist button” ?
issue created on GitHub 4 days ago with logs. Thank you for this great addon
Hi, thank you for the excellent work on this media player, its great being able to access my YouTube Music from Home Assistant.
I have an automation that would cast a random track based on the weather each morning and I want to use the YouTube Music method now.
I have managed to have a playlist start on shuffle but would like it to stop after playing one track, is this possible?
Thank you
Well, you can call play_media with type ‘track’ and the ‘videoId’ of one song. (Set repeat to off)
Would that work?
I would like a different track each morning as the event is triggered when I enter my kitchen so it doesn’t get too old
Hey, wanted to say thank you for the excellent work on this player. I’m new to HA and have just installed it (thanks to the guide videos) and its working awesome.
Just wondering if there is a way to make the video stream with the music as well? I currently just get a black screen on my TV. I’ve seen a few references in the above to using ‘Media Extractor’ for this, however I’m not sure how to use in relation to this player?
Hmm I guess you could do one of two things:
a) randomize the videoId in your automation
b) start a playlist on random an enable a automation that will look for the state of your player. Once it switches to ‘idle’ call ‘stop’ on the youtube player and disable the automation
Hi, this is audio only. Sorry
Ahh no wonder I couldn’t figure it out
Thanks for the clarification
I upgraded to 2021.4 and I needed to update my cookie after a couple of reboots and I this error message popped up:
Could not update the cookie, thanks for the help!
Yeah, I’m getting the same thing after upgrading to 2021.4. I started getting notifications that the cookie was incorrect but I noticed that the media player in my lovelace was updating correctly with what is already playing from another source on my phone. Might this be some sort of change in 2021.4 that caused this issue with the cookie validation?
Actually it look like an issue with the youtube interface … we just had a similar issue on GitHub … honestly … I don’t know how to help
Do you think it has something to do with YouTube updating things, like that album endpoint issue affecting people that were getting cutover into some kind of beta group? Or something completely different?
yep … thats what I thought … but it turned out that it is due to the I/O blocking of Homeassistant … 2021.4
There was one call that was causing I/O in the main loop.
I never found a way to get around that, without rewriting a lot of code … I guess now I have to rewrite it
Edit: there is a first beta Version online … please let me know if you find issues, here or via GitHub issues ticket
Ok cool, I installed the beta, cookie works but continuous playback does not but you can manually skip to the next song though. However, if you try to turn off the media player, it crashes HA completely
I can’t seem to find any logs post-crash, might be a bit problematic, let me know if I can enable some sort of crash log.
Luckily, I was able to generate an error attempting to ‘Like’ a song:
Source: custom_components/ytube_music_player/media_player.py:1401
Integration: yTubeMediaPlayer (documentation, issues)
First occurred: 1:20:42 PM (1 occurrences)
Last logged: 1:20:42 PM
Traceback (most recent call last): File "/config/custom_components/ytube_music_player/media_player.py", line 1331, in async_call_method self._api.rate_song(videoId=self._attributes['videoId'],rating=arg) File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/library.py", line 242, in rate_song return self._send_request(endpoint, body) File "/usr/local/lib/python3.8/site-packages/ytmusicapi/ytmusic.py", line 120, in _send_request response = self._session.post(base_url + endpoint + params + additionalParams, File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 590, in post return self.request('POST', url, data=data, json=json, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request super(HTTPConnection, self).request(method, url, body=body, headers=headers) File "/usr/local/lib/python3.8/http/client.py", line 1255, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/local/lib/python3.8/http/client.py", line 1266, in _send_request self.putrequest(method, url, **skips) File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 214, in putrequest return _HTTPConnection.putrequest(self, method, url, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 150, in protected_loop_func check_loop() File "/usr/src/homeassistant/homeassistant/util/async_.py", line 139, in check_loop raise RuntimeError( RuntimeError: I/O must be done in the executor; Use `await hass.async_add_executor_job()` at custom_components/ytube_music_player/media_player.py, line 1331: self._api.rate_song(videoId=self._attributes['videoId'],rating=arg)
Hopefully this helps.
EDIT:
was able to take a screen cap from one of the crashes:
perfect… I was able to confirm and fix the issue, please try the 2nd release
JKW
PS: just saw your screenshot … that’s something else … give me some minutes …
PPS: https://github.com/KoljaWindeler/ytube_music_player/releases/tag/20210409b3 released
As you know, I have a unique configuration because of my lone Sonos speaker that requires the proxy media_player, that one doesn’t play at all now. Here’s an error message:
Source: custom_components/ytube_music_player/media_player.py:1405
Integration: yTubeMediaPlayer (documentation, issues)
First occurred: 3:38:33 PM (1 occurrences)
Last logged: 3:38:33 PM
Traceback (most recent call last): File "/config/custom_components/ytube_music_player/media_player.py", line 965, in async_get_track _proxy_url_content = await self.hass.async_add_executor_job(u.read) NameError: name 'u' is not defined
The regular media_player works as expected on my other speakers, great job!