KoljaWindeler / ytube_music_player

YouTube music player for homeassistant
337 stars 53 forks source link

Plays no music. Logs show "410 Gone" #238

Closed martiesim closed 8 months ago

martiesim commented 1 year ago

Enable DEBUG Output

2023-03-29 12:35:49.503 ERROR (MainThread) [custom_components.ytube_music_player.media_player] Posting debug messages as error until restart
2023-03-29 12:35:49.504 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [E] async_call_method
2023-03-29 12:36:06.439 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_select_source(media_player.group_all_speakers)
2023-03-29 12:36:06.440 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_update_remote_player(Input media_player.group_all_speakers/ current media_player.group_all_speakers) 
2023-03-29 12:36:06.442 ERROR (MainThread) [custom_components.ytube_music_player.media_player]  no change [E]
2023-03-29 12:36:06.443 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Choosing media_player.group_all_speakers as player
2023-03-29 12:36:06.445 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [E] async_select_source
2023-03-29 12:36:06.477 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] play_media, media_type: playlist, media_id: LM
2023-03-29 12:36:06.479 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_prepare_play
2023-03-29 12:36:06.481 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E]
2023-03-29 12:36:06.482 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_update_remote_player(Input / current media_player.group_all_speakers)  [E]
2023-03-29 12:36:06.484 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_turn_on_media_player [E]
2023-03-29 12:36:07.564 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_cipher [E]
2023-03-29 12:36:07.565 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [E] async_prepare_play
2023-03-29 12:36:07.901 ERROR (MainThread) [custom_components.ytube_music_player.media_player] get_playlist(playlistId=LM)
2023-03-29 12:36:07.902 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - shuffle new tracklist
2023-03-29 12:36:07.903 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] _tracks_to_attribute
2023-03-29 12:36:07.904 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_update_extra_sensor [E]
2023-03-29 12:36:07.906 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_update_extra_sensor [E]
2023-03-29 12:36:07.907 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [E] _tracks_to_attribute
2023-03-29 12:36:07.908 ERROR (MainThread) [custom_components.ytube_music_player.media_player] _play
2023-03-29 12:36:07.910 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_track
2023-03-29 12:36:07.912 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Playing track nr 1 / 25
2023-03-29 12:36:07.914 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_url
2023-03-29 12:36:07.916 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E]
2023-03-29 12:36:07.918 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - try to find URL on our own
2023-03-29 12:36:08.039 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - self decoded URL via cipher
2023-03-29 12:36:08.113 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - decoded url return 403 status code
2023-03-29 12:36:08.115 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - updating signature Timestamp and try again
2023-03-29 12:36:09.162 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_url
2023-03-29 12:36:09.162 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E]
2023-03-29 12:36:09.163 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - try to find URL on our own
2023-03-29 12:36:09.295 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - self decoded URL via cipher
2023-03-29 12:36:09.364 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - decoded url return 403 status code
2023-03-29 12:36:09.365 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - giving up, maybe pyTube can help
2023-03-29 12:36:09.981 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_sync_player ... media_player.group_all_speakers: off -> idle ... not playing [E]
2023-03-29 12:36:10.028 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_sync_player ... media_player.group_all_speakers: idle -> idle ... not playing [E]
2023-03-29 12:36:10.437 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Failed to get URL with YouTube methode
2023-03-29 12:36:10.438 ERROR (MainThread) [custom_components.ytube_music_player.media_player] HTTP Error 410: Gone
2023-03-29 12:36:10.438 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Retry with: (3)
2023-03-29 12:36:10.439 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_track
2023-03-29 12:36:10.440 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Playing track nr 2 / 25
2023-03-29 12:36:10.442 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_url
2023-03-29 12:36:10.447 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E]
2023-03-29 12:36:10.448 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - try to find URL on our own
2023-03-29 12:36:10.561 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - self decoded URL via cipher
2023-03-29 12:36:10.630 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - decoded url return 403 status code
2023-03-29 12:36:10.631 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - updating signature Timestamp and try again
2023-03-29 12:36:11.705 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_url
2023-03-29 12:36:11.706 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E]
2023-03-29 12:36:11.707 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - try to find URL on our own
2023-03-29 12:36:11.828 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - self decoded URL via cipher
2023-03-29 12:36:11.903 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - decoded url return 403 status code
2023-03-29 12:36:11.905 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - giving up, maybe pyTube can help
2023-03-29 12:36:13.041 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Failed to get URL with YouTube methode
2023-03-29 12:36:13.042 ERROR (MainThread) [custom_components.ytube_music_player.media_player] HTTP Error 410: Gone
2023-03-29 12:36:13.042 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Retry with: (2)
2023-03-29 12:36:13.043 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_track
2023-03-29 12:36:13.044 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Playing track nr 3 / 25
2023-03-29 12:36:13.045 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_url
2023-03-29 12:36:13.050 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E]
2023-03-29 12:36:13.051 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - try to find URL on our own
2023-03-29 12:36:13.179 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - self decoded URL via cipher
2023-03-29 12:36:13.249 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - decoded url return 403 status code
2023-03-29 12:36:13.250 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - updating signature Timestamp and try again
2023-03-29 12:36:14.146 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_url
2023-03-29 12:36:14.147 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E]
2023-03-29 12:36:14.150 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - try to find URL on our own
2023-03-29 12:36:14.252 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - self decoded URL via cipher
2023-03-29 12:36:14.321 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - decoded url return 403 status code
2023-03-29 12:36:14.323 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - giving up, maybe pyTube can help
2023-03-29 12:36:15.439 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Failed to get URL with YouTube methode
2023-03-29 12:36:15.440 ERROR (MainThread) [custom_components.ytube_music_player.media_player] HTTP Error 410: Gone
2023-03-29 12:36:15.441 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Retry with: (1)
2023-03-29 12:36:15.441 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_track
2023-03-29 12:36:15.442 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Playing track nr 4 / 25
2023-03-29 12:36:15.444 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_url
2023-03-29 12:36:15.446 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E]
2023-03-29 12:36:15.454 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - try to find URL on our own
2023-03-29 12:36:15.605 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - self decoded URL via cipher
2023-03-29 12:36:15.671 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - decoded url return 403 status code
2023-03-29 12:36:15.672 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - updating signature Timestamp and try again
2023-03-29 12:36:16.683 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_url
2023-03-29 12:36:16.684 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E]
2023-03-29 12:36:16.685 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - try to find URL on our own
2023-03-29 12:36:16.814 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - self decoded URL via cipher
2023-03-29 12:36:16.893 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - decoded url return 403 status code
2023-03-29 12:36:16.894 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - giving up, maybe pyTube can help
2023-03-29 12:36:18.089 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Failed to get URL with YouTube methode
2023-03-29 12:36:18.090 ERROR (MainThread) [custom_components.ytube_music_player.media_player] HTTP Error 410: Gone
2023-03-29 12:36:18.091 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - get track failed to return URL, turning off
2023-03-29 12:36:18.092 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [S] async_turn_off_media_player [E]
2023-03-29 12:36:18.099 ERROR (MainThread) [custom_components.ytube_music_player.media_player] [E] play_media

