I’ve been playing around with media extractor quite successfully over the last few weeks, but all of a sudden its no longer streaming any audio, this is the code thats calling it:-
File "/usr/src/homeassistant/homeassistant/components/media_extractor/__init__.py", line 269, in get_best_stream
return cast(str, formats[len(formats) - 1]["url"])
~~~~~~~^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
If you’re sure that the media_content_id you’re referencing is valid (try it on a different computer than the one that generated the URL, if possible) and you’re on the latest version of HA, consider submitting a bug report.
media_content_id is definitely valid, I have tried the resultant URL by pasting it into a browser and it appears to display the correct youtube page with the video I am expecting.
I’ve also tried several other URLs, all generate the same error. (And quotes made no difference, and they also get removed if you use the UI to generate the yaml).
Reading this thread:-
It feels like its a cat and mouse game between yt-dlp and youtube.
I’ve been following this thread about the Media Extractor issues, and I believe I’ve found the likely cause and some supporting evidence. It seems very probable that a YouTube update around March 24th is what broke things.
Here’s why I think this, based on information I’ve gathered:
yt-dlp Updates: For those who don’t know, yt-dlp is a command-line video/audio downloader that media_extractor relies on. yt-dlp released two significant updates very recently:
Version 2025.03.25 (March 25th): This release specifically includes fixes for YouTube related issues, such as “Fix signature and nsig extraction for player 363db69b (#12725)” and “Fix PhantomJS nsig fallback (#12728)”. This clearly indicates YouTube changed something in their player around March 24th , breaking the signature extraction process that yt-dlp (and therefore media_extractor) depends on.
Version 2025.03.26 (March 26th): While the specific changelog details aren’t fully available, it’s highly likely this release contains further fixes related to the same YouTube update.
These rapid releases from yt-dlp strongly suggest they are reacting to a recent and breaking change from YouTube.
Reports of Issues on March 24th: Adding further weight to this theory, there are reports from March 24th (the same day as the likely YouTube update!) indicating that audio streaming from YouTube is no longer working with media_extractor.play_media and showing errors related to yt-dlp. This timing is extremely consistent with the yt-dlp fixes and points directly to a YouTube-related issue causing the problems we are seeing with Media Extractor.
GitHub Discussion: The GitHub pull request for yt-dlp (#12725) mentioned above provides even more technical detail. It confirms the failed nsig extraction for YouTube player version 363db69b and includes specific error details like KeyError(‘Yv’). This further solidifies that YouTube did indeed update their player and break compatibility.
In conclusion:
While we can’t be 100% certain without official confirmation from YouTube or the Home Assistant developers, all the evidence strongly points to a YouTube player update around March 24th as the root cause of the Media Extractor issues. yt-dlp, the underlying tool, has already released patches to address this.
Hopefully, this information is helpful. It might be worth checking if updating yt-dlp (if possible within the Home Assistant environment, I’m not sure how that works exactly) could resolve the issue for some users.
Let me know if you have any other thoughts or information!
Just wanted to provide an update regarding the issue with Media Extractor and YouTube playback that some of us were experiencing.
I can confirm that after installing the beta version 2025.4.0b0, the problem has been resolved and YouTube URLs are playing correctly again.
For those of you still encountering this issue, you have two options:
Install the beta version of Home Assistant (2025.4.0b0 or later): This will give you the fix immediately. Please be aware that beta versions might contain other minor issues.
Wait for the next stable release of Home Assistant: The fix that is currently in the beta will be included in the next stable update.