ytube_music_player icon indicating copy to clipboard operation
ytube_music_player copied to clipboard

Playlist Radio Not working

Open ragaimeena opened this issue 3 years ago • 19 comments

Playlist Radio does not work

2021-05-23 10:31:35 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] TURNON 2021-05-23 10:31:35 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [E] TURNON 2021-05-23 10:31:35 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] play_media, media_type: channel, media_id: PLsas1F3GjcE0TxhMDYBNo5ycreB3GRm0L 2021-05-23 10:31:35 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_prepare_play 2021-05-23 10:31:35 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E] 2021-05-23 10:31:35 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_update_remote_player(Input / current media_player.shield) [E] 2021-05-23 10:31:35 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_turn_on_media_player [E] 2021-05-23 10:31:36 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_cipher [E] 2021-05-23 10:31:36 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [E] async_prepare_play 2021-05-23 10:31:36 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_sync_player ... media_player.shield: off -> unknown ... not playing [E] 2021-05-23 10:31:36 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_sync_player ... media_player.shield: unknown -> unknown ... not playing [E] 2021-05-23 10:31:36 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_sync_player ... media_player.shield: unknown -> unknown ... not playing [E] 2021-05-23 10:31:36 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_sync_player ... media_player.shield: unknown -> idle ... not playing [E] 2021-05-23 10:31:36 ERROR (Thread-18) [homeassistant.components.cast.media_player] Failed to cast media https://www.home-assistant.io/images/cast/splash.png. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address 2021-05-23 10:31:36 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_sync_player ... media_player.shield: idle -> idle ... not playing [E] 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] get_playlist(playlistId=PLsas1F3GjcE0TxhMDYBNo5ycreB3GRm0L) ... get_watch_playlist(videoId=SN6TcyzbN-Q) 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] _tracks_to_attribute [E] 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] _play 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_track 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Playing track nr 0 / 1 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_url 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E] 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - try to find URL on our own 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - found stream with audioQuality AUDIO_QUALITY_MEDIUM (12) 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - found stream with audioQuality AUDIO_QUALITY_HIGH (13) 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - found stream with audioQuality AUDIO_QUALITY_LOW (14) 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - found stream with audioQuality AUDIO_QUALITY_LOW (15) 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - found stream with audioQuality AUDIO_QUALITY_MEDIUM (16) 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - found stream with audioQuality AUDIO_QUALITY_LOW (17) 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - using stream 13 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - self decoded URL via cipher 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [E] async_get_url 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - forwarding url to player media_player.shield 2021-05-23 10:31:37 ERROR (Thread-18) [homeassistant.components.cast.media_player] Failed to cast media https://r4---sn-5ualdnle.googlevideo.com/videoplayback?expire=1621801897&ei=SWeqYO2mGYSekATuo4a4DQ&ip=71.3.1.160&id=o-AH0da-Yd-XF4dqasYfdvg_IH4IRJL3xWDEtxAFBfl43S&itag=141&source=youtube&requiressl=yes&mh=uF&mm=31%2C29&mn=sn-5ualdnle%2Csn-hp57knzz&ms=au%2Crdu&mv=m&mvi=4&pl=20&ctier=A&pfa=5&gcr=us&initcwndbps=1857500&hightc=yes&vprv=1&mime=audio%2Fmp4&ns=i-nm02leclCrqKZQ1IIpIfUF&gir=yes&clen=7347481&dur=228.192&lmt=1565999764994497&mt=1621779913&fvip=4&keepalive=yes&fexp=24001373%2C24007246&beids=9466586&c=WEB_REMIX&txp=2311222&n=8MNOEioXz1NhF69Q&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cctier%2Cpfa%2Cgcr%2Chightc%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAKeo-HnaqDeWPFWZdH_cpuPnPQSBC7rBONH3emQnfGgTAiEAicSufu8NgmQED8IEdDm2EeGMAfV5gJm5sGWHIX9L_WE%3D&sig=AOq0QJ8wRQIgPb4U_ERSUQ7wf6cbB5y4VK_We97RJlc8dgM2UbSgFnsCIQD34kQxxg9GrQTUtZWPzgnBCSqV-E1eFoYNz6QyBxmqHA==. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_sync_player ... media_player.shield: idle -> idle [E] 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [E] async_get_track 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [E] play_media 2021-05-23 10:31:37 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_sync_player ... media_player.shield: idle -> playing [E] 2021-05-23 10:31:38 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_sync_player ... media_player.shield: playing -> playing [E] 2021-05-23 10:31:52 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_sync_player ... media_player.shield [E] 2021-05-23 10:31:53 ERROR (Recorder) [homeassistant.components.recorder] Unhandled database error while processing event <Event time_changed[L]: now=2021-05-23T10:31:53.000187-04:00>: (MySQLdb._exceptions.IntegrityError) (1452, 'Cannot add or update a child row: a foreign key constraint fails (homeassistant.states, CONSTRAINT states_ibfk_2 FOREIGN KEY (old_state_id) REFERENCES states (state_id) ON DELETE SET NULL)')