Describe the bug I can no longer play music. Yesterday the player played 1 song and then stopped. Since then I can no longer play anything. I already tried re-copying the cookie data.

Version hacs doesn't show any information about outstanding updates so I guess the latest one

To Reproduce Try to play any media from youtube.

Additional context I control the player entity via node red but I also tested manually and the problem is the same. It doesn't matter if node red tells the player to play a playlist or if I select it through the media screen.

Thanks

KoljaWindeler commented 1 year ago

I had the exact same issue and after a day or maybe a reboot it worked again .. no idea what the problem is to be honest Jkw

chicagoandy commented 1 year ago

Getting this today as well.

flecmart commented 1 year ago

I have the same problem. The only music I can play is music that I uploaded myself.

jurgenweber commented 1 year ago

I am getting this now, I retried the cookie, restarting, redownloading in HACS... I then noticed a partition one my machine had run out of space, So I made some, restarted, etc, etc.

Still have this

2023-04-11 22:23:03.040 ERROR (MainThread) [custom_components.ytube_music_player.media_player] HTTP Error 410: Gone
2023-04-11 22:23:03.041 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Retry with: (1)
2023-04-11 22:23:06.955 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Failed to get URL with YouTube methode
2023-04-11 22:23:06.959 ERROR (MainThread) [custom_components.ytube_music_player.media_player] HTTP Error 410: Gone
jurgenweber commented 1 year ago

