TechEarl

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.

Ishan Karunaratne⏱️ 7 min readUpdated
Share thisCopied
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.

The reliable, free way to download a TikTok video in 2026 is yt-dlp, an open-source command-line downloader: no app to install, no upload, and no ads. yt-dlp has a native TikTok extractor, so a single public video usually downloads with one command. Paste a URL below, pick whether you want the video or just the audio, and copy the command:

Build your yt-dlp command

Paste a TikTok 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.tiktok.com/@scout2015/video/6718335390845095173"

For most clips that is the whole job. The rest of this page is the detail behind those options: how short links work, what TikTok actually serves (including the watermark question), and what to do when a clip is gated or region-locked.

Download only what you have the right to. Saving your own posts, content you have permission to reuse, or clips you have been given the rights to is one thing; re-uploading someone else's video, stripping a creator's credit, or mass-scraping is another, and bulk downloading can violate TikTok's Terms of Service. Respect the creator. 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 uses it to remux and to extract audio, and a missing ffmpeg is the most common reason an otherwise-fine download fails to convert.

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

Keep yt-dlp current. This matters more for TikTok than almost any other site: TikTok changes its API and player frequently, 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. When a TikTok download suddenly fails, updating is the first thing to try, not the last.

Download a single TikTok video

The native extractor means a public video needs nothing more than the URL. No cookies, no flags:

bash
# A single public TikTok video
yt-dlp "https://www.tiktok.com/@user/video/VIDEO_ID"

TikTok's share buttons hand out shortened links rather than the full canonical URL. Those work too; yt-dlp follows the redirect to the real video:

bash
# A short share link works too
yt-dlp "https://vm.tiktok.com/XXXXXXX/"

Both vm.tiktok.com and vt.tiktok.com short links resolve correctly. Quote the URL in your shell either way, because TikTok URLs can contain characters the shell would otherwise interpret.

What about the watermark?

The bouncing username and TikTok logo you see on shared clips are added when a video is exported through TikTok's in-app save/share buttons. yt-dlp does not go through that path: it asks TikTok's API for the source stream. Whether that stream carries the watermark is TikTok's call, and it varies by clip, region, and day, so this is not something any tool can promise. List what is on offer and choose a format yourself:

bash
# See every format TikTok offers for this clip
yt-dlp -F "URL"

TikTok labels its streams in that output (Download video, watermarked versus Download video), so you can select one with -f <id> when more than one exists. If the only format listed carries the watermark, no tool can strip it back off. Either way, running yt-dlp locally avoids the ads, trackers, redirect popups, and daily limits of the downloader websites, and the request never leaves your machine.

Gated, private, or region-locked clips

A public video needs no authentication. If a clip is region-locked, age-gated, or otherwise visible only to a logged-in account, hand yt-dlp your browser's cookies so the request carries your session:

bash
# Gated / region-locked content you can access while logged in
yt-dlp --cookies-from-browser firefox "URL"

Use Firefox, not Chrome. Since Chrome 127 (late July 2024) Chrome on Windows guards its cookie store with app-bound encryption, and external tools (yt-dlp included) can no longer read those cookies; on macOS the Keychain-protected store causes the same kind of grief. Firefox keeps its cookies in a plain SQLite database, so --cookies-from-browser firefox is the one that reliably works across platforms in 2026. Log into TikTok in Firefox first, then run the command. This only lets you download what your own account can already see; it does not bypass anything.

Save it with a clean filename

By default yt-dlp names the file with the numeric ID baked in. An output template (-o) gives you something readable, and .50s truncates a long caption so the filename stays sane:

bash
# Clean filename
yt-dlp -o "%(uploader)s - %(title).50s.%(ext)s" "URL"

%(uploader)s, %(title)s, and %(ext)s are output-template fields; there are dozens more (%(upload_date)s, %(id)s) if you want to build a tidy folder structure for a whole collection.

Just the audio (the sound)

If it is the sound or song you want rather than the video, extract the audio directly instead of downloading the clip and stripping it:

bash
# Just the audio (the sound/song)
yt-dlp -x --audio-format m4a "URL"

-x extracts audio; --audio-format m4a keeps the AAC track in a widely-playable container without a heavy re-encode. To pull every post from one creator at once, see download a TikTok profile for the whole-account workflow with an archive file. For every flag in one place, the yt-dlp cheat sheet is the reference.

FAQ

See also

Sources

Authoritative references this article was fact-checked against.

Tagsyt-dlpTikToktiktok downloaderfree tiktok downloaderCLIvideo 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 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.

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.