3 min read

Build a yt-dlp cookies.txt from a Chrome export

yt-dlp reads a Netscape cookies.txt via --cookies; convert a Chrome JSON export (CookieMan, Cookie-Editor, EditThisCookie) into that file here. This page is not yt-dlp, and it will not pull cookies out of Chrome by itself.

--cookies-from-browser is a different path that talks to the browser profile directly. Use this converter when you already have an export and want a file you can pass in CI or on a machine without the profile.

yt-dlp cookies.txtyt-dlp --cookiesyt-dlp cookies from Chromeyoutube-dl cookies.txt
  1. 1
    Export cookies from Chrome

    Open the site in Chrome, export JSON from CookieMan (current site). Alternatively paste an existing Netscape dump — it will be normalised (tabs, header, seconds).

  2. 2
    Convert to Netscape here

    Paste the export. Output is cookies.txt. Check that HttpOnly session cookies appear with #HttpOnly_ and that expiry is 10 digits, not 13.

  3. 3
    Pass the file to yt-dlp

    Save as cookies.txt and run yt-dlp --cookies cookies.txt URL. Keep the file out of git. When finished, delete it and rotate the site session if it was privileged.

Cookies are credentials. Conversion stays in this page — delete the file when you are done.

yt-dlp cookie flags that matter

FlagWhen to use itWhat this converter does
--cookies FILEYou already have a Netscape fileWrites that file from JSON or repairs a broken dump
--cookies-from-browser chromeyt-dlp can see your local profileNothing — that bypasses the file
--no-cookies-from-browserCI, or you must use the fileUse the file this page produced
            yt-dlp --cookies cookies.txt "https://www.example.com/watch?v=..."

# youtube-dl uses the same Netscape reader:
# youtube-dl --cookies cookies.txt URL
          
A cookies.txt for a logged-in video site is a credential. Do not paste it into an issue tracker. yt-dlp’s parser is strict about tabs and Unix seconds — millisecond expiry is a common failure, fixed here: millisecond expiry.

What yt-dlp will not read

  • JSON arrays — it wants Netscape, not CookieMan JSON.
  • Space-separated columns — tabs only, unless you repair the file here first.
  • A leading UTF-8 BOM on some builds — the converter strips BOM on paste.
  • CHIPS partitionKey — not in the format; partitioned cookies will not appear in a Netscape dump.

Questions people ask

Should I use --cookies or --cookies-from-browser?
--cookies-from-browser reads the profile on that machine. --cookies reads a file. Use the file when the downloader runs on another host, in CI, or when you do not want yt-dlp opening the browser profile.
Why does yt-dlp say the Netscape file is invalid?
Tabs replaced by spaces, 13-digit expiry, or HttpOnly lines dropped as comments. Paste the file here, export Netscape again, and retry. Exact errors are documented under Skipped invalid Netscape line.
Can this website log into a video site for me?
No. Export cookies from a browser where you are already logged in. The converter only changes formats.
3 min read

curl -b cookies.txt from JSON Export

Turn a Chrome JSON export into the Netscape file curl -b and -c expect: tabs, #HttpOnly_ prefixes, Unix-second expiry and a trailing newline.

curl cookies.txtcurl -b cookies Open the guide
3 min read

Convert Get cookies.txt LOCALLY to JSON

Turn a Netscape file from the Get cookies.txt LOCALLY extension into a JSON array that keeps HttpOnly flags, then import it in Chrome or another profile.

Get cookies.txt LOCALLYcookies.txt to JSON Open the guide
3 min read

Fix cookies.txt Millisecond Expiry

A 13-digit Netscape expiry is milliseconds, not Unix seconds. CookieMan divides values greater than 1e12 by 1000 and warns. Paste the file here to rewrite column 5.

cookies.txt millisecondsNetscape expiry milliseconds Open the guide

Apply this on live cookies

The converter rewrites files. The extension reads and writes the jar in Chrome, including HttpOnly cookies.

Free and MIT-licensed · Chrome, Edge and other Chromium browsers · Nothing leaves your machine