So, my full error when I try to play is

2023-04-12 16:52:49.080 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Failed to get URL with YouTube methode
2023-04-12 16:52:49.112 ERROR (MainThread) [custom_components.ytube_music_player.media_player] HTTP Error 410: Gone
2023-04-12 16:52:49.118 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Retry with: (3)
2023-04-12 16:52:54.073 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Failed to get URL with YouTube methode
2023-04-12 16:52:54.079 ERROR (MainThread) [custom_components.ytube_music_player.media_player] HTTP Error 410: Gone
2023-04-12 16:52:54.081 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Retry with: (2)
2023-04-12 16:53:00.387 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Failed to get URL with YouTube methode
2023-04-12 16:53:00.390 ERROR (MainThread) [custom_components.ytube_music_player.media_player] HTTP Error 410: Gone
2023-04-12 16:53:00.393 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Retry with: (1)
2023-04-12 16:53:05.311 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - Failed to get URL with YouTube methode
2023-04-12 16:53:05.314 ERROR (MainThread) [custom_components.ytube_music_player.media_player] HTTP Error 410: Gone
2023-04-12 16:53:05.329 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall media_player.turn_off (c:randomstringthatlookslikeanID): entity_id=['media_player.office_vlc_speaker']>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1838, in catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1857, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 216, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 775, in entity_service_call
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Entity media_player.office_vlc_speaker does not support this service.

Now, what I find interesting is.. Is that if you go into media and select the player, it works fine. So its not hte cookie or something like that. I can browse all my playlists and things.

oh, great. Now it works (I went and chose an 'album in my library' and played something). haha. I got nothing, because those errors are after a restart and a retry... Came back at

2023-04-12 17:47:42.592 ERROR (MainThread) [frontend.js.latest.202304061] :0:0 Script error.

works fine again now.. :\

benblb commented 1 year ago

I have this same issue. Deleting the integration (not HACS component, but HA integration) and immediately re-adding with the same cookie fixes the issue for a while.

Edit: Seems I can play my playlist one time, but once I stop it and try again, it won't let me restart playback. I have to remove and re-add the integration each time.

jurgen-weber-deltatre commented 1 year ago

yeah, this keeps coming and going. It is super annoying. The http error sort of implies its a youtube music probem: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/410

martiesim commented 1 year ago

An additional problems started to occur for me where - when it did play - it only ever played the same 25 songs over and over again. Since that is exactly the limit mentioned in the last question of the FAQ, I tried setting it to something higher. I set it to 5000 so my whole playlist can be loaded and that also fixed this 410 problem for me. I don't know why, but maybe it's a work-around for others too :)

jurgenweber commented 1 year ago

Yeah, tried that just in case..... it worked for a song, actually.. This morning it seems that only Rammstein will play, everything else I get the 410. It is just weird.

I also tried updating the ytmusicapi library that is used to 0.25.2 and restarting which didn't seem to help, well actually it kinda did. Rammstein now works.

jurgenweber commented 1 year ago

I found this today; https://github.com/ytdl-org/youtube-dl/issues/30019 but I have no idea what to do about it. :)

jurgenweber commented 1 year ago

Yeah, this errors comes and goes.. IT is super annoying, but again.. RIght now.. It only plays Rammstein but I Can see it trying to play other songs and failing with the 410 error.

