[FFmpeg-user] How to extract the video stream m3u8 URL in a script?

Bo Berglund bo.berglund at gmail.com
Mon Oct 10 15:29:36 EEST 2022

I have tried in various places to get a solution to this problem without success
so I try it here too:

I use an Ubuntu 20.04.5 LTS Server (no GUI) to record news shows off of Internet
streams at preprogrammed times.

One stream in particular is a problem because the ffmpeg command used for the
download needs to get the m3u8 URL for the stream and this site has an URL
timeout (about every 5-6 hours), so it has to be retrieved anew quite often.

If I use FireFox and play the video on the site it is possible via the F12 debug
screen to find the very long and Base64 encoded URL.
(Or use a plug-in, see below.)

But then one needs to *manually* do this every 4 hours or so or else lose out on
the video streamed nightly...

I would very much like to have a script that can pull this URL out when given
the URL of the webpage hosting the video player.
Here is the actual website url:

Can someone advice of a command to get hold of it or else direct me to somewhere
else where there are peaople "in the know"?
I have tried the videohelp forum but no solution yet.

There I got a tip for a FireFox add-on, which makes it possible to retrieve the
URL without navigating the F12 debug screen. Just clicking a toolbar button.
That is here:

But again it is a manual way of doing it, I'd rather have a script that can run
5 minutes before start of recording to retrieve a fresh URL.

And it is of course an Ubuntu script I need...

Bo Berglund
Developer in Sweden

More information about the ffmpeg-user mailing list