How to play Youtube livestream on Chromecast with media_extractor?

I cannot seem to play a Youtube livestream (e.g. https://youtu.be/tPE4wv7ob8Q) on Chromecast using the media_extractor.play_media component.
When I replace the url with a regular Youtube video HA does play without any issues.

Is my media_content_type incorrect maybe? Any help appriciated.

My configuration.yaml:

media_extractor:

My automation.yaml:

  alias: Test
  trigger:
  - entity_id: binary_sensor.switch_158d00020f1bba
    platform: state
    to: 'on'
  action:
  - data:
      media_content_id: https://youtu.be/tPE4wv7ob8Q
      media_content_type: video/youtube
    entity_id:
    - media_player.tv_bedroom
    - media_player.tv_bathroom
    service: media_extractor.play_media

Isn’t the service the first action that needs to call?

That doens’t matter I think. If that’s the issue then a regular Youtube stream wouldn’t load. I guess the problem has to be live streaming video. Any other thoughts?

this indeed looks like a problem with the live videos, i assume due to some issue with the yt-dl that is being used by the media_extractor for “video/youtube” media_type.

probably media_extractor implementation in home-assistant should support also the “is_live” option - see this info:

"is_live (boolean): Whether this video is a live stream or a fixed-length video"

Hi @goprojojo - If i understand the normal youtube link is working but livestream isn’t. I used your config above and tried to play a video but it doesn’t seem to work. I have added a media_player configuration too. Is the above config correct? Should we add a media_extractor section in config?

The above config should still work and you need to include media_extractor too. Try to replace it with a non-livestream url, for example: https://youtu.be/cHHLHGNpCSA

Hmm used it but looks like its still not working. Here’s my configuration. On executing this it gives me a “NotImplementedError”

media_player:

  • platform: braviatv
    host: 192.168.0.197
    name: living

media_extractor:
default_query: best

automation:
trigger:
- platform: time
at: ‘10:29:00’
action:
- service: media_extractor.play_media
data:
media_content_id: “https://youtu.be/cHHLHGNpCSA
media_content_type: video
entity_id:
- media_player.living

Try media_content_type: video/youtube

Nope. Unfortunately its the same error. Btw i am using a dockerized version of HA. So i dont know if its still supported.

Has anyone figured out live streaming? Non-live streams work fine.

Would be interested in casting a youtube live stream as well. Works fine with a regular video but as soon as I use a live stream URL it won’t load.

Any ideas how to solve this issue?

Indeed, would be nice to program a morning scene where the TV powers on and starts playing live news on the chromecast.