TechEarl

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.

Ishan Karunaratne⏱️ 8 min readUpdated
Share thisCopied
Download an Instagram Reel or video from the command line with yt-dlp using browser cookies, covering reels, feed videos, IGTV, and audio-only.

The free, reliable way to download an Instagram Reel or video in 2026 is yt-dlp, the open-source command-line downloader, no shady website, no ads, no upload limits. The one thing that is different from YouTube: Instagram almost always requires you to be logged in, so you have to hand yt-dlp your browser cookies. Paste a URL below, choose whether you want the video or the audio, and copy the command:

Build your yt-dlp command

Paste a Instagram 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.instagram.com/reel/Cabcd1234ef/"
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 Instagram link.

Run this command in my shell:

    yt-dlp --merge-output-format mp4 "https://www.instagram.com/reel/Cabcd1234ef/"

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 Instagram the cookies are not optional the way they sometimes are elsewhere. Even public reels frequently return an empty result or an auth error unless the request carries a logged-in session, so every command on this page passes --cookies-from-browser. The rest of this page is the detail: which browser to pull cookies from, why they keep expiring, and how to cover reels, feed videos, IGTV, and audio.

Download only what you have the right to. Saving your own posts, content you have permission to use, or material the creator has released for reuse is fine; redownloading and redistributing someone else's reels is not, and bulk scraping violates Instagram's Terms of Service. This guide is for the legitimate cases. Respect the people who made the thing. What you do with the file is on you.

Cookies are mandatory

The core command is short. The catch is the --cookies-from-browser flag, which is doing the heavy lifting:

bash
# A reel or post video (cookies required: you must be logged in)
yt-dlp --cookies-from-browser firefox "https://www.instagram.com/reel/REEL_ID/"

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 cookies on a running profile. Firefox's cookie store is still readable, so --cookies-from-browser firefox is the one that works reliably in 2026. Make sure you are actually logged in to Instagram in that Firefox profile first; yt-dlp reads the session cookie that the logged-in browser holds.

If you do not use Firefox at all, you can export a cookies.txt file with a browser extension and pass --cookies cookies.txt instead. But the live --cookies-from-browser firefox path is simpler and stays current automatically as long as you stay logged in.

One gotcha: if yt-dlp reports it cannot copy or read the cookie database (a "could not copy ... cookie database" or locked-database error), close the browser and run the command again. yt-dlp reads the cookie store from disk, and an open browser can hold a lock on it.

Keep the cookies fresh (the failure you will hit)

Instagram sessions expire fast, and this is the single most common reason a command that worked yesterday suddenly fails. If you get an HTTP 401, an "login required" error, or just an empty result with no download, your Instagram session cookie has gone stale.

The fix is to refresh it:

  1. Open instagram.com in Firefox.
  2. Confirm you are still logged in (Instagram logs you out more aggressively than most sites). Log back in if needed.
  3. Re-run the same yt-dlp command. It now reads the current cookie from the freshly authenticated session.

There is no flag that makes the cookie last longer; the lifetime is Instagram's to decide. When in doubt, re-authenticate in the browser and run again. If it still fails after fresh cookies, the next suspect is a stale yt-dlp (see below), not the cookies.

Reels, feed videos, and IGTV

The same command works across Instagram's video URL shapes, only the path segment changes:

  • Reels live on /reel/ URLs.
  • Feed videos (a video in a regular post) live on /p/ URLs.
  • IGTV clips live on legacy /tv/ URLs. Instagram retired the IGTV brand in 2022 and folded that video into the main app, so new uploads no longer get /tv/ links, but old /tv/ URLs still resolve and the extractor still handles them.
bash
yt-dlp --cookies-from-browser firefox "https://www.instagram.com/reel/REEL_ID/"
yt-dlp --cookies-from-browser firefox "https://www.instagram.com/p/POST_ID/"
yt-dlp --cookies-from-browser firefox "https://www.instagram.com/tv/IGTV_ID/"

There is no special flag to switch between them; yt-dlp's Instagram extractor reads the URL and figures out the type. A /p/ post that happens to be a photo carousel will return its images or videos as the extractor finds them.

Save it with a clean filename

By default the file is named with Instagram's internal ID, which is not memorable. An output template (-o) gives you something readable:

bash
# Clean filename
yt-dlp --cookies-from-browser firefox -o "%(uploader)s - %(id)s.%(ext)s" "URL"

%(uploader)s, %(id)s, and %(ext)s are output-template fields; there are dozens more (%(upload_date)s, %(title)s) for building a folder structure that suits your library. Keep %(id)s in there somewhere so two reels from the same account never collide on the same filename.

Just the audio

If it is only the sound you want (a reel's track, a voiceover), extract it directly instead of downloading the video and stripping it yourself:

bash
# Just the audio
yt-dlp --cookies-from-browser firefox -x --audio-format m4a "URL"

-x extracts audio; --audio-format m4a keeps the AAC track Instagram already serves without a quality-losing re-encode. This needs ffmpeg installed, the same dependency yt-dlp uses everywhere for muxing and conversion. If you do not have it yet, brew install ffmpeg, sudo apt install ffmpeg, or winget install Gyan.FFmpeg depending on your platform.

Keep yt-dlp updated (more important here than most)

Instagram is one of yt-dlp's more fragile extractors. Instagram changes its private API and page structure often, and when it does, the extractor breaks until a new release ships, which usually happens within days. So when an Instagram download suddenly fails and your cookies are fresh, update yt-dlp before anything else:

bash
yt-dlp -U                 # standalone binary self-update
pipx upgrade yt-dlp       # if installed via pipx
brew upgrade yt-dlp       # if installed via Homebrew

Running a months-old yt-dlp against Instagram is the second most common cause of failure after stale cookies. Between the two (fresh cookies, current binary), almost every "it stopped working" report is covered.

FAQ

Instagram serves almost all video, even from public accounts, behind a logged-in session. yt-dlp's request has to look like your browser to get the file, which is why --cookies-from-browser firefox is required rather than optional. Without cookies you typically get an empty result or an auth error.

Your Instagram session cookie has expired. Open instagram.com in Firefox, confirm you are still logged in (log back in if not), and re-run the same command so yt-dlp reads a current cookie. Instagram sessions expire quickly, so re-exporting fresh cookies is the first fix to try.

Not reliably. Chrome encrypts its cookie store with app-bound encryption (since mid-2024), so yt-dlp can no longer read it on a running profile. Use --cookies-from-browser firefox, or export a cookies.txt file with a browser extension and pass --cookies cookies.txt.

Yes. Reels are /reel/ URLs, feed-post videos are /p/ URLs, and IGTV is /tv/. The same yt-dlp --cookies-from-browser firefox URL command handles all three; the extractor reads the URL and works out the type, no extra flag needed.

Two usual causes. Either your cookies went stale (re-authenticate in Firefox and retry) or your yt-dlp is out of date. Instagram is one of the more fragile extractors and breaks when Instagram changes its site, so update with yt-dlp -U or pipx upgrade yt-dlp and try again.

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

See also

Sources

Authoritative references this article was fact-checked against.

Tagsyt-dlpInstagramreel downloadinstagram video downloaderCLIcookiesfree instagram downloader

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 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.

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.