Youtube Music - Media Browser

Just created a ticket


Let’s see

edit: looks good

I saw your ticket was closed. But I do not really get it. For me its less about the 25 tracks limit than more about the fact that the media browser only shows 100 Artists in the category Artists uploaded and i just have more than 100 Artists in my uploaded yt music account.
Still, thanks for your afford! :slight_smile:

Well the 100 is a self-made limit from my code. What would be a better number for you? 250?
The 25 is a limit from the API and is now configurable as you already saw.
JKW

Right now i have 291 Artists…so to make it futureproof mh…350? :sweat_smile:

Can´t say it often enough how great your addon really is!!
I was never able to get the google music addon working. But i realize that my main problem i think, is with the media browser. I´m used to the classic media player structure. Artist -> Album -> Tracks.
But with the media browser i click on “Artists uploaded” can choose my artist but than i just get 25 tracks that are contained in maybe the first 3 Albums of an Artist.
Sure i could just scroll to “uploaded Albums” but if you have a lot of albums thats a pain in the ass. So i hope they maybe change the structure of the media browser :smile:

1 Like

Well … Technically that structure COULD be applied to the media browser … once we can fetch more tracks we could … Maybe … Add a layer “albums” in between. …I’ll have a look

1 Like

The new release set the limit to 500 let’s see how that works. I only have 5 in my list :wink:

Also be aware of the breaking change for the channel mode!!
Jkw

2 Likes

wow…thanks…will test right away!

Is this code correct after the breaking changes for channels? Because in this way it’s not working…

                - name: Bach
                  type: channel
                  id: UCFtSXTlIMFFkyJbHO3V5b7A 

And, more, i got tons of these errors:

============= ytube_music_player Integration Error ================
2021-01-05 10:14:22 ERROR (SyncWorker_30) [custom_components.ytube_music_player.media_player] unfortunately we hit an error in the sub api, please open a ticket at
2021-01-05 10:14:22 ERROR (SyncWorker_30) [custom_components.ytube_music_player.media_player] https://github.com/sigma67/ytmusicapi/issues
2021-01-05 10:14:22 ERROR (SyncWorker_30) [custom_components.ytube_music_player.media_player] and paste the following output:

2021-01-05 10:14:22 ERROR (SyncWorker_30) [custom_components.ytube_music_player.media_player] Traceback (most recent call last):
  File "/config/custom_components/ytube_music_player/media_player.py", line 995, in play_media
    self._tracks = self._api.get_playlist(playlistId=media_id,limit=999)['tracks']
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 66, in get_playlist
    results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST)[0]['musicPlaylistShelfRenderer']
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 167, in nav
    raise err
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 161, in nav
    root = root[k]
KeyError: 'contents'

2021-01-05 10:14:22 ERROR (SyncWorker_30) [custom_components.ytube_music_player.media_player] 
thanks, Kolja
2021-01-05 10:14:22 ERROR (SyncWorker_30) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================

2021-01-05 10:14:34 ERROR (SyncWorker_32) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:34 ERROR (SyncWorker_37) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:34 ERROR (SyncWorker_18) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:34 ERROR (SyncWorker_19) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:34 ERROR (SyncWorker_36) [custom_components.ytube_music_player.media_player] 

============= ytube_music_player Integration Error ================
2021-01-05 10:14:34 ERROR (SyncWorker_36) [custom_components.ytube_music_player.media_player] unfortunately we hit an error in the sub api, please open a ticket at
2021-01-05 10:14:34 ERROR (SyncWorker_36) [custom_components.ytube_music_player.media_player] https://github.com/sigma67/ytmusicapi/issues
2021-01-05 10:14:34 ERROR (SyncWorker_36) [custom_components.ytube_music_player.media_player] and paste the following output:

2021-01-05 10:14:34 ERROR (SyncWorker_36) [custom_components.ytube_music_player.media_player] Traceback (most recent call last):
  File "/config/custom_components/ytube_music_player/media_player.py", line 995, in play_media
    self._tracks = self._api.get_playlist(playlistId=media_id,limit=999)['tracks']
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 66, in get_playlist
    results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST)[0]['musicPlaylistShelfRenderer']
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 167, in nav
    raise err
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 161, in nav
    root = root[k]
KeyError: 'contents'

