For the cookie file you can use cookie-editor. When you extract use the JSON format.
You'll also need ffmpeg
to splice together video and audio.
Regarding fb_dtsg, after a while the value expires. To fix it simply check a instagram request to graphql and replace it with the value found in it.