Youtube Music - Media Browser

It should show up under media … Have you refreshed the page in the browser?
You can change the output via the browser … but sure … That is a problem if you don’t see it.

Anything in the homeassistant log?
Jkw

Ya refreshing was the first thing I tried. I then used a different browser but still doesn’t show up. The only thing I see in the logs is when I do a restart it logs:

Blockquote
2022-04-17 12:18:17 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration ytube_music_player which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

Which I assume is expected for all integrations installed via HACS.

Thou I did just notice this message when viewing it’s entity

Blockquote
This entity (‘media_player.ytube_music_player’) does not have a unique ID, therefore its settings cannot be managed from the UI


image

First of all: this is great! @danil 's search is working and having YouTube Music integrated solves a problem after ditching spotify some time ago. Thank you very much @JKW!

I have a question though, can I adjust the stuff that shows up in the media library? I have no need for ‘uploaded artists, songs etc’, but I would really like a button to browse the artists I subscribed to. Hope this is possible :slight_smile:

Hi, that’s not implemented as of now … but I just checked, and it is available in the API (that’s new)
https://ytmusicapi.readthedocs.io/en/latest/reference.html?highlight=subscription#ytmusicapi.YTMusic.get_library_subscriptions

I’ll add that to the todo list
JKW

1 Like

Awesome :slight_smile:

Hey folks,

I am just starting to dive into the Homeassistant world.

Since media control is the first project I want to start with, the youtube plugin is something I want to use.

I have a problem whilst trying to install this:

  • For testing purpose I use HA on a Linux VM via virtualbox (Win10)
  • I installed HACS
  • When I try to install the ytube_music_player repository, it just keeps on loading and closes the popup after ~ 3min.
  • the folder in the custom_components is there, but not all files (regarding to the github) are in there
  • I can find the integration to download in HA, but if I want to install, it just is not processing it.

Maybe you have an idea, what mistakes I might do?

Thank you,
Stefan

Is there a way of playing this from your android phone?

Thanks

Have I missed a setup step somewhere? I saw some fixes for Sonos but can’t see anything related to the Alexa Media devices. When playing on an Alexa Media device (Echo), I get the following in the logs:

Sorry, text to speech can only be called with the notify.alexa_media service. Please see the alexa_media wiki for details.https://github.com/custom-components/alexa_media_player/wiki/Configuration%3A-Notification-Component#use-the-notifyalexa_media-service

I also have the device say “Sorry, text to speech can only be called with the notify.alexa_media service

Is there a current issue with Media Player do you know?
I’m getting ‘Unknown error’ when trying to select any of the tube objects like ‘Library Playlists’

HA version: 2022.5.5
I reconfigured the youtube integration and seemed all ok.
Rebooted HA and the host server - still not being able to select any youtube functions.

Playlist is stuck on ‘Loading’

Before uninstalling the integration is anyone else having the same issue?

Thanks

everything works here as before … 2022.5.5
Cheers, Kolja

will try capturing a new token from the browser.
Odd that the player still works if I click on one of the buttons I created but cannot access the Media folder to see my youtube playlists - possibly a permissions issue with the token

That fixed it - needed the token adding again

I was wondering if anyone knew a clever way to make the track list markdown selectable?

I’m currently using Kolja’s markdown.yaml to display the track list and would like to be able to select any track to play after it gets loaded.

My current code for this is:

- type: custom:collapsable-cards
  title: Track List
  cards:
    - type: markdown
      content: >-
          {% if is_state('media_player.ytube_music_player','playing') %}
          {% for i in range(0,state_attr("sensor.ytube_music_player_extra","total_tracks")) %}
            {% if i == state_attr("media_player.ytube_music_player","current_track") %}**{% endif %}\[{{i+1}}]{{state_attr("sensor.ytube_music_player_extra", "tracks")[i] }}{% if i == state_attr("media_player.ytube_music_player", "current_track")%}**{% endif %}
          {%- endfor %}{% else %}Player off{% endif %}

Thanks!

