can't ffmpeg do this with the ignore_err option?
example:
ffmpeg -v error -err_detect ignore_err -stats -protocol_whitelist file,http,https,tcp,tls -user_agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" -headers "Referer: http://foo.bar/ \r\n" -i "https://foo.bar/video.m3u8" -bsf:a aac_adtstoasc -vcodec copy -c copy ".\outpath\video.mp4"