2021-01-05 10:14:34 ERROR (SyncWorker_36) [custom_components.ytube_music_player.media_player] 
thanks, Kolja
2021-01-05 10:14:34 ERROR (SyncWorker_36) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================


2021-01-05 10:14:34 ERROR (SyncWorker_26) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:34 ERROR (SyncWorker_15) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:46 ERROR (SyncWorker_31) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:46 ERROR (SyncWorker_12) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:46 ERROR (SyncWorker_16) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:46 ERROR (SyncWorker_17) [custom_components.ytube_music_player.media_player] 

============= ytube_music_player Integration Error ================
2021-01-05 10:14:46 ERROR (SyncWorker_17) [custom_components.ytube_music_player.media_player] unfortunately we hit an error in the sub api, please open a ticket at
2021-01-05 10:14:46 ERROR (SyncWorker_17) [custom_components.ytube_music_player.media_player] https://github.com/sigma67/ytmusicapi/issues
2021-01-05 10:14:46 ERROR (SyncWorker_17) [custom_components.ytube_music_player.media_player] and paste the following output:

2021-01-05 10:14:46 ERROR (SyncWorker_17) [custom_components.ytube_music_player.media_player] Traceback (most recent call last):
  File "/config/custom_components/ytube_music_player/media_player.py", line 995, in play_media
    self._tracks = self._api.get_playlist(playlistId=media_id,limit=999)['tracks']
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 66, in get_playlist
    results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST)[0]['musicPlaylistShelfRenderer']
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 167, in nav
    raise err
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 161, in nav
    root = root[k]
KeyError: 'contents'

2021-01-05 10:14:46 ERROR (SyncWorker_17) [custom_components.ytube_music_player.media_player] 
thanks, Kolja
2021-01-05 10:14:46 ERROR (SyncWorker_17) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================


2021-01-05 10:14:46 ERROR (SyncWorker_20) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:52 ERROR (SyncWorker_28) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:52 ERROR (SyncWorker_35) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:53 ERROR (SyncWorker_8) [custom_components.ytube_music_player.media_player] 

============= ytube_music_player Integration Error ================
2021-01-05 10:14:53 ERROR (SyncWorker_8) [custom_components.ytube_music_player.media_player] unfortunately we hit an error in the sub api, please open a ticket at
2021-01-05 10:14:53 ERROR (SyncWorker_8) [custom_components.ytube_music_player.media_player] https://github.com/sigma67/ytmusicapi/issues
2021-01-05 10:14:53 ERROR (SyncWorker_8) [custom_components.ytube_music_player.media_player] and paste the following output:

2021-01-05 10:14:53 ERROR (SyncWorker_8) [custom_components.ytube_music_player.media_player] Traceback (most recent call last):
  File "/config/custom_components/ytube_music_player/media_player.py", line 995, in play_media
    self._tracks = self._api.get_playlist(playlistId=media_id,limit=999)['tracks']
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 66, in get_playlist
    results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST)[0]['musicPlaylistShelfRenderer']
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 167, in nav
    raise err
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 161, in nav
    root = root[k]
KeyError: 'contents'

2021-01-05 10:14:53 ERROR (SyncWorker_8) [custom_components.ytube_music_player.media_player] 
thanks, Kolja
2021-01-05 10:14:53 ERROR (SyncWorker_8) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================


2021-01-05 10:14:53 ERROR (SyncWorker_36) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:57 ERROR (SyncWorker_36) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:57 ERROR (SyncWorker_33) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:57 ERROR (SyncWorker_15) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:58 ERROR (SyncWorker_28) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:14:59 ERROR (SyncWorker_1) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:15:07 ERROR (SyncWorker_27) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:15:08 ERROR (SyncWorker_30) [custom_components.ytube_music_player.media_player] 

============= ytube_music_player Integration Error ================
2021-01-05 10:15:08 ERROR (SyncWorker_30) [custom_components.ytube_music_player.media_player] unfortunately we hit an error in the sub api, please open a ticket at
2021-01-05 10:15:08 ERROR (SyncWorker_30) [custom_components.ytube_music_player.media_player] https://github.com/sigma67/ytmusicapi/issues
2021-01-05 10:15:08 ERROR (SyncWorker_30) [custom_components.ytube_music_player.media_player] and paste the following output:

