How do I download a streamable media segment using a .m3u8 "playlist"?

1

I'm trying to download an (audio) clip which is available on some website. When I monitor network traffic, I notice the following file is downloaded:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=81400,RESOLUTION=360x240
chunklist_w413399134_b74000_pd6918000.m3u8?ttl=1499450811&cdn_token=c3e719c20573d5ff1daa0d4e165bc830

and the chunklist file contains:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:11
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10.3,
media_w1424738972_b74000_pd6918000_0.ts?ttl=1499450811&cdn_token=c3e719c20573d5ff1daa0d4e165bc830
#EXTINF:9.0,
media_w1424738972_b74000_pd6918000_1.ts?ttl=1499450811&cdn_token=c3e719c20573d5ff1daa0d4e165bc830
#EXTINF:9.0,
media_w1424738972_b74000_pd6918000_2.ts?ttl=1499450811&cdn_token=c3e719c20573d5ff1daa0d4e165bc830
#EXTINF:9.0,
media_w1424738972_b74000_pd6918000_3.ts?ttl=1499450811&cdn_token=c3e719c20573d5ff1daa0d4e165

... and so on and so forth, about 750 pairs of these lines. Each of these .ts files is a binary, and it's type seems to be:

$ file media_w1424738972_b74000_pd6918000_2.ts 
media_w1424738972_b74000_pd6918000_2.ts: MPEG transport stream data

How do I get the entire clip as a single file? Should I just use a script to wget all these files and concatenate them? Or apply an MPEG splicer ceil(log(750)) times? Or is there something else I can do?

einpoklum

Posted 2017-07-06T18:15:06.397

Reputation: 5 032

Just use ffmpeg. – szatmary – 2017-07-07T12:26:25.673

@szatmary: Can you be more specific please? I'm not experienced with these sorts of things. – einpoklum – 2017-07-07T12:28:17.723

Google will be way more specific that I ever could be. Did you try to search for "ffmpeg download m3u8" – szatmary – 2017-07-07T12:30:02.273

No answers