How to Download m3u8 stream to local HD in OS X?

The file in question looks like this:

https://example.com/somenumbers/somenumbers/somename.ts.m3u8

The file in question isn't a live stream. It's a recording.

I've tried using the ffmpeg library using various commands but the resulting file was either not downloaded at all due to "corrupted" error, or was downloaded but was heavily corrupted.


Solution 1:

You can use FFmpeg for this.

For example:

$ ffmpeg -user_agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/601.7.8 (KHTML, like Gecko) Version/9.1.3 Safari/537.86.7" -i http://185.38.12.60/sec/1503173737/363333397f6b65370bfc740ca4dea8c3f8dd2a93419f7748/ivs/12/b1/2ec5e15ba2a6/hls/tracks-4,5/index.m3u8 -c copy pd.mkv

User Agent is important key for many online cinema.