2021-01-05 10:15:08 ERROR (SyncWorker_30) [custom_components.ytube_music_player.media_player] Traceback (most recent call last):
  File "/config/custom_components/ytube_music_player/media_player.py", line 995, in play_media
    self._tracks = self._api.get_playlist(playlistId=media_id,limit=999)['tracks']
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 66, in get_playlist
    results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST)[0]['musicPlaylistShelfRenderer']
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 167, in nav
    raise err
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 161, in nav
    root = root[k]
KeyError: 'contents'

2021-01-05 10:15:08 ERROR (SyncWorker_30) [custom_components.ytube_music_player.media_player] 
thanks, Kolja
2021-01-05 10:15:08 ERROR (SyncWorker_30) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================


2021-01-05 10:15:08 ERROR (SyncWorker_8) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:15:16 ERROR (SyncWorker_36) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:15:16 ERROR (SyncWorker_21) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:15:16 ERROR (SyncWorker_22) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:15:16 ERROR (SyncWorker_17) [custom_components.ytube_music_player.media_player] 

============= ytube_music_player Integration Error ================
2021-01-05 10:15:16 ERROR (SyncWorker_17) [custom_components.ytube_music_player.media_player] unfortunately we hit an error in the sub api, please open a ticket at
2021-01-05 10:15:16 ERROR (SyncWorker_17) [custom_components.ytube_music_player.media_player] https://github.com/sigma67/ytmusicapi/issues
2021-01-05 10:15:16 ERROR (SyncWorker_17) [custom_components.ytube_music_player.media_player] and paste the following output:

2021-01-05 10:15:16 ERROR (SyncWorker_17) [custom_components.ytube_music_player.media_player] Traceback (most recent call last):
  File "/config/custom_components/ytube_music_player/media_player.py", line 995, in play_media
    self._tracks = self._api.get_playlist(playlistId=media_id,limit=999)['tracks']
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 66, in get_playlist
    results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST)[0]['musicPlaylistShelfRenderer']
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 167, in nav
    raise err
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 161, in nav
    root = root[k]
KeyError: 'contents'

2021-01-05 10:15:16 ERROR (SyncWorker_17) [custom_components.ytube_music_player.media_player] 
thanks, Kolja
2021-01-05 10:15:16 ERROR (SyncWorker_17) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================


2021-01-05 10:15:16 ERROR (SyncWorker_18) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 10:15:16 ERROR (SyncWorker_3) [custom_components.genius_lyrics.sensor] Missing artist and/or title

Why i get always the same error about artist and title if i get correctly both of them inside the media player? And also if i am not playing the youtube music player?

Is UCFtSXTlIMFFkyJbHO3V5b7A a playlist id from your library?

No is the Bach channel ID, is it wrong?
Ok, maybe now i understand what to set for channel… The id of a song inside a playlist… right?
And what about the errors?
Every time i try to play something i get two Missing artist and/or title errors…

Channel -> playlist id
Please read https://github.com/KoljaWindeler/ytube_music_player#services

Lyrics are already provided by the integration (check the attributes)
Please also read https://github.com/KoljaWindeler/ytube_music_player/issues/36

I tried also from the developer/services in this way:

Schermata 2021-01-05 alle 19.30.19

And i got no music and these errors:

