Closed martiesim closed 8 months 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
Getting this today as well.
I have the same problem. The only music I can play is music that I uploaded myself.
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
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.. :\
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.
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
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 :)
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.
I found this today; https://github.com/ytdl-org/youtube-dl/issues/30019 but I have no idea what to do about it. :)
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.
I posted in the you tube music api library that this integration uses, hopefully it can shed some light.
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.
yeah, thought you might say something like that. :)
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.
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.
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 :)
Ok, how do I 'reload the javascript'?
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
Any update?
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
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.
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
Enable DEBUG Output
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