Youtube Music - Media Browser

Well you can add the “my mix” to your library … Simply click the plus symbol and you should be able to find the list in the drop down.
Jkw

Hmm, well I am mostly dumb then :wink: I didn’t know I could do that.
However, I don’t see any playlists in the dropdown. Only Playlist Radio and Playlist.
Is there something else I need to check?

The Source drop-down can be “playlist / playlist radio”
The playlist dropdown should contain the playlists. Try restarting … Its possible that I only load the playlists during start up (will check)
Jkw

Installed the update which required a reboot, they all show up now.
Thanks for your work.

1 Like

I feel stupid but i´m unable to install your ytube_music_player. Can´t find it in HACS and when i try the manual variant i can´t find it in the integrations tab. Did the restart and also the refreshing. Help, please…

yep, sorry for the trouble … the pull request is hanging for more then 3 weeks already …


and without it I won’t be accepted into HACS default.

The best way is currently to add “https://github.com/KoljaWindeler/ytube_music_player” to the HACS as custom repository … pretty much nothing I can do about it.
JKW

thanks…worked out for me :slight_smile:

Has anyone got the brand account to work?
I’ve got all my music on a separate youtube music channel to the default but I get a load of errors if I enter the brand id in the config. I tried both the user ID and channel ID, not sure if either of those are correct.

Works great with no brand ID added, but all my playlists are on the other account.

Edit: Got it to work, it was neither the user ID or channel ID of the brand channel, it shows up in the URL but only on specific pages. Clicking “edit on google” from the brand channel youtube settings brought me to the right URL

1 Like

Like many others, i´m very thankfull for this addon. It works perfectly!!
I would like to implement a lot of Playlist and for that reason i would like to have an alternative to the playlist dropdown menu. I found that there´s a playlist addon for spotify. Is it possible to use this kind of playlist style for youtube music? Or is it doable to achieve this by using a picture or a picture glance card?If that´s the case, then please give me a hint. Thanks!!! :upside_down_face:

Hi, thanks.
I’m working on the addition of the media_browser …
and it sort of works … well … parts of it … for now I can browse the albums and playlist but nothing happens when I hit the “play” button … no function gets called. Trying to find out what is going on there.
Will take some days …
JKW

thanks for your work!

OK, here are some new features:

and once you select one of the three categories you’ll also get nice pictures

This is a new “beta” version … you’ve to enable “beta” releases to get this pre-release

Now I need your help to see what is failing :slight_smile:
JKW

Edit:

  1. If you have a media_player on your lovelace screen: simply click on the lib symbol in the player …

  2. It will still play on the “remote_player” that you’ve preselected in you speaker list

  3. it will still follow the “playmode” (shuffle/direct/random) and the “continuous mode” will still work / affect the playback …

  4. you can either directly play a playlist (click on the playbutton in the playlist overview) or open the playlist and play one dedicated song only …

6 Likes

I’ve been busy with some things the last few weeks. What an awesome update to come back to!

Thank you for your continued work on this :smile:

2 Likes

Sweet.
I don’t see where this beta toggle is so I just manually downloaded from your repository and restarted.
And the Media Library appeared just as it should.

Only issue for me is that after it plays the first song, it just stops.
Continuous play back is turned on.

The toggle might only appear if you delete the integration and reinstall it … at least that’s what I had to do.

About your one track issue: could you explain what you’ve clicked ?

If you select one specific song then only that song will play.
Same for one song from a playlist or an album.
Jkw

Edit: also always very helpful is a log, I’ve added tons of debug messages, you can enable debug output like this:

I clicked on the Play button on the My Supermix play list.

This is the log while it’s playing.