2021-01-05 19:29:31 ERROR (SyncWorker_35) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 19:29:31 ERROR (SyncWorker_54) [custom_components.genius_lyrics.sensor] Missing artist and/or title
2021-01-05 19:29:31 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] - Failed to get ID for track: ({'errorcode': ['2'], 'status': ['fail'], 'reason': ['Invalid parameters.']})
2021-01-05 19:29:31 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] {'errorcode': ['2'], 'status': ['fail'], 'reason': ['Invalid parameters.']}
2021-01-05 19:29:32 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] - Failed to get ID for track: ({'reason': ['Invalid parameters.'], 'errorcode': ['2'], 'status': ['fail']})
2021-01-05 19:29:32 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] {'reason': ['Invalid parameters.'], 'errorcode': ['2'], 'status': ['fail']}
2021-01-05 19:29:34 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] - Failed to get ID for track: ({'status': ['fail'], 'errorcode': ['2'], 'reason': ['Invalid parameters.']})
2021-01-05 19:29:34 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] {'status': ['fail'], 'errorcode': ['2'], 'reason': ['Invalid parameters.']}
2021-01-05 19:29:35 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] - Failed to get ID for track: ({'reason': ['Invalid parameters.'], 'status': ['fail'], 'errorcode': ['2']})
2021-01-05 19:29:35 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] {'reason': ['Invalid parameters.'], 'status': ['fail'], 'errorcode': ['2']}
2021-01-05 19:29:37 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] - Failed to get ID for track: ({'status': ['fail'], 'errorcode': ['2'], 'reason': ['Invalid parameters.']})
2021-01-05 19:29:37 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] {'status': ['fail'], 'errorcode': ['2'], 'reason': ['Invalid parameters.']}
2021-01-05 19:29:38 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] - Failed to get ID for track: ({'errorcode': ['2'], 'status': ['fail'], 'reason': ['Invalid parameters.']})
2021-01-05 19:29:38 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] {'errorcode': ['2'], 'status': ['fail'], 'reason': ['Invalid parameters.']}
2021-01-05 19:29:40 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] - Failed to get ID for track: ({'reason': ['Invalid parameters.'], 'status': ['fail'], 'errorcode': ['2']})
2021-01-05 19:29:40 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] {'reason': ['Invalid parameters.'], 'status': ['fail'], 'errorcode': ['2']}
2021-01-05 19:29:41 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] - Failed to get ID for track: ({'status': ['fail'], 'errorcode': ['2'], 'reason': ['Invalid parameters.']})
2021-01-05 19:29:41 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] {'status': ['fail'], 'errorcode': ['2'], 'reason': ['Invalid parameters.']}
2021-01-05 19:29:43 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] - Failed to get ID for track: ({'status': ['fail'], 'reason': ['Invalid parameters.'], 'errorcode': ['2']})
2021-01-05 19:29:43 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] {'status': ['fail'], 'reason': ['Invalid parameters.'], 'errorcode': ['2']}
2021-01-05 19:29:44 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] - Failed to get ID for track: ({'status': ['fail'], 'reason': ['Invalid parameters.'], 'errorcode': ['2']})
2021-01-05 19:29:44 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] {'status': ['fail'], 'reason': ['Invalid parameters.'], 'errorcode': ['2']}
2021-01-05 19:29:46 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] - Failed to get ID for track: ({'errorcode': ['2'], 'reason': ['Invalid parameters.'], 'status': ['fail']})
2021-01-05 19:29:46 ERROR (SyncWorker_53) [custom_components.ytube_music_player.media_player] {'errorcode': ['2'], 'reason': ['Invalid parameters.'], 'status': ['fail']}

I get the lyrics when available, but in the same time i get those errors…

So i must put playlist id in place of ‘channel’?

Please use a playlist id with channel and a track Id with Id

You can always use the media browser to find what you’re looking for and look into the attributes to find “type” and “Id” for a direct service call

Also the custom_components.genius_lyrics.sensor have nothing to do with my integration

Yes, now finally understand how to use the Id.

Yes, you’re right it’s a genius lyrics integration. Sorry for disturbing you…

No worries … The error is actually a bit linked to the integration,
Did you read https://github.com/KoljaWindeler/ytube_music_player/issues/36 ?

This part: The genius errors … Well not my integration but I’d assume that the component is looking at the Mediaplayer that you use to play your music on?

The Mediaplayer that my component generates knows the artists and title (and already the lyrics btw) … and sends the url e.g. to a chromecast. But the chromecast can’t know the artists. If your genius is looking at the e.g. chromecast then it won’t be able to fetch the lyrics

Yes i read it and i am thinking how to disable that integration when the youtube music player is ‘on’.
Is there a way to send the same attributes about title and artist also to my chromecast media player?
In this way the genius lyrics integration finds the attributes also in that media player and doesn’t show anymore those errors (hope i was clear enough about what i have in mind)…

Yep I totally get what you are saying. Good question … How do you usually get the title / artist there?

I mean: what other integration is capable of sending those informations to the chromcast

I am using this custom component “https://github.com/robert-alfaro/genius-lyrics” which creates a sensor for each media player configured.

These are my sensors:

And the attributes shows title artists and lyrics… Now how to use those sensors also when i am using youtube music?

1 Like