I’m trying to use the scrape sensor to extract the daily changing mp4 URL of a news show to automatically play it to my chromecast.
What I want to extract ist the part included in content="…"
What I want to do with it: I want to use the URL saved in the variable / name “TagesschauIn100Sekunden” and want it to be used as the media_content_id to cast it to my TV
- service: media_player.play_media
entity_id: media_player.chromecast
data:
media_content_id: TagesschauIn100Sekunden
media_content_type: video
EDIT: I now know that I could select the specific meta tag like this head > meta:nth-child(24) but doing it like that may not always work as it may not always be the 24th child and I don’t know how to access the content="" part of the element
Sorry it took me so long to respond.
Here is my current automation using media_extractor:
- alias: "Tagesschau in 100 Sekunden"
trigger:
platform: state
entity_id: device_tracker.Phone
to: "home"
action:
- service: media_extractor.play_media
entity_id: media_player.TV
data:
media_content_id: "http://www.tagesschau.de/100sekunden/index.html"
media_content_type: video
- alias: "Tagesschau normal"
trigger:
platform: state
entity_id: device_tracker.Phone
to: "home"
action:
- service: media_extractor.play_media
entity_id: media_player.TV
data:
media_content_id: "http://www.tagesschau.de/sendung/letzte-sendung/index.html"
media_content_type: video
This is currently a very basic implementation that needs more refined triggers. But the main intent, extracting the link from the URL and casting it works perfectly fine.
Yes it does start playing right on the TV. I don’t think that Media Extractor downloads the video but it passes the video URL to the chromecast. The chromecast starts streaming.
Unfortunately, I can’t help you with the chromecast audio.
thats exactly what I searched for Tagesschau thanks for sharing! Is it maybe also possible with the media extractor to send Youtube Playlists to my TV?