2020-12-18 18:09:05 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] async_browse_media
2020-12-18 18:09:05 DEBUG (SyncWorker_1) [custom_components.ytube_music_player.browse_media] Playlists / directory /  / library_playlists / False
2020-12-18 18:09:05 DEBUG (SyncWorker_1) [custom_components.ytube_music_player.browse_media] Albums / directory /  / library_albums / False
2020-12-18 18:09:05 DEBUG (SyncWorker_1) [custom_components.ytube_music_player.browse_media] Tracks / directory /  / library_tracks / False
2020-12-18 18:09:06 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] async_browse_media
2020-12-18 18:09:06 ERROR (MainThread) [custom_components.ytube_music_player.media_player] wir machen jetzt build_item_response
2020-12-18 18:09:06 ERROR (MainThread) [custom_components.ytube_music_player.media_player] {'search_type': 'library_playlists', 'search_id': ''}
2020-12-18 18:09:06 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for ytube_music_player doing I/O at custom_components/ytube_music_player/browse_media.py, line 57: media = media_library.get_library_playlists(limit=BROWSER_LIMIT)
2020-12-18 18:09:07 DEBUG (MainThread) [custom_components.ytube_music_player.browse_media] Your Likes / playlist / LM / playlist / True
2020-12-18 18:09:07 DEBUG (MainThread) [custom_components.ytube_music_player.browse_media] My Mix 5 / playlist / RDTMAK5dd_lfZhS7zmIcmUhsKtkWylKzc0EN0LW90-s / playlist / True
2020-12-18 18:09:07 DEBUG (MainThread) [custom_components.ytube_music_player.browse_media] My Mix 3 / playlist / RDTMAK5dd_k5UUl0lmrrfrjMpsT0CoMpdcBz1ruAO1k / playlist / True
2020-12-18 18:09:07 DEBUG (MainThread) [custom_components.ytube_music_player.browse_media] My Mix 2 / playlist / RDTMAK5dd_lz2owBgwWf1mjzyn_NbxzMViQzIg8IAIg / playlist / True
2020-12-18 18:09:07 DEBUG (MainThread) [custom_components.ytube_music_player.browse_media] My Mix 1 / playlist / RDTMAK5dd_nGQKSMIkpr4o9VI_2i56pkGliD6FQRo50 / playlist / True
2020-12-18 18:09:07 DEBUG (MainThread) [custom_components.ytube_music_player.browse_media] My Supermix / playlist / RDTMAK5dd_kset8DisdE7LSD4TNjEVvrKRTmG7a56sY / playlist / True
2020-12-18 18:09:07 DEBUG (MainThread) [custom_components.ytube_music_player.browse_media] Beats / playlist / PLaLVlOwUOOirL8kCo3lsYdlilT87YVvNM / playlist / True
2020-12-18 18:09:07 DEBUG (MainThread) [custom_components.ytube_music_player.browse_media] Violent Femmes Mix / playlist / PLaLVlOwUOOioLU1G0amFCpn0bYb3KU3dJ / playlist / True
2020-12-18 18:09:07 DEBUG (MainThread) [custom_components.ytube_music_player.browse_media] Let the Good Times Rock / playlist / RDCLAK5uy_mK1WL2p2Bmn5lzF5wTVydDyfFSzhXCGUE / playlist / True
2020-12-18 18:09:07 DEBUG (MainThread) [custom_components.ytube_music_player.browse_media] Epic Classic Rock / playlist / RDCLAK5uy_lxC3w7O3LZIA1fqRM4tl9Fv9aECoP_r9E / playlist / True
2020-12-18 18:09:07 DEBUG (MainThread) [custom_components.ytube_music_player.browse_media] Christmas / playlist / PLaLVlOwUOOirz1ZROnJW9Ipt9AsquWBzE / playlist / True
2020-12-18 18:09:10 DEBUG (SyncWorker_10) [custom_components.ytube_music_player.media_player] play_media
2020-12-18 18:09:10 DEBUG (SyncWorker_10) [custom_components.ytube_music_player.media_player] _update_entity_ids
2020-12-18 18:09:10 DEBUG (SyncWorker_10) [custom_components.ytube_music_player.media_player] playlist

The Input selectors
Source: Playlist
Playlist: My Mix 1
Playmode: Shuffle
Contiuous play back is enabled

Once it stops there is too much to post so I had to cut you some stuff. Let me know if you need that I can post some where else.

