Skip to content

Start typing. Errors match on their exact yt-dlp output.

to move, to open esc to close

Fix "Could not copy Chrome cookie database" in yt-dlp

Tested on yt-dlp 2026.07.28 Updated
What yt-dlp prints
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:

Firefox has neither restriction
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:

Windows
taskkill /IM chrome.exe /F
yt-dlp --cookies-from-browser chrome "URL"
macOS and Linux
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:

bash
yt-dlp --cookies-from-browser firefox "URL"

With more than one profile, name it:

bash
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:

bash
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:

bash
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:

bash
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-browser with 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?
Firefox stores cookies in a SQLite file that other processes may read, and does not tie its encryption to an OS keystore in the same way. Chrome holds an exclusive lock while running and, since version 127, encrypts cookies with a key bound to the Chrome process itself.
I closed Chrome and it still fails.
Chrome usually is not closed. Background apps, the tray icon and the "continue running background apps" setting all keep the process alive after the last window shuts. Check Task Manager or Activity Monitor for chrome.exe, and end it there.
Is copying the cookie file myself safe?
The copy is fine, but on Chrome 127+ it will not help — the encryption key is bound to the browser process, so a copied database decrypts to nothing. Exporting through an extension, or using a different browser, are the routes that still work.
Which cookie exporter extension should I use?
Any that produces Netscape format. Prefer one that is open source and lets you export for a single site — an extension with read access to every cookie you hold is a large amount of trust for a convenience feature.