ragaimeena avatar May 23 '21 14:05 ragaimeena

similar to this https://github.com/KoljaWindeler/ytube_music_player/issues/88

and this

https://github.com/KoljaWindeler/ytube_music_player/issues/79

ragaimeena avatar May 23 '21 14:05 ragaimeena

hi, can you add some more details ... like what isn't working? Ths log look just right ... is it not playing at at? playing a wrong playlist? not the right mode etc

KoljaWindeler avatar May 23 '21 15:05 KoljaWindeler

so when I use the dropdown Playlist Radio , it does not generate a radio playlist, rather goes through the regular playlist and stops without generating a radio list based on that choice. on the youtube music site i works with no issues. Please see the 2 previous issues listed above that are similar thanks

ragaimeena avatar May 23 '21 20:05 ragaimeena

Ok I see .. I still don't get why get_watch_playlist would only return just one song. I don't think that's you're doing anything wrong but i also don't understand why it is working here just fine

KoljaWindeler avatar May 23 '21 20:05 KoljaWindeler

Idk if it's related, but my playlists only play one track at a time. I have to manually advance to the next song, even though continuous play is enabled

CeeWeasel avatar May 23 '21 20:05 CeeWeasel

Any clues how it was fixed from the 2 reference issues above?

ragaimeena avatar May 23 '21 21:05 ragaimeena

Not really. The only thing that you could try is to get to the second page of the integration setup (click configure) and change the radio mode ... There is a checkbox "Create radio as watchlist of random playlist" ..

KoljaWindeler avatar May 24 '21 05:05 KoljaWindeler

Ok. When I unchecked that checkbox, I now can see a 25 song radio list, but when the 25 songs are all played out, it keeps recycling through them over and over and does not generate a new list? any thoughts. It used to generate a very long list before (like 100 or so) and when done it regenerate a new list and so on... Please advise. And thank you again for all this great work

ragaimeena avatar May 24 '21 06:05 ragaimeena

I've had the same issue with the 25 item Bering Note or less identical. That's why I've added the second method .. but that only return one song for you. ... So no t really an idea what we could do

KoljaWindeler avatar May 24 '21 14:05 KoljaWindeler

The radio option for playlists doesn't work for me too.

First, here is what the log tells me to copy paste here:

