Simple and recommended way (https://superuser.com/questions/692990/use-ffmpeg-copy-codec-to-combine-ts-files-into-a-single-mp4)
The correct way to concat multiple video files from m3u8 playlist is
ffmpeg -protocol_whitelist "file,http,https,tcp,tls" -i "index.m3u8" -codec copy output.mp4
the m3u8 playlist can be on web or locally in directory it contains list of file paths relative to the playlist