# YouTube cookies.txt: Export, Use and Refresh It

Source: https://b-roll-6hk.pages.dev/troubleshooting/youtube-cookies-txt/
Published: 2026-09-25
Updated: 2026-09-25
Author: Ema Zamboni, video editor (https://b-roll-6hk.pages.dev/about/)
Section: Troubleshooting (https://b-roll-6hk.pages.dev/troubleshooting/)

**In short:** A cookies.txt file is a Netscape-format text export of your browser cookies that lets a downloader act as your signed-in YouTube account. Export it from a private window with an exporter the yt-dlp FAQ recommends, load it in B-ROLL's Settings or sign-in wizard, and export a fresh one when YouTube rejects it.

## What is a cookies.txt file?

A cookies.txt file is a text export of browser cookies in the Netscape format that command-line tools read. Each line holds one cookie, and the [yt-dlp FAQ](https://github.com/yt-dlp/yt-dlp/wiki/FAQ) requires the first line to be `# HTTP Cookie File` or `# Netscape HTTP Cookie File`.

Cookies are how a website keeps you signed in. [RFC 6265](https://www.rfc-editor.org/rfc/rfc6265), the cookie standard, describes them as the way servers keep a session going over HTTP. A YouTube cookies.txt therefore carries your signed-in session: any program holding it can make requests as your account.

Treat the file like a password. Keep it on your own PC, never paste it into a website, and delete old exports you no longer need.

Ema Zamboni, who built B-ROLL to collect b-roll for YouTube edits, hit "Sign in to confirm you're not a bot" on downloads. A fresh cookies.txt exported from a signed-in browser and loaded in B-ROLL fixed it. Cookies expire, so the message can return, and the fix is the same: export again.

[Download B-ROLL for Windows](https://b-roll-6hk.pages.dev/download/): free, Windows 10 and 11 today, macOS and Linux planned. No account, no ads.

## When does a YouTube download need cookies?

A YouTube download needs cookies when YouTube refuses to serve the video to a signed-out visitor. B-ROLL treats any yt-dlp error containing "Sign in to confirm" or "confirm your age" as that case, which covers the bot check and age-restricted videos.

Cookies only let the downloader see what your account can already play in the browser. Your own private or unlisted uploads are the typical editor case, covered step by step in [back up your own YouTube channel to a local drive](https://b-roll-6hk.pages.dev/guides/back-up-your-youtube-channel/).

B-ROLL starts every download without cookies unless you have set a cookies.txt; with a file set, every download uses it from the start. The table lists the cookie errors you can meet in B-ROLL, what causes each one and the fix. Card texts are English only.

| Message | Where it appears | Cause | Fix |
| --- | --- | --- | --- |
| Sign-in required: add a cookies.txt in Settings, then retry | B-ROLL card | YouTube asked for sign-in and no working login was found | Export a cookies.txt and load it in Settings |
| Couldn't read browser cookies: set a cookies.txt | B-ROLL card | Chrome, Edge or Brave kept its cookie database locked or encrypted | Close that browser completely, use Firefox, or load a cookies.txt |
| Sign-in rejected: refresh your cookies.txt | B-ROLL card, then the wizard "Your cookies expired: refresh them" | YouTube rejected the file you loaded, likely because the cookies rotated | Export a fresh file from a private window |
| The provided YouTube account cookies are no longer valid | yt-dlp warning in the log | yt-dlp says the cookies were likely rotated in the browser | Export a fresh file from a private window |
| Could not copy Chrome cookie database | yt-dlp error in the log | Windows denied access to Chrome's cookie file while Chrome was running | Quit Chrome, including background processes, or load a cookies.txt |
| HTTP Error 400: Bad Request | yt-dlp error in the log | The yt-dlp FAQ calls it a sign of a wrong newline format in the file | Export again; on Windows the file needs CRLF line endings |

The full list of bot-check messages lives on [fix "Sign in to confirm you're not a bot" on YouTube](https://b-roll-6hk.pages.dev/troubleshooting/sign-in-to-confirm-not-a-bot/). A 403 is a different failure: [fix HTTP Error 403 Forbidden on YouTube downloads](https://b-roll-6hk.pages.dev/troubleshooting/http-error-403-forbidden/) covers it.

## How do you export cookies.txt from your own YouTube account?

Export cookies.txt with a browser extension the yt-dlp FAQ recommends, from a private window you close right after. The FAQ names "Get cookies.txt LOCALLY" for Chrome and "cookies.txt" for Firefox.

> **Careful: Pick the right Chrome exporter**
>
> The yt-dlp FAQ says the older Chrome extension named "Get cookies.txt", without "LOCALLY", was reported as malware and should be uninstalled. B-ROLL's **Open store** button opens a Chrome Web Store search for "get cookies.txt", so check the exact name before you install.

The private window matters because of rotation. The [yt-dlp Extractors wiki](https://github.com/yt-dlp/yt-dlp/wiki/Extractors) says YouTube rotates account cookies frequently on open YouTube tabs. An export taken from your everyday window goes stale as soon as that window keeps browsing.

The wiki's method avoids that: sign in inside a private window, open `youtube.com/robots.txt` in the same tab, export the youtube.com cookies, then close the window. The exported session is then never used by the browser again.

Before loading the file, open it in Notepad and check two things. The first line is the Netscape header, and the lines mention youtube.com. The yt-dlp FAQ reads "HTTP Error 400: Bad Request" as a sign of the wrong newline format: on Windows the file needs CRLF line endings.

## How do you load a cookies.txt in B-ROLL?

Load a cookies.txt in B-ROLL from **Settings**, under **Cookies file (for sign-in / restricted videos)**: click **Choose…** and pick the file, or drop it on the zone that reads "Drop your cookies.txt here". The sign-in wizard offers the same drop zone and a **Browse…** button.

B-ROLL copies the chosen file to `%LOCALAPPDATA%\Broll\cookies.txt` in plain text, so you can delete your original export. **Reset**, next to the file name in Settings, deletes that copy. Uninstalling B-ROLL leaves the `%LOCALAPPDATA%\Broll` folder behind, cookies included, so delete it by hand for a full removal. Every other Settings option is explained in [B-ROLL settings and advanced options explained](https://b-roll-6hk.pages.dev/features/settings-and-advanced-options/).

B-ROLL also looks for a fresh export on its own. When the wizard or Settings open, and after a sign-in error, it reads the first 8 KB of recent .txt files in Downloads, Desktop, the OneDrive Downloads and Desktop folders and your download folder. That scan happens on your PC only, and a match shows in the wizard as a file you can click to use.

B-ROLL counts a .txt file as cookies when it is in Netscape format or mentions youtube.com or google.com in its first 8 KB. A plain list of YouTube links dropped on the paste box can therefore be taken for a cookies file. Queue link lists with the **URL list (.txt)** button in the sidebar instead.

## Can B-ROLL use your browser login instead of a file?

Yes. B-ROLL's **Use browser login for age-restricted videos** option in Settings is on by default and lets yt-dlp read the YouTube cookies of your installed browsers when no cookies.txt is set.

With that option on and no file set, B-ROLL uses your browser's YouTube cookies for lookups: title and bitrate, credits, subtitles, the preview and the warm-up at launch. The download itself starts without cookies. After a sign-in error, B-ROLL tries the login of each installed browser in turn: Firefox first, then Edge, Brave, Chrome, Vivaldi and Opera.

Firefox is the dependable browser route on Windows. As of September 2026, Chrome, Edge and Brave encrypt their cookies in a way yt-dlp often cannot read while the browser or its background process is running. The wizard therefore offers Firefox first: sign in once on youtube.com in Firefox, then click **I'm signed in, try now**.

To keep your everyday browser account out of lookups, turn off **Use browser login for age-restricted videos**. To decide exactly which account B-ROLL uses, load a cookies.txt: once a file is set, a rejected sign-in opens the wizard instead of trying your browsers.

## Why do YouTube cookies stop working?

YouTube cookies stop working because YouTube rotates account cookies frequently on open YouTube tabs as a security measure, according to the yt-dlp Extractors wiki. The old values in your export are then refused.

As of September 2026, yt-dlp reports a stale session with the warning "The provided YouTube account cookies are no longer valid" and adds that they were likely rotated in the browser.

B-ROLL reacts in one step. When a loaded cookies.txt still hits a sign-in check, the card reads "Sign-in rejected: refresh your cookies.txt" and the wizard opens with the heading "Your cookies expired: refresh them". The log line adds that the cookies likely expired and asks for a fresh export from a signed-in YouTube tab.

The fix is always a new export from a fresh private window. Loading it in Settings replaces the old copy.

## Can using cookies put your YouTube account at risk?

Yes. The yt-dlp Extractors wiki warns that by using your account with yt-dlp you "run the risk of it being banned (temporarily or permanently)". No tool can promise otherwise, B-ROLL included.

The [yt-dlp Extractors wiki](https://github.com/yt-dlp/yt-dlp/wiki/Extractors) puts the limit for signed-in accounts at about 2000 videos per hour with default settings, and recommends a delay of around 5 to 10 seconds between downloads. Long playlist or channel jobs add up quickly, so pace large jobs and consider a secondary account for them.

The other risk is the file itself. A cookies.txt is a working session, so anyone who gets it can act as you on YouTube. Online downloader sites that ask you to upload cookies receive exactly that; [are online YouTube downloader sites safe?](https://b-roll-6hk.pages.dev/compare/are-online-downloaders-safe/) explains what else those sites see.

Cookies change which account YouTube sees, not what you are allowed to do with a video. What the Terms say about downloading is covered in [is it legal to download YouTube videos? what the Terms say](https://b-roll-6hk.pages.dev/attribution/is-downloading-youtube-legal/).

> **Careful:** Download only footage you have the right to use: your own uploads, Creative Commons, licensed or permitted material.

## Why does the "could not copy Chrome cookie database" error appear?

The "Could not copy Chrome cookie database" error appears on Windows when yt-dlp is denied access to Chrome's cookie file, typically because Chrome is still running. The yt-dlp source raises it on a Windows permission error and links a GitHub issue with background.

Closing the Chrome windows is often not enough, because background processes that outlive the last window count too. In B-ROLL the card reads "Couldn't read browser cookies: set a cookies.txt", and the log names Chrome, Edge and Brave.

Fix it in this order. Quit Chrome completely, including any tray icon, then click retry on the card. If the error returns, sign in to YouTube in Firefox, which B-ROLL tries first, or export a cookies.txt from a private window and load it in Settings. A loaded file avoids the browser database entirely.

When the download fails with a different message, start from [YouTube downloader not working? fixes for editors](https://b-roll-6hk.pages.dev/troubleshooting/), which sends each symptom to its own page.

## How to export a YouTube cookies.txt and load it in B-ROLL

1. **Install a recommended exporter.** Install Get cookies.txt LOCALLY in Chrome or cookies.txt in Firefox, the exporters the yt-dlp FAQ recommends. Avoid the Chrome extension named Get cookies.txt without LOCALLY: the FAQ says it was reported as malware.
2. **Sign in inside a private window.** Open a private or incognito window and sign in to YouTube with your own account. If the exporter icon is missing, allow the extension to run in private windows in your browser's extension settings.
3. **Open robots.txt in the same tab.** In the same tab, go to youtube.com/robots.txt so no YouTube page stays open to rotate the cookies.
4. **Export the youtube.com cookies.** Click the exporter and save the cookies for youtube.com as a .txt file. Its first line reads # Netscape HTTP Cookie File.
5. **Close the private window.** Close the private window right away, so that session is never opened in the browser again.
6. **Load the file in B-ROLL.** In B-ROLL open Settings, click Choose next to Cookies file and pick the export, or drop it on the drop zone. The sign-in wizard's Browse button works the same way.
7. **Retry the download.** Click retry on the failed card. B-ROLL now sends every download with your cookies from the start.
8. **Delete the original export.** Delete the exported .txt from Downloads. B-ROLL keeps its own copy in its data folder, so the original is no longer needed.

## Frequently asked questions

Q: Should I use a separate YouTube account?
A: Yes, if you download with cookies often. The yt-dlp wiki warns that using your account with yt-dlp risks a temporary or permanent ban, so a secondary account keeps your main channel out of it. The account still has to be able to play the videos you need. For your own private or unlisted uploads, only the account that owns them works.

Q: Where does B-ROLL store the cookies file?
A: B-ROLL saves a plain-text copy named cookies.txt in its own data folder under Local AppData in your Windows user profile. Because B-ROLL works from that copy, you can delete your original export. The copy never leaves your PC except as cookies yt-dlp sends to YouTube with its requests.

Q: How do I remove my cookies from B-ROLL?
A: Open Settings and click Reset next to the cookies file: B-ROLL deletes its copy of cookies.txt. Also delete the original export if you kept it. Uninstalling B-ROLL does not remove the copy, because B-ROLL's data folder under Local AppData stays behind; delete the data folder by hand for a full removal.

Q: How long do YouTube cookies last?
A: No fixed lifetime is published. As of September 2026, the yt-dlp wiki says YouTube rotates account cookies frequently on open YouTube tabs, so an export from a window you keep using can go stale soon after. Exporting from a private window you then close keeps the file valid longer. When B-ROLL reports the sign-in as rejected, export a fresh file.

## Sources

1. [yt-dlp wiki: FAQ (passing cookies, recommended exporters)](https://github.com/yt-dlp/yt-dlp/wiki/FAQ)
2. [yt-dlp wiki: Extractors (YouTube notes, exporting cookies)](https://github.com/yt-dlp/yt-dlp/wiki/Extractors)
3. [yt-dlp source: cookies.py (Chrome cookie database error)](https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/cookies.py)
4. [yt-dlp source: YouTube extractor base (cookies no longer valid warning)](https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/extractor/youtube/_base.py)
5. [IETF RFC 6265: HTTP State Management Mechanism (cookies)](https://www.rfc-editor.org/rfc/rfc6265)

---

B-ROLL is a free, donation-supported desktop YouTube downloader for video editors: it downloads videos, clips, playlists and channels, converts them automatically into edit-ready ProRes or DNxHR (or saves MP4, MKV, WEBM or audio), and includes built-in trimming, subtitles and automatic creator credit files. Part of [YouTube Downloader Not Working? Fixes for Editors](https://b-roll-6hk.pages.dev/troubleshooting/) on the B-ROLL website. Download B-ROLL, free for Windows 10 and 11 (macOS and Linux planned): https://b-roll-6hk.pages.dev/download/