Traceback (most recent call last):
File "/config/custom_components/ytube_music_player/media_player.py", line 1346,
  in async_play_media self._tracks = await self.hass.async_add_executor_job(self._api.get_playlist,media_id)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57,
  in run result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 67,
  in get_playlist results = nav(response,
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 155,
  in nav raise err
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 149,
  in nav root = root[k]
KeyError: 'contents' 

I'm trying to play a radio generated from this playlist: "https://music.youtube.com/playlist?list=RDCLAK5uy_nrtPJ8fc1sQkHJ_fT0qZlrJ0t8IoDfP0Q"

I'm doing that by calling the home assistant services media_player.select_source to select the correct speaker, then I'm calling media_player.play_media with the following data:

{
  "media_content_id":"RDCLAK5uy_nrtPJ8fc1sQkHJ_fT0qZlrJ0t8IoDfP0Q",
  "media_content_type":"channel"
}

If I replace the media_content_type "channel" with "playlist" the player does start playing the playlist.

Edit: Updated the comment as I was calling the play_media service in a wrong way.

martiesim avatar Jun 11 '21 01:06 martiesim

hi, I've just tested:

service: media_player.play_media
data:
  media_content_id: RDCLAK5uy_nrtPJ8fc1sQkHJ_fT0qZlrJ0t8IoDfP0Q
  media_content_type: playlist
target:
  entity_id: media_player.ytube_music_player_keller

led to tracks:

  • AES Dana - Iris Rotation
  • Chronos - Sequenced Engine
  • Solar Fields - Union Light
  • Bluetech - Wilderness
  • Slackbaba - Fortean Thieves (Original Mix) (feat. Aliji)
  • Entheogenic - Ground Luminosity ("Ott's New Yoghurt Loom" Mix)
  • Asura - Back to Light
  • Desert Dwellers - Wandering Sadhu
  • Koan - Matariki
  • Vibrasphere - Floating Free (Krama Remix)
  • Bluetech - Oleander (Phutureprimitive Symbiotic Remix)
  • Koan - Rainfall (feat. Krusseldorf)
  • Ott - The Queen of All Everything
  • Entheogenic - Ground Luminosity
  • Koan - Sirens Original Mix
  • Bluetech - Prayers For Rain
  • Bluetech - Enter the Lovely
  • H.U.V.A. Network - Indigo Room
  • Easily Embarrassed - Time Holes
  • Zero Cult - Till the Morning
  • Kick Bong - Landscape
  • Koan - Where the Street Have No Name
  • Solar Fields - Discovering
  • Chronos - Step By Step
  • Ott - The Aubergine of the Sun
  • Koan - The Island Of Deceased Ships
  • ENTHEOGENIC - Sideways
  • Androcell - Plant Life
  • Ott - A Shower of Sparks
  • Solar Fields - Circles Of Motion
  • Ott - Splitting an Atom
  • Ott - Cley Hill
  • Androcell - Dub Crystals
  • The Orb - Little Fluffy Clouds
  • Kliment - Fairdreamers
  • Kick Bong - Flower Power
  • Bluetech - Probability Tree
  • Mystical Sun - Waters of Life
  • Astropilot - Veda (feat. Mikrokosmos)
  • Abakus - Igmatik
  • Entheogenic - Light Ocean Blue
  • Tripswitch - Silver (Robot Baby Mix)
  • Kalya Scintilla - Rises in the East

and replacing 'playlist' with 'channel' led to

total_tracks: 25 tracks: - Kliment - Fairdreamers - Nibana - The Most Astounding Fact - Desert Dwellers - Crossing the Desert - Carbon Based Lifeforms - 20 Minutes - Carbon Based Lifeforms - Supersede - Ott - A Shower of Sparks - Solar Fields - Discovering - Suduaya - Patience - Asura - Altered State (Album Edit) - Connect.Ohm - Snow Park - Connect.Ohm - 9980 - Koan - Rainfall (feat. Krusseldorf) - Asura - Atlantis Child - Vibrasphere - Northern Sunsets - Bluetech - Wilderness - H.U.V.A. Network - Indigo Room - Koan - The Island Of Deceased Ships - Koan - Selena`s Song - Dreaming Cooper - The Water Element - Koan - Underwater Moonlight (green Mix) - Koan - Dance The Nereids - Lauge - Vandringen - Koan - Matariki - Vibrasphere - peace of mind - Chronos - Step By Step _radio_based: Koan - Rainfall (feat. Krusseldorf)

the 'contents' errors are usually problems with the cookie. is your media_browser showing your library?

KoljaWindeler avatar Jun 17 '21 12:06 KoljaWindeler

Hello, yes it is showing my library. Everything seems to be working exept the radio functionality. If it's a cookie problem, I'll just wait for the login option you are working on :)

martiesim avatar Jun 17 '21 12:06 martiesim

Not sure if this is the right thread but changing playlist from the dropdown does not work for me too. Has anyone figured out how to make that work?

tgooro avatar Jul 25 '21 23:07 tgooro

This is not the way how the drop down is suppose to work. I'd recommend using the media_browser and creating shortcuts in combination with the Mini-Media-Player (see readme)

KoljaWindeler avatar Jul 26 '21 06:07 KoljaWindeler

Hi! I have just added your ytube player to my HA. I am able to see the player, and I can see my playlists, but they do not play and when I try to turn the player on, it shows me the following error: image

image

any suggestions?

mmatus1112 avatar Jul 31 '21 03:07 mmatus1112

Please read the readme https://github.com/KoljaWindeler/ytube_music_player#dropdowns-buttons-and-marksdowns

KoljaWindeler avatar Jul 31 '21 06:07 KoljaWindeler

sorry but I am not an expert in programming, nor a computer science guy. The instructions are kind of vague for a beginner like me :S I was able to install the miniplayer but I can't finde the "readme" places where to put all that. Can you provide more precise instructions?

mmatus1112 avatar Jul 31 '21 15:07 mmatus1112

Did you watch the videos ? https://github.com/KoljaWindeler/ytube_music_player#step---by---step-guide

KoljaWindeler avatar Jul 31 '21 15:07 KoljaWindeler

An interesting thing, there was an update today and I was able to play the playlists with no issue! After that, I watched the videos and I was able to put the buttons in the mini player! Awesome!

mmatus1112 avatar Jul 31 '21 16:07 mmatus1112