How to play different tracks on different Google Home`s with this YouTube Music integration?

By creating multiple players

@JKW - Been reading through the thread and really appreciate the work you’ve done for us with this integration. But out of curiosity, why is there not a YT player for non premium users? Just wondering why no one has built a successful integration to be able to play normal YT content. Thanks!

Hi, thanks

Yt or yt music?

I don’t subscribe to any of the YouTube services, so I don’t know how many variant subscription types there are. But throughout the posts, I see references to Premium. I assumed that is tied to a YouTube subscription service of some kind. I am probably very ignorant and wrong in that assumption, so please forgive me on that.

I am trying to just get a regular youtube link (https://www.<>.com/watch?v=9UMxZofMNbA) to cast / play from a home assistant picture entity card. I was able to get it to work by opening an external browser, but that wasn’t really very controllable.

Basically, I am building a page for a kiosk using Fully Browser so that we can scroll through the thumbnails (Picture Entity Cards) and select either local media (playlist) or a piece of standard YouTube media.

Thanks again for your help!

Good question … Honestly I don’t know why there is no such integration … But this was really the Google music media browser that turned into the yt music platform when Google renamed it. It has nothing to do with yt even though the name is very similar.
Jkw

@JKW, I have setup everything here and its working quite good except when I ask to play a playlist it only plays the first song and stops generating an error. Could you help me? Log ask to open an issue with this:

Logger: custom_components.ytube_music_player.media_player
Source: custom_components/ytube_music_player/media_player.py:1960
Integration: yTubeMediaPlayer (documentation, issues)
First occurred: 12:23:10 (3 occurrences)
Last logged: 12:59:06

Traceback (most recent call last): File “/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py”, line 703, in urlopen httplib_response = self._make_request( File “/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py”, line 449, in _make_request six.raise_from(e, None) File “”, line 3, in raise_from File “/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py”, line 444, in _make_request httplib_response = conn.getresponse() File “/usr/local/lib/python3.10/http/client.py”, line 1374, in getresponse response.begin() File “/usr/local/lib/python3.10/http/client.py”, line 318, in begin version, status, reason = self._read_status() File “/usr/local/lib/python3.10/http/client.py”, line 287, in _read_status raise RemoteDisconnected(“Remote end closed connection without” http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File “/usr/local/lib/python3.10/site-packages/requests/adapters.py”, line 489, in send resp = conn.urlopen( File “/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py”, line 787, in urlopen retries = retries.increment( File “/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py”, line 550, in increment raise six.reraise(type(error), error, _stacktrace) File “/usr/local/lib/python3.10/site-packages/urllib3/packages/six.py”, line 769, in reraise raise value.with_traceback(tb) File “/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py”, line 703, in urlopen httplib_response = self._make_request( File “/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py”, line 449, in _make_request six.raise_from(e, None) File “”, line 3, in raise_from File “/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py”, line 444, in _make_request httplib_response = conn.getresponse() File “/usr/local/lib/python3.10/http/client.py”, line 1374, in getresponse response.begin() File “/usr/local/lib/python3.10/http/client.py”, line 318, in begin version, status, reason = self._read_status() File “/usr/local/lib/python3.10/http/client.py”, line 287, in _read_status raise RemoteDisconnected(“Remote end closed connection without” urllib3.exceptions.ProtocolError: (‘Connection aborted.’, RemoteDisconnected(‘Remote end closed connection without response’)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File “/config/custom_components/ytube_music_player/media_player.py”, line 1356, in async_get_url response = await self.hass.async_add_executor_job(lambda: self._api.get_song(videoId, self._signatureTimestamp)) File “/usr/local/lib/python3.10/concurrent/futures/thread.py”, line 58, in run result = self.fn(*self.args, **self.kwargs) File “/config/custom_components/ytube_music_player/media_player.py”, line 1356, in response = await self.hass.async_add_executor_job(lambda: self._api.get_song(videoId, self._signatureTimestamp)) File “/usr/local/lib/python3.10/site-packages/ytmusicapi/mixins/browsing.py”, line 646, in get_song response = self._send_request(endpoint, params) File “/usr/local/lib/python3.10/site-packages/ytmusicapi/ytmusic.py”, line 133, in _send_request response = self._session.post(YTM_BASE_API + endpoint + YTM_PARAMS + additionalParams, File “/usr/local/lib/python3.10/site-packages/requests/sessions.py”, line 635, in post return self.request(“POST”, url, data=data, json=json, **kwargs) File “/usr/local/lib/python3.10/site-packages/requests/sessions.py”, line 587, in request resp = self.send(prep, **send_kwargs) File “/usr/local/lib/python3.10/site-packages/requests/sessions.py”, line 701, in send r = adapter.send(request, **kwargs) File “/usr/local/lib/python3.10/site-packages/requests/adapters.py”, line 547, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (‘Connection aborted.’, RemoteDisconnected(‘Remote end closed connection without response’))

Before the error I get this:

Logger: custom_components.ytube_music_player.media_player
Source: custom_components/ytube_music_player/media_player.py:267
Integration: yTubeMediaPlayer (documentation, issues)
First occurred: 12:23:10 (3 occurrences)
Last logged: 12:59:06

  • self.get_song(videoId=1i1673ILdVI,signatureTimestamp=19198)
  • self.get_song(videoId=mbI-dB-9un0,signatureTimestamp=19198)
  • self.get_song(videoId=Tb2ULpY3Obg,signatureTimestamp=19198)