20-12-18 18:09:10 DEBUG (SyncWorker_10) [custom_components.ytube_music_player.media_player] playlist
2020-12-18 18:09:10 DEBUG (SyncWorker_10) [custom_components.ytube_music_player.media_player] RDTMAK5dd_kset8DisdE7LSD4TNjEVvrKRTmG7a56sY
2020-12-18 18:09:11 DEBUG (SyncWorker_10) [custom_components.ytube_music_player.media_player] Long STUFF HERE
2020-12-18 18:09:11 DEBUG (SyncWorker_10) [custom_components.ytube_music_player.media_player] _play
2020-12-18 18:09:11 DEBUG (SyncWorker_10) [custom_components.ytube_music_player.media_player] _get_track
2020-12-18 18:09:11 DEBUG (SyncWorker_10) [custom_components.ytube_music_player.media_player] Playing track nr 0 / 100

Not sure if there are any tokens in there that I should remove…

No worries, no token will be printed … actually I’ve removed most of the very_long debug and added some wrapper, all is published as new version 20201219 … I’d still like to track this down, so if you could have a look … I’m sure we can track it down …

btw: do you use a chromecast?
JKW

EDIT:
Almost forgot to mention it … so there is a new version … that version will make the configuration a bit smaller. Due to the media_browser support those drop down field e.g. for playlist CAN be skipped.

See https://github.com/KoljaWindeler/ytube_music_player/blob/bc0039251bf8c585d4de61920731caf1df8fcb20/package/minimum.yaml

I still like them … and they’ll keep working. But it is now possible to have only the remote_player defined (the one that plays the music). At that level random / repeat can still be controlled by the homeassistant service (media_player.set_shuffle / set_repeat).

I will keep those field in my config because I like to switch the remote_player depending on where I am. I also use to simply “turn_on” the player and leave the playlist preselected. From my point of view this is still quicker compared to the media browser …

but anyway … the more options there are the better the integration works for everyone.

Thanks again for the continues work on this.
I updated / reinstalled the integration and was then able to activate beta versions.
image

I also copied a new cookie text at installation.
I hope i didn’t messed up reinstalling, but i am quiet sure i did it like first time.
now i am receiving error log entries.
Can’t use ytube_music_player currently.
i am not sure if i really should open an issue at github for this…
maybe it’s just a problem with the new cookie txt i used???

watching the logs first thing that makes me worries a little bit is that it says:” ytube_music_player

Version: 0.1.5“

Anyway here is the actual error message line:

2020-12-19 21:10:44 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] Config via Storage/UI currently not supported due to me not understanding asyncio

2020-12-19 21:10:44 ERROR (SyncWorker_2) [custom_components.ytube_music_player.media_player] Traceback (most recent call last):

File "/config/custom_components/ytube_music_player/media_player.py", line 90, in __init__

self._api = ytmusicapi.YTMusic(config.get(CONF_HEADER_PATH, default_header_file))

File "/usr/local/lib/python3.8/site-packages/ytmusicapi/ytmusic.py", line 96, in __init__

self.sapisid = sapisid_from_cookie(self.headers['Cookie'])

File "/usr/local/lib/python3.8/site-packages/ytmusicapi/helpers.py", line 57, in sapisid_from_cookie

return cookie['__Secure-3PAPISID'].value

KeyError: '__Secure-3PAPISID'

2020-12-19 21:10:44 ERROR (SyncWorker_2) [custom_components.ytube_music_player.media_player]

help appreciated :slight_smile:

well all those version … well just ignore those thing :stuck_out_tongue:

The cookies is a bit of a problem … I’m fairly sure that the key ___Secure-3PAPISID is needed for the API to connect and talk to the server.

So when I open the music.youtube.com page and look for the cookie it is part of.
"cookie: … __Secure-3PAPISID=MUi… … "

can you confirm the same for you cookie field?
JKW

yes it is in in there.
i tried again several times with new and the first cookie txt.
Turns out I just copied too many lines into home assistant. Sorry! :roll_eyes:
i mistakenly included the line

accept:*/*

of the Request Headers part.

obviously misunderstood the installation guide:

and copy everything starting at accept: */*