YouTube Livestream

Aren't they on Pluto or is Pluto a US thing only?

youtube-dl is your friend for finding streaming urls for things.

The only news on Pluto UK is Cheddar.

As the devs already suggested, the easiest way to do this is to use youtube-dl (or streamlink) in some way. I've used both in Docker containers to get YouTube streams into Channels.

If you're looking for a non-Docker solution, I've also successfully used a simple script with youtube-dl and set it as a scheduled task on my Synology every 3 hours to save the stream URL to a local file, which I then point Channels to. This works because the stream URLs typically don't expire for at least 4-5 hours.

3 Likes

hmm, I seem to get the below error when installing to docker on raspberrypi - is there a pi version?

standard_init_linux.go:219: exec user process caused: exec format error

Hi all,
i'm clearly not at the level many are but i know enough that if i can generate or get a m3u i can get it to work in channels as a channel for me. this i came upon and this would be my holy grail of channels it has real time live ATC and ADSB data funneled through ms flight sim to generate this "simulated environment" in real time with real liveries and real atc.
can anyone convert and send me m3u? or "it doesnt work that way bub" here is step by step for you...???? thanks in advance....
i would simply like to view this on my tv within channels but since it has audio and data streaming (you will see as soon as you watch...) it just seems uber cool to me...
LAX AIRPORT 24/7 | Secondary View - YouTube

Would you be able to provide the script and instructions for how you can schedule this task? I have a stream link as well that changes every several hours and right now all I know what to do is go get the new link every time it updates and paste it in my Channels custom channel settings. I am using Windows though so I’m not sure if that will work. I do have Docker Desktop for Windows running with some very basic knowledge and have the Pluto and Stirr containers running successfully. Appreciate any help you can offer.

I use a scheduled windows batch file that funs every two hours using ffmpeg with the -f and -g switches to grab the m3u

You mean youtube-dl, not ffmpeg? :wink:

Yes Youtube-dl. I have the Youtube-dl executable in my ffmpeg folder. Why? Just because. :blush:

Here's what I have. I basically just overwrite the m3u8 every 3 hours, probably similar to what @meitis is doing.

printf '#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2560000\n' > /volume1/web/m3u/FILENAME.m3u8 | youtube-dl -g 'https://www.youtube.com/watch?v=xxxxxxxx' >> /volume1/web/m3u/FILENAME.m3u8
2 Likes

Wow! Thanks for this info! So, do I simply need to create a windows batch file then (.bat) containing this code you just posted and then set windows task manager to run it every 2,3,4 hours, or whatever?

2 Likes

Hopefully yes! I haven't run Windows on my personal machines in years but you should be able to use that code (or very similar to it, there might be some syntax differences?) to refresh the URL in a local m3u8 file. And then use a path to that file in your custom channels config in Channels DVR.

In my testing I got 4+ hours before a YouTube stream URL expired, so 3 hours should be sufficient. You can always change your config and refresh it more frequently if they change things around.

1 Like

Fantastic! Can't thank you enough for your help with this!

2 Likes

So simple and easy to use for YouTube live streams! Thank you!

1 Like

Could you post an example of your m3u8 that works for a livestream? I'm having problems getting to work using the example posted in Youtube Livestream - #15 by alai

This is the error I get when trying to create the custom channel.

This is what the m3u8 file looks like after getting the URLs from the "youtube-dl -g" command on the YT livestream URL. Note long URL is truncated.

You're mixing up m3u and m3u8

In the custom channel you still need a m3u pointing to the m3u8

If you want record Sky News stream from You Tube stream I do following for 1 hour:

/usr/local/bin/ffmpeg -i `/usr/local/bin/youtube-dl -g https://www.youtube.com/watch\?v\=9Auq9mYxFEE` -c copy -t 3600 -f mpegts /Users/sebastian/SkyNewsoutput.mpg

Okay I’ll ask :smile:

I don’t suppose there’s any chance devs will consider building this in? VLC supports reading YouTube watch urls for example

Edit: I guess OP already asked and implicit answer was no

alright i struggled with this a bit but read up about HLS here: HTTP Live Streaming: HSL Player for Android | Toptal and got channels to work with hlstube. in case it wasn't obvious to anyone else...

hlstube serves up what is referred to in that toptal article as a "media playlist" (as opposed to a "master playlist"). channels wants a "master playlist". so when you go to add your custom channel, choose "Text" for source, not "URL" ...and put just the hlstube url (i.e., localhost:8080/_/https://www.youtube.com/watch?v=sOmEvIdEoID) in the text box. you can add #EXTM3U headers as well but i didn't find it to be necessary.

thanks for the suggestion @tmm1!

edit: fixed url example