Skip to content

Instantly share code, notes, and snippets.

@vitali2y
Created January 26, 2025 22:43
Show Gist options
  • Save vitali2y/628f4df55c9834797a8bbde0103ed56c to your computer and use it in GitHub Desktop.
Save vitali2y/628f4df55c9834797a8bbde0103ed56c to your computer and use it in GitHub Desktop.
Save FB Video In Two Steps

Open FB video (for example walking on the water), then:

  1. open DevTools (F12), then Network tab, watch for calling two GET URLs one-by-one, each with .mp4 inside: first is video without audio, second is just audio (both you can Open in New Tab) - so do Copy As cURL for both, and execute them as below (assuming 1.mp4 and 1.mp3 for both video and audio correspondently):

    IMPORTANT: it's required to remove 2 HTML params from the end of URLs: &bytestart=XXX&byteend=YYY!

    curl --output 1.mp4 https://scontent.xx.fbcdn.net/o1/v/t2/f2/m69/AQO...Kq9.mp4\?strext\=1\&_nc_cat\=108\&_nc_sid\=...&oe\=679C6293
    curl --output 1.mp3 https://scontent.xx.fbcdn.net/o1/v/t2/f2/m69/AQP...HqV.mp4\?strext\=1\&_nc_cat\=1\&_nc_sid\=&oe\=679C8E9F
    
  2. merging downloaded 1.mp4 video and 1.mp3 audio into the final output.mp4 as below:

    ffmpeg -i 1.mp4 -i 1.mp3 -c copy -map 0 -map 1 output.mp4
    

P. S. Alternatively you can play video + audio without merging as:

mpv 1.mp4 --audio-file=1.mp3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment