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.

Profile / bulk 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"
AI CLI prompt

Paste this into your terminal AI and it runs the command for you, installing the tool first if you do not have it. Works with Claude Code, OpenAI Codex CLI, Gemini CLI, GitHub Copilot CLI, Aider, Cursor Agent, Warp, OpenCode, Cline and any other CLI coding agent.

prompt
Goal: download the video from this Facebook link.

Run this command in my shell:

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

First check whether `yt-dlp` is installed (run `command -v yt-dlp`). If it is not, install it with my system's package manager before running anything: macOS `brew install yt-dlp ffmpeg`, Debian/Ubuntu `sudo apt install yt-dlp ffmpeg`, Fedora `sudo dnf install yt-dlp ffmpeg`, Windows `winget install yt-dlp ffmpeg`. Then run the command above.

Show me any command that needs sudo before you run it, tell me where the output file landed when you are done, and do not run anything else.

You run this at your own risk. An AI agent can execute commands on your machine; review what it does before approving. TechEarl is not liable for the outcome, see the Terms of Service.

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.

Fixing yt-dlp "Cannot parse data" on Facebook reels

Update yt-dlp first. The Cannot parse data error is a common, recurring failure on Facebook, and it hits Reels and private or age-gated videos hardest because Facebook changes its page structure faster than the extractor can track. The fix almost always ships quickly upstream, so pull the latest build before anything else:

bash
yt-dlp -U
# or, if installed via pip:
pip install -U --pre yt-dlp
# or pin to the nightly channel:
yt-dlp --update-to nightly

For a Reel specifically, use the canonical URL form and quote it:

bash
yt-dlp "https://www.facebook.com/reel/REEL_ID"

If the Reel is private or login-gated, hand yt-dlp your session cookies:

bash
yt-dlp --cookies-from-browser firefox "https://www.facebook.com/reel/REEL_ID"

If an up-to-date yt-dlp still fails on one Reel, it is usually an extractor bug rather than anything on your end. Check the yt-dlp issue tracker to see whether someone has already reported it, and if not, file it with the verbose log.

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

Yes. yt-dlp is free and open source, with no ads, no paywall, no watermark, and no download limits. Unlike the "free Facebook video downloader" websites that wrap a tool like this in ads and trackers, yt-dlp runs entirely on your own machine and costs nothing.

Not for public videos. The facebook.com/watch player, /videos/ permalinks, fb.watch short links, and public Reels usually download with no login. You only need --cookies-from-browser firefox for private, friends-only, or group videos that require you to be logged in to view.

Yes. Pass the fb.watch short link to yt-dlp exactly as you copied it (in quotes), and yt-dlp follows the redirect to the underlying video. There is no special flag.

Almost always an unquoted URL. Facebook links contain & and other shell-special characters, so wrap the whole URL in double quotes. yt-dlp handles the tracking parameters itself; you do not need to trim them. If the link genuinely points at a login-gated video, add --cookies-from-browser firefox.

Either ffmpeg is missing (so yt-dlp can only fetch a single combined stream instead of merging the HD video and audio), or the poster only uploaded an SD rendition. Install ffmpeg, then run yt-dlp -F URL to see exactly which resolutions exist before you pick one with the format selector.

Facebook changes its page markup and player often, which breaks the extractor until yt-dlp catches up. Update first: yt-dlp -U for the standalone binary, or pipx upgrade yt-dlp. A stale yt-dlp is the most common cause of a Facebook download that used to work and no longer does. If a current build still fails on one specific video with a Cannot parse data error while other Facebook videos download fine, that is the extractor lagging a Facebook-side change, and the fix has to come from an upstream update rather than anything on your end.

Sources

Authoritative references this article was fact-checked against.

Tagsyt-dlpFacebookfacebook video downloaderfb.watchCLIvideo downloadffmpeg

Found this useful? Pass it on.

Copied

Ishan Karunaratne

Software Systems Architect · Senior Software Engineer · Engineering Leadership

Software systems architect and senior software engineer with more than two decades designing, building, and running production software, Linux systems, and DevOps infrastructure, and lately working AI into the stack. Now a CTO, though what I write here is drawn from the full arc of that work, across architecture, engineering, and operations, not any single job.

Keep reading

Related posts

Download a TikTok video free with yt-dlp from the command line: pull the source MP4, follow short links, extract audio, and use cookies for gated or region-locked clips.

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. For the photo slideshows yt-dlp can't fetch, grab the images with gallery-dl.

Download an Instagram Reel or video from the command line with yt-dlp using browser cookies, covering reels, feed videos, IGTV, and audio-only.

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.