ffmpeg and yt-dlp should be able to parse the m3u8, download all segments and stitch them together automatically for you, but I don't know how to make it work. Every request gets 404'd by the host, no matter what http headers I set.
Here's how I did it:
Parse the .m3u8 file using whatever language you prefer. Skip the lines starting with '#' and download all the segments. Remember that you might have to set some http headers (user agent, origin and host) in order for mediafront not to block your request.
Create a .txt file containing all the file names. For example, if you've downloaded
seg-1-v1-a1.ts and
seg-2-v1-a1.ts then print
file 'seg-1-v1-a1.ts'
,
file 'seg-2-v1-a1.ts'
, and so on, to filelist.txt.
Once you've downloaded all the segments and have your .txt file ready, run ffmpeg with
ffmpeg -f concat -i filelist.txt -c copy out.ts
and then one more time with
ffmpeg -i out.ts -acodec copy -vcodec copy out.mp4
.
Maybe someone who's better at ffmpeg knows how to convert it to mp4 in one pass, but I couldn't get it work without fucking up audio and seeking.