jurgenweber commented 1 year ago

I posted in the you tube music api library that this integration uses, hopefully it can shed some light.

sigma67 commented 1 year ago

It's a server-side issue. I'd argue that ytmusicapi has nothing to do with it. It's either something you can't fix because it's Google's fault, or it's an issue with the implementation of playing music in this project ytube_music_player.

If you do manage to identify the root cause and it's indeed an issue with ytmusicapi, feel free to open another issue.

jurgenweber commented 1 year ago

yeah, thought you might say something like that. :)

jurgenweber commented 1 year ago

Ok, so I have been able to work some stuff out and I have been able to make it a lot more stable. So context and information on my setup/what I am doing.

So, I have a speaker which is dumb. So I have a Raspberry PI connected to it, using the Pi's 3.5m AUX audio jack to the speaker. The Pi has VLC running on it in telnet mode and I am using the VLC Telnet integration (https://www.home-assistant.io/integrations/vlc_telnet/)

So my playing issues when I was getting the 410 were varied, the Pi has hardware connectivity issues (the ethernet cable fell out a bit), (and I would get a 410) the Pi was randomly peaking to very high CPU and IOWait (and I would get a 410), solve this with a journald change.

I also tried a variety of other things (because I found it very weird when a lot of the time only Rammstein would play), so I thought it was maybe a rate limiting or a licensing issue. So I now ensure no other devices are playing when this speaker is playing, I also ensure that this speaker stops playing/only plays while I am in the room. I also removed my youtube music integration from my SONOS.

I also had some pretty aggressive automation triggers that would just restart the playing lots which I don't think was helping my cause either. :)

The SONOS and the journald 'things' I completed 3 days ago and I have not had the 410's since.. YAY, but I have a new error that I see in the VLC logs/on the Pi which I find very odd. This seems to happen very rarely, but when it does happen the media_player.ytube_music_player entity remains in a 'playing' state but the VLC speaker goes idle.. in general both have the same state.

Aug 19 11:36:11 warvm-pi221 vlc[5762]: outgoing request:#012GET /videoplayback?expire=1692466571&ei=XXX&ip=124.168.166.109&id=o-XXX&itag=140&source=youtube&requiressl=yes&mh=-w&mm=31%2C29&mn=sn-u2bpouxgoxu-ntqk%2Csn-ntqe6nez&ms=au%2Crdu&mv=m&mvi=6&pl=19&ctier=A&pfa=5&pcm2=no&initcwndbps=1812500&hightc=yes&siu=1&spc=XXX&vprv=1&svpuc=1&mime=audio%2Fmp4&ns=XXX&gir=yes&clen=2660936&dur=164.374&lmt=1687119223080155&mt=1692444552&fvip=2&keepalive=yes&fexp=24007246%2C51000024&c=WEB_REMIX&txp=5318224&n=rviZp5usCwvpM8Bus4&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cctier%2Cpfa%2Cpcm2%2Chightc%2Csiu%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=XXX-XXX-XXX-tZfhuIEEBqA6gX5A%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=XXX--XXX-8GPF1LJa2eeoW_5UA5bTA%3D%3D HTTP/1.1#015#012Host: rr6---sn-u2bpouxgoxu-ntqk.googlevideo.com#015#012Accept: */*#015#012Accept-Language: en_US#015#012User-Agent: VLC/3.0.18 LibVLC/3.0.18#015#012Range: bytes=0-
Aug 19 11:36:11 warvm-pi221 vlc[5762]: incoming response:#012HTTP/1.1 403 Forbidden#015#012Last-Modified: Wed, 02 May 2007 10:26:10 GMT#015#012Content-Type: text/plain#015#012Content-Length: 0#015#012Connection: close#015#012Vary: Origin#015#012Cross-Origin-Resource-Policy: cross-origin#015#012X-Content-Type-Options: nosniff#015#012Date: Sat, 19 Aug 2023 11:36:11 GMT#015#012Server: gvs 1.0
Aug 19 11:36:11 warvm-pi221 vlc[5762]: HTTP 403 error
Aug 19 11:36:11 warvm-pi221 vlc[5762]: connection failed
Aug 19 11:36:11 warvm-pi221 vlc[5762]: no access modules matched
Aug 19 11:36:11 warvm-pi221 vlc[5762]: Your input can't be opened
Aug 19 11:36:11 warvm-pi221 vlc[5762]: VLC is unable to open the MRL 'https://rr6---sn-u2bpouxgoxu-ntqk.googlevideo.com/videoplayback?expire=1692466571&ei=XXX&ip=124.168.166.109&id=o-XXX&itag=140&source=youtube&requiressl=yes&mh=-w&mm=31%2C29&mn=sn-u2bpouxgoxu-ntqk%2Csn-ntqe6nez&ms=au%2Crdu&mv=m&mvi=6&pl=19&ctier=A&pfa=5&pcm2=no&initcwndbps=1812500&hightc=yes&siu=1&spc=XXX&vprv=1&svpuc=1&mime=audio%2Fmp4&ns=XXX&gir=yes&clen=2660936&dur=164.374&lmt=1687119223080155&mt=1692444552&fvip=2&keepalive=yes&fexp=24007246%2C51000024&c=WEB_REMIX&txp=5318224&n=rviZp5usCwvpM8Bus4&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cctier%2Cpfa%2Cpcm2%2Chightc%2Csiu%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=XXX-XXX-6GAiBOSthOkJ10zd1GDpKsE0OQpjisK-tZfhuIEEBqA6gX5A%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=XXX--XXX-8GPF1LJa2eeoW_5UA5bTA%3D%3D'. Check the log for details.

