TechEarl

How to Download a Facebook Video with yt-dlp

Download a Facebook video free from the command line with yt-dlp: public watch links and fb.watch shorts need no cookies, private and group videos use --cookies-from-browser firefox, and you pick the resolution yourself.

Ishan Karunaratne⏱️ 7 min readUpdated
Share thisCopied
Download a Facebook video from the command line with yt-dlp: public watch and fb.watch links work without cookies, private and group videos use Firefox cookies, and you choose the resolution.

The reliable, free way to download a Facebook video in 2026 is yt-dlp, the same open-source command-line downloader people reach for on YouTube. No website, no ads, no upload limits, nothing to pay. Paste a Facebook URL below, choose video or audio, and copy the command:

Build your yt-dlp command

Paste a Facebook URL, choose what to grab, and copy the command. It updates as you change the options.

Resolution is a maximum, not a guarantee. yt-dlp grabs the best quality at or below your pick, capped by what was actually uploaded. Choose 8K on a 720p video and you get 720p, not an error and not an upscale.

Your command
bash
yt-dlp --merge-output-format mp4 "https://www.facebook.com/watch/?v=10153231379946729"

For a public video that is usually the whole job: yt-dlp resolves the messy Facebook URL, grabs the best video and audio, and merges them into one file. The rest of this page is the detail behind it: which links need login cookies, how to pick a resolution, why Firefox is the cookie source that actually works, and what to do when a specific video refuses to extract.

Download only what you have the right to. Saving your own videos, content the poster has made public for sharing, or video the rights holder permits is one thing; redistributing someone else's copyrighted video, or pulling content from private groups you would not otherwise share, is another, and it can violate Facebook's Terms of Service. This guide is for the legitimate cases. What you do with the file is on you.

Install yt-dlp (and ffmpeg)

Pick your platform. Install ffmpeg too: yt-dlp needs it to merge the separate video and audio streams Facebook serves at higher resolutions, and a missing ffmpeg is the single most common reason a download comes out lower-quality than expected.

Try it with your own values

Pick your OS for the install command.

bash· Linux (GNU)
# Cross-platform and always current:
pipx install yt-dlp
sudo apt install ffmpeg   # or your distro's package manager

Facebook changes its player and page markup often, and a stale yt-dlp simply stops extracting. pipx install yt-dlp (then pipx upgrade yt-dlp) is the cleanest cross-platform install; the standalone binary self-updates with yt-dlp -U, and Homebrew uses brew upgrade yt-dlp. Keeping yt-dlp current matters more on Facebook than almost anywhere else. When a download that worked last month suddenly fails, updating is the first thing to try. Facebook is also one of the extractor's flakier targets: even on a current build, a specific video can fail with a Cannot parse data error while older posts and Reels keep working, because the extractor is chasing a moving page format. If an up-to-date yt-dlp still chokes on one video, that is usually upstream catching up, not something you did wrong.

Download a public Facebook video

Public videos, the facebook.com/watch player, /videos/ permalinks, fb.watch short links, and public Reels, usually download with no login at all:

bash
# A public Facebook video
yt-dlp "https://www.facebook.com/watch/?v=VIDEO_ID"

A short fb.watch link works exactly the same way; yt-dlp follows the redirect to the real video:

bash
# A short fb.watch link
yt-dlp "https://fb.watch/XXXXXXX/"

Always wrap the URL in quotes. Facebook URLs are messy, full of tracking parameters (?fs=, ?__tn__=, &mibextid=, long __cft__ blobs), and an unquoted & will be read by your shell as a command separator. The good news is you do not need to clean any of that up by hand: yt-dlp parses the noise and finds the video ID itself. Copy the link straight from the address bar or the Facebook "copy link" menu, quote it, and run it.

Private, group, or login-gated videos

Anything you can only see while logged in, a video in a private group, a friends-only post, an unlisted video shared with you, needs your session. Hand yt-dlp your browser cookies so the request looks like you:

bash
# Private / group video you can see while logged in
yt-dlp --cookies-from-browser firefox "URL"

Use Firefox, not Chrome. Since around July 2024 Chrome encrypts its cookie store with app-bound encryption, and external tools (yt-dlp included) can no longer read Chrome's cookies on a running profile. Firefox's cookie store is still readable, so --cookies-from-browser firefox is the reliable source in 2026. Log into Facebook in Firefox once, then point yt-dlp at it. If a public video ever throws a "login required" or "content isn't available" error, the cookies flag is usually the fix there too.

Choose the quality

Facebook typically offers an SD and an HD rendition, sometimes more. List what a given video actually has, then pick:

bash
yt-dlp -F "URL"

That prints a table of formats with IDs, resolutions, and codecs. To cap the download at a height and give it a clean name in one go:

bash
# Cap the resolution and pick a clean name
yt-dlp -f "bv*[height<=1080]+ba/b" -o "%(uploader)s - %(id)s.%(ext)s" "URL"

The format selector reads as "best video up to 1080p plus best audio, or fall back to the best single file if that fails." The resolution is a ceiling, not a request: [height<=1080] means "the best stream at or below 1080p," so you only get 1080p if the poster uploaded at that resolution. yt-dlp never upscales a low-quality source, and it will not error if the video tops out lower; it just gives you what exists. Run yt-dlp -F first if you want to see the available renditions before choosing.

The -o template is worth keeping. By default yt-dlp bakes a long numeric ID into the filename; %(uploader)s - %(id)s.%(ext)s gives you something you can actually find later. There are dozens of fields (%(title)s, %(upload_date)s, %(resolution)s) for building a folder structure that suits your library.

See also

FAQ

Sources

Authoritative references this article was fact-checked against.

Tagsyt-dlpFacebookfacebook video downloaderfb.watchCLIvideo downloadffmpeg

Found this useful? Pass it on.

Copied

Ishan Karunaratne

Tech Architect · Software Engineer · AI/DevOps

Tech architect and software engineer with 20+ years building software, Linux systems, and DevOps infrastructure, and lately working AI into the stack. Currently Chief Technology Officer at a healthcare tech startup, which is where most of these field notes come from.

Keep reading

Related posts

How to Download a TikTok Video with yt-dlp

Download a TikTok video free from the command line with yt-dlp: no app, no sketchy site. yt-dlp pulls the source MP4 TikTok serves, follows short links, extracts audio, and uses your cookies for gated clips.

How to Download an Instagram Reel or Video with yt-dlp

Download an Instagram Reel or video free from the command line with yt-dlp. Instagram needs you logged in, so cookies are mandatory: how to pass them, keep them fresh, and grab reels, feed videos, IGTV, or just the audio.