Platform guide
How to download TikTok videos with yt-dlp
TikTok is one of the easier platforms for yt-dlp: for a normal public video, the share URL works directly with no extra flags. The catches show up around the edges — region-blocked content, private accounts, and TikTok's photo-mode posts, which are not videos at all.
Quick answer
yt-dlp "https://www.tiktok.com/@user/video/1234567890"Paste the video URL as-is — the standard web URL from the share button works directly. Short vm.tiktok.com share links also resolve; yt-dlp follows the redirect.
Quality and formats
TikTok usually serves a handful of MP4 renditions, sometimes including a version without the burned-in watermark. What is available varies by video and region, so check before assuming:
yt-dlp -F "https://www.tiktok.com/@user/video/1234567890"The default selection picks the best available quality, so most people never need -f here. Use it only when the list shows a specific rendition you want.
Metadata is unusually rich
TikTok extraction returns solid metadata: uploader handle, the full description including hashtags, upload date, and engagement counts. That makes output templates like -o "%(uploader)s - %(title)s.%(ext)s" work well, and --write-info-json gives you the whole record if you are feeding a pipeline. Long captions in other scripts can push the file name past the 255-byte limit on Linux, so in a pipeline cap the title by bytes: %(title).150B (see Fix "File name too long").
What commonly fails
- Region-blocked videos. Some content is only served in certain countries. If a video plays for someone else but errors for you, geography is the first suspect.
- Private accounts. If the account is private, the video is not reachable without an authenticated session that follows it — there is no flag that gets around this.
- Photo-mode slideshows. These are image carousels with music, not videos, and their
/photo/links fail with "Unsupported URL". There's a workaround for the audio; see the next section.
TikTok photo posts: "Unsupported URL"
A photo post (a slideshow of images with a sound) has a link like tiktok.com/@user/photo/<id>. yt-dlp's TikTok extractor only matches /video/ links, so the URL falls through to the generic extractor and fails:
$ yt-dlp "https://www.tiktok.com/@user/photo/7689250607613463829"
[generic] 7689250607613463829: Extracting information
ERROR: Unsupported URL: https://www.tiktok.com/@user/photo/7689250607613463829Both open requests for this on the tracker are still open as of yt-dlp 2026.11.23 (yt-dlp#10870, yt-dlp#15764). Until one lands, replace /photo/ with /video/ and keep the same user and ID. The TikTok extractor then takes it and returns the post's sound as the only format:
$ yt-dlp -F "https://www.tiktok.com/@user/video/7689250607613463829"
ID EXT RESOLUTION | PROTO | VCODEC ACODEC
------------------------------------------------
audio m4a audio only | https | audio only aac
$ yt-dlp "https://www.tiktok.com/@user/video/7689250607613463829"That gives you an .m4a of the sound plus the usual metadata (caption, uploader, counts, cover thumbnail with --write-thumbnail). It doesn't give you the images. A short vm.tiktok.com or tiktok.com/t/ link to a photo post fails the same way, and the error prints the full /photo/ URL it redirected to, so copy that and swap the path.
In a script that takes links from users, do the swap before you call yt-dlp:
import re
def tiktok_photo_to_video(url: str) -> str:
return re.sub(r"(tiktok\.com/@[\w.-]*)/photo/(\d+)", r"\1/video/\2", url)If you're building an app that accepts TikTok links, Importly's API takes photo post links as they are and returns the audio and metadata, short links included.
Cookies stop working on TikTok (403 with cookies, fine without)
A pattern reported in November 2026: a TikTok video downloads fine with no cookies, but as soon as you add browser cookies you get this:
ERROR: [TikTok] 7705071818968730898: Unable to download webpage: HTTP Error 403: ForbiddenTikTok's logged-in cookies only work when the request carries the same User-Agent as the browser they were exported from. The yt-dlp maintainers retitled the report to exactly that (yt-dlp#18045). The usual way to hit it is a script with a hard-coded, years-old Chrome User-Agent next to cookies from a current browser.
First, check whether you need cookies at all. For public videos you don't. Remove them, and remove any custom User-Agent too; yt-dlp already sends the headers TikTok expects.
If you do need them (age-restricted or login-only posts), send the browser's exact User-Agent with its cookies. Find it by opening DevTools in that browser and running navigator.userAgent in the console, then:
yt-dlp --cookies-from-browser chrome \
--add-headers "User-Agent:<paste navigator.userAgent here>" \
"https://www.tiktok.com/@user/video/1234567890"--user-agent from older guides still works, but current releases list --add-headers instead. The reporter also added --impersonate chrome, which needs curl_cffi installed (check with yt-dlp --list-impersonate-targets, and see fix "no impersonate target is available" to install it). From Python the same setup looks like this:
import yt_dlp
from yt_dlp.networking.impersonate import ImpersonateTarget
opts = {
"cookiesfrombrowser": ("chrome",),
"http_headers": {"User-Agent": "<the same browser's navigator.userAgent>"},
"impersonate": ImpersonateTarget.from_str("chrome"), # needs curl_cffi
}
with yt_dlp.YoutubeDL(opts) as ydl:
ydl.download(["https://www.tiktok.com/@user/video/1234567890"])Browsers update every few weeks, so a pinned User-Agent goes stale again. If this runs inside an app, read it from the same browser each time you refresh the cookies, or keep cookies out of the path for public videos. See using cookies with yt-dlp for the browser and profile options. If your app only needs the MP4 from public TikTok links your users paste, Importly's docs have a Node script that takes the link and saves the video, with no cookies or User-Agent to keep in sync.
The mistake to avoid
Do not loop over an entire profile at full speed from a single IP. TikTok rate-limits aggressively, and a burst of rapid requests turns working downloads into empty responses and blocks. If you are grabbing many videos, slow down with --sleep-requests and spread the work out.
Recurring sources
Pulling from the same sources on repeat?
Paste a link to preview what a maintained import API returns for it — across 1,000+ sites.
Building this into an app? See the API your backend calls instead
Frequently asked questions
Why does yt-dlp get HTTP Error 403 on TikTok only when I pass cookies?
TikTok ties a logged-in session to the browser it came from. If yt-dlp sends your browser's cookies with a different User-Agent, TikTok can reject the request with 403 Forbidden even though the same video downloads fine without cookies. Send the exact User-Agent of the browser the cookies came from, or drop the cookies if the video is public.
How do I set the User-Agent in yt-dlp?
On the command line use --add-headers "User-Agent:<your browser's UA>" (older guides use --user-agent, which still works but is no longer listed in --help). From Python, put it in the http_headers option: {'http_headers': {'User-Agent': '...'}}.
Do I need cookies to download TikTok videos with yt-dlp?
Not for normal public videos. Cookies only matter for age-restricted or login-only posts, or posts from a private account you follow. If a public video works without cookies, leave them off.