Fix "Private video: Sign in if you've been granted access" in yt-dlp
ERROR: [youtube] dQw4w9WgXcQ: Private video. Sign in if you've been granted access to this video
Quick answer
yt-dlp can download a private video if the account you hand it can already watch that video. It cannot get around the permission itself. The whole job is exporting a session from a browser where you are signed in as the right account:
yt-dlp --cookies-from-browser firefox "URL"
Check access first
Before debugging cookies, confirm the account actually has access. Open the URL in a browser where you are signed in as that account. If it plays, cookies will work. If it does not, nothing on this page will, and the problem is that the video was never shared with you.
It is worth being precise about which account. Browsers hold several Google sessions at once and pick between them per tab, so "I am signed in" and "I am signed in as the account that was granted access" are different statements.
Getting the session across
Reading the browser directly
Simplest when it works. Firefox is the reliable choice — Chromium browsers lock their cookie database and, on recent versions, encrypt it against the browser process:
yt-dlp --cookies-from-browser firefox "URL"
yt-dlp --cookies-from-browser "firefox:Work" "URL"
Chrome failures here are their own problem, covered on the Chrome cookie database page.
Exporting to a file
More reliable, and the only option for anything scheduled. Export with a cookies.txt extension while on the video's page, then:
yt-dlp --cookies cookies.txt "URL"
Members-only and purchased videos
Same mechanism, and the same warning applies more strongly. A channel membership or a purchase is attached to an account you care about, so the cookies you are exporting belong to an account whose loss would matter:
yt-dlp --cookies-from-browser firefox --extractor-args "youtube:player_client=web_safari" "URL"
Confirming it worked
yt-dlp --cookies-from-browser firefox --simulate -v "URL"
The verbose output states how many cookies were extracted. Zero means the wrong profile or the wrong browser. A few hundred with the video still refused means the session is valid but belongs to an account without access — back to the browser check at the top.
Your own private uploads
Recovering your own videos is the most legitimate reason to be here, and worth doing in bulk:
yt-dlp --cookies-from-browser firefox -i --download-archive mine.txt \
-o "%(upload_date>%Y-%m-%d)s - %(title)s.%(ext)s" \
"https://www.youtube.com/feed/library"
Output templates covers the naming, and the playlist guide the archive file that lets an interrupted run resume.
If it still fails
- Cookies load, still "Private video". The account genuinely lacks access. Verify in a browser signed in as that exact account.
- Worked yesterday. The session rotated. Re-export; this is normal and will keep happening.
- "Sign in to confirm you're not a bot" instead. A different check, and cookies are not the answer to it — see that page.
-
A Vimeo password-protected video. Not cookies at all:
--video-passwordis the flag. - An unlisted video. Those need no cookies. If one is refused, the link is wrong or the video is now private.
Frequently asked
Can yt-dlp download any private video?
Why does an incognito export not work?
Unlisted is not the same as private, is it?
How long do exported cookies last?
Related
- yt-dlp Cookies: --cookies-from-browser vs cookies.txt Cookies are how yt-dlp proves it is you — for private videos, members-only content and bot checks. Both method...
- Fix "Video unavailable" in yt-dlp Six different situations print the same two words. How to tell a geo-block from a takedown from a broken extra...
- Fix "Could not copy Chrome cookie database" in yt-dlp Chrome locks its cookie file while it is running, and on newer versions encrypts it so only Chrome can read it...