Yeah, so randomly it is returning a 403, let me know if I should create another ticket for it.

dongore commented 11 months ago

This is supposed to be fixed with PyTube 11.0.1+ (https://github.com/pytube/pytube/issues/1113) I didn't check for breaking changes, but this could be fixed by a dependency update.

KoljaWindeler commented 8 months ago

hi, today the gone error appears for the first time also for me .. yeah. So I was able to test around a little. Turns out that re-re-re questing the song most of the time worked .. but was not very stable. I'm not retesting it up to 60x I've then added a quality ranking .. so the first 10 requests will go the the URL with the highest bitrate .. that made it better.

but the final trick was to reload the javascript on every retry .. not sure why this differs, but this works very consistent for me .. usually after the 3rd try it works flawless .. so best quality and quick turnaround .. not sure why, but once the new cipher is loaded (from the javascript) it looks like it is working on the first try for all other songs after that ..

give it a try and please provide feedback :)

jurgenweber commented 8 months ago

Ok, how do I 'reload the javascript'?

KoljaWindeler commented 8 months ago

You don't, the integration does it in the background for you

Edit: It pulls the JavaScript file from the YouTube server that is needed to decipher the URL .. not sure if that script is changing very often at that point ... Please try the new version and let me know if it works for you as well

KoljaWindeler commented 8 months ago

Any update?

jurgenweber commented 8 months ago

the 410's are mostly gone, but I sometimes get this which is new

2024-02-05 07:54:39.846 ERROR (MainThread) [custom_components.ytube_music_player.media_player] - decoded url return 403 status code, attempt 60/60

This is the log from HASS, I have not checked the pi/VLC

XalaTheShepard commented 8 months ago

The latest update of the integration causes a lot of stuttering. Approximately 6 times per minute the songs are for several seconds or even sometimes some minutes interrupted. This issue was so annoying that I reverted back to the previous version of the integration which does not have the stuttering issue. In the other issue, I have provided the logs.

KoljaWindeler commented 8 months ago

Well it looks like the gone disappeared with this method. I'll close this ticket

Edit: 403 and 410 are the same (I know they are not, but one API is responding with 403 the other with 410, same issue) So whenever you see that message with the 403 you see the workaround in action