Fix "Could not copy Chrome cookie database" in yt-dlp
ERROR: Could not copy Chrome cookie database. See https://github.com/yt-dlp/yt-dlp/issues/7271 for more info
Quick answer
Chrome holds an exclusive lock on its cookie database while it is running, and since version 127 it encrypts cookies with a key bound to the Chrome process. Closing Chrome fixes the first problem; the second needs a different browser or an export. Fastest working route:
yt-dlp --cookies-from-browser firefox "URL"
Two problems wearing one error message
The lock. Chrome keeps Cookies open exclusively while running.
yt-dlp tries to copy it — copying rather than reading in place, precisely to avoid interfering
with the browser — and the operating system refuses.
The encryption. Chrome 127 introduced application-bound encryption on Windows. The key that decrypts the cookie values is tied to the Chrome process itself, so even a perfect copy of the file decrypts to nothing useful. This one has no local workaround, which is why advice that worked in 2023 stopped working and the error message stayed the same.
Chromium-derived browsers inherit both: Edge, Brave, Opera, Vivaldi. Firefox has neither.
The fixes, in the order worth trying
1. Actually close Chrome
Closing every window is usually not enough — Chrome keeps a background process for extensions and the tray icon. Confirm it is gone, then retry:
taskkill /IM chrome.exe /F
yt-dlp --cookies-from-browser chrome "URL"
pkill -a chrome
yt-dlp --cookies-from-browser chrome "URL"
In Chrome's settings, "Continue running background apps when Chrome is closed" is the setting that causes this. Turning it off makes the problem stop recurring.
2. Use Firefox instead
The path of least resistance. Sign in to the site in Firefox once, and yt-dlp can read its cookies while it is still open:
yt-dlp --cookies-from-browser firefox "URL"
With more than one profile, name it:
yt-dlp --cookies-from-browser "firefox:Downloads" "URL"
3. Export to cookies.txt
Works from any browser, including Chrome 127+, because the export happens inside the browser where the key is available. Install an extension that produces Netscape format, export while on the site, then:
yt-dlp --cookies cookies.txt "URL"
4. A separate Chrome profile
If Chrome is required, a dedicated profile you keep closed avoids the lock — and keeps the account you use for downloading separate from your main one, which is worth doing anyway:
yt-dlp --cookies-from-browser "chrome:Profile 2" "URL"
Confirming it worked
Cookies reaching yt-dlp is not the same as cookies being useful. Check both at once:
yt-dlp --cookies-from-browser firefox --simulate -v "URL"
The verbose output reports how many cookies were extracted. Zero means the wrong profile. Several hundred, with the download still refused, means the session is valid but lacks access — a different problem, covered on private video and the bot check.
If it still fails
- Permission denied rather than could not copy. Different cause — see cookies permission denied, which covers keyrings and Keychain.
- Cookies load, YouTube still challenges you. Expected in 2026. Cookies prove identity; they do not prove origin. See PO tokens.
-
Snap or Flatpak Firefox on Linux. Sandboxed, so the profile is not where
yt-dlp looks. Pass the path explicitly:
--cookies-from-browser firefox:~/snap/firefox/common/.mozilla/firefox/xxxx.default. -
It worked yesterday. Chrome updated. This is the failure mode of relying on
--cookies-from-browserwith a Chromium browser at all; the cookies guide compares the approaches on exactly this axis.
Frequently asked
Why does Firefox work when Chrome does not?
I closed Chrome and it still fails.
Is copying the cookie file myself safe?
Which cookie exporter extension should I use?
Related
- Fix "Permission denied" Reading Browser Cookies in yt-dlp The cookie file exists and yt-dlp still cannot open it: keyring prompts on Linux, Keychain on macOS, and file...
- 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 "Sign in to confirm you're not a bot" in yt-dlp YouTube asks yt-dlp to prove it is human when the request looks like a datacentre. Why cookies alone stopped w...