SVT Play and Chromecast

Hi,
I am trying to start playback of SVT Play channels and programs on my Chromecast from Home Assistant. The Chromecast is connected and I am able to send Text-to-speech to it but I cannot get it to start SVT Play. The reason for this, I believe, is that I am unable to find the URL to the media stream.

Have someone done this? Or can someone give me a hint how to find the URL.

/Henrik

I finally found the URL and got it to work with Home Assistant using this script:

play_svt1_on_chromecast:
  alias: Play SVT1 on Chromecast
  sequence:
  - data:
      entity_id: media_player.chromecast__kok
      media_content_id: https://svt1-b.akamaized.net/se/svt1/master.m3u8
      media_content_type: 'audio/mp4'
    service: media_player.play_media
play_svt2_on_chromecast:
  alias: Play SVT2 on Chromecast
  sequence:
  - data:
      entity_id: media_player.chromecast__kok
      media_content_id: https://svt1-b.akamaized.net/se/svt2/master.m3u8
      media_content_type: 'audio/mp4'
    service: media_player.play_media
3 Likes

Hi Henrik,

Iā€™m hoping youā€™re still active here since the post is quite old.
How did you find the URL to the streaming sites? I would like to have the URL to ā€˜Barnkanalenā€™ but have no clue how to find it

Hi!
Active might be exaggerating but I am still here. :slight_smile: Actually I donā€™t remember exactly how I did it. I do, however, remember that it was a bit of a hassleā€¦ :roll_eyes: I you are a bit techy you can use the debug function in Crome and try to find the URL. If I have time tomorrow Iā€™ll give it a tryā€¦ Have you tried to guess and just edit the URL I am using for SVT2?

Hello, the url to Barnkanalen is https://svt1-b.akamaized.net/se/svtb/master.m3u8

1 Like

Thank you! :blush:
Just for future record and for others to use this, would you please shortly describe how you found the URL?

I actually donā€™t remember how I found out, as it was a while ago. :smile:

Hey, I actually forgot about asking thisā€¦ I found the URL on some other forum and tried it out. Thanks though for your help :slight_smile:

1 Like

I actually donā€™t have google home paired to my home assistant but I guess you can ask google to run a script like above

I havenā€™t paired Google home with hass yet so I can not help you. Tried this tho, seem implemented in Google assistant already. Ludde is my CCast

1 Like

Hello,

This solution has worked fine for me until now, but now the chromecast only plays audio and shows the text ā€œDefault Media Receiverā€. Same for svt1 and barnkanalen and on two different chromecasts.
Has anyone seen the same behavior?

Same for me! Only audio.

I have tried googling it, but didnā€™t find any solutions.
Good that Iā€™m not aloneā€¦ :slightly_smiling_face:

Please let me know if you find a solution!

Finally had some time to look at it, and changing from audio/mp4 to video/mp4 solves the problem.

Weird that audio worked beforeā€¦ :slightly_smiling_face:

I managed to work out how to get the urls for SVT Play.

Install svtplay-dl from https://svtplay-dl.se/
get the url from Svt play web page e.g.

https://www.svtplay.se/video/20259390/morran-och-tobias-som-en-skank-fran-ovan

The -g flag in svtplay-dl gets the url for the file, -P for setting preferred download method

Run
svtplay-dl -g -P DASH https://www.svtplay.se/video/20259390/morran-och-tobias-som-en-skank-fran-ovan
result:
https://svt-vod-5l.akamaized.net/d0/se/20200821/4eecd8dc-7190-4480-96eb-ae5ff10779d9/dash-avc.mpd?alt=https%3A%2F%2Fswitcher.cdn.svt.se%2F4eecd8dc-7190-4480-96eb-ae5ff10779d9%2Fdash-avc.mpd

use the result url to cast

media_content_id: 'https://svt-vod-5l.akamaized.net/d0/se/20200821/4eecd8dc-7190-4480-96eb-ae5ff10779d9/dash-avc.mpd?alt=https%3A%2F%2Fswitcher.cdn.svt.se%2F4eecd8dc-7190-4480-96eb-ae5ff10779d9%2Fdash-avc.mpd'
media_content_type: 'video/mp4'

If there is many episode in a series you can download the urls with the flag -A i.e.

svtplay-dl -g -A -P DASH https://www.svtplay.se/nyheter-direkt
INFO: Episode 1 of 16
INFO: Url: http://www.svtplay.se/video/28260639/nyheter-direkt/flera-skjutna-och-skadade-i-rochester
https://svt-vod-7l.akamaized.net/d0/world/20200919/54c76158-fa5f-4a42-b9f4-1a4a38db0f0d/dash-avc.mpd?alt=https%3A%2F%2Fswitcher.cdn.svt.se%2F54c76158-fa5f-4a42-b9f4-1a4a38db0f0d%2Fdash-avc.mpd
INFO: Episode 2 of 16
.
.

You could probably put this in a script to get the urls in i playlistā€¦

1 Like

Anyone got the new URL to SVT Barn? :slightly_smiling_face:

1 Like

SVT Barnkanalen working today 2021-10-16
https://svtb-c.akamaized.net/se/svtb/manifest.mpd?defaultSubLang=1

type: button
tap_action:
  action: call-service
  service: media_player.play_media
  service_data:
    media_content_type: video/mp4
    media_content_id: https://svtb-c.akamaized.net/se/svtb/manifest.mpd?defaultSubLang=1
  target:
    entity_id: media_player.stora_teven
name: Play Svt Barnkanalen
show_state: false
show_icon: false
show_name: true

How to get streaming urlā€™s using ā€œsvtplay-dlā€.

Swedish;
Hur kan jag streama SVT kanaler (SVT1, SVT2, SVT Barnkanalen, SVT med flera andra kanaler) med hjƤlp av Home Assistant.

Get the program at;

Extract the zipped file into

Open CMD (windows users)
go to the extracted folder, i.e. c:\users[username]\appdata\roaming\svtplay-dl\

run

svtplay-dl -g https://www.svtplay.se/kanaler/svtbarn?start=auto

Peace :dove: :vulcan_salute:

2 Likes