Cookie Exporter | Netscape, JSON, Header

Export cookies in Netscape, JSON, or header format for curl, wget, yt-dlp — replaces Get cookies.txt LOCALLY

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

Autor
piknockyou
Denně instalací
0
Celkem instalací
2
Hodnocení
0 0 0
Verze
3.0.9
Vytvořeno
22. 07. 2026
Aktualizováno
22. 07. 2026
velikost
12,4 KB
Licence
AGPL-3.0
Spustit na
všech stránkách

☕ If you find this tool helpful & would like to support its maintenance, please consider leaving a tip on:

https://ko-fi.com/piknockyou

Thank you! :-)


🖼 For a quick impression of this script, refer to the screenshots at the bottom.


Cookie Exporter | Netscape, JSON, Header

Exports browser cookies in Netscape, JSON, or header format — compatible with curl, wget, yt-dlp, aria2, HTTPie, and more.

Replaces Get cookies.txt LOCALLY — no browser extension needed, works entirely through your userscript manager.

Why You Need This

Downloading authenticated content requires valid cookies. Dedicated cookie extensions exist, but they add another icon to your toolbar, another permission to manage, and another update to track. This script uses your userscript manager's built-in GM_cookie API — no separate extension needed.

Key Features

  • Menu Command: Use the Violentmonkey/Tampermonkey menu to export cookies for the current site or all sites.
  • Multiple Formats: Choose between Netscape (curl, wget, yt-dlp), JSON, or header format — cycle via the menu command.
  • Full Auth Cookies: Includes HttpOnly cookies (SAPISID, SID, SIDCC, etc.) — just enable one setting in your userscript manager.
  • API Auto-Detection: Works with GM_cookie callback, object, and promise APIs across browsers.
  • Fallback Chain: Tries URL → domain → all-cookies fallback if a scoped query fails.
  • Visual Feedback: Toast notification on success with cookie count.
  • Setup Banner: If the API is unavailable, a guided overlay shows exactly which settings to enable.

Usage

Action Result
VM/TM menu → Export Cookies Export cookies for current site
VM/TM menu → Export All Cookies Export cookies for all sites
VM/TM menu → Format: name (click to change) Cycle through Netscape, JSON, header

Enable HttpOnly Access (One-Time)

The export includes auth cookies by default. To include HttpOnly cookies:

Violentmonkey (Beta v2.35.1+):

  • Settings → Advanced → Script settings → Enable "Allow GM_cookie to access HTTP-only cookies"
  • Also enable it in this script's Settings tab

Tampermonkey:

  • Settings → Config mode: Advanced → Security → "Allow scripts to access cookies" → All

Running the Exported File

curl -b www.youtube.com_cookies.txt "https://example.com"
wget --load-cookies=www.youtube.com_cookies.txt "https://example.com"
yt-dlp --cookies www.youtube.com_cookies.txt "https://youtube.com/watch?v=..."
aria2c --load-cookies=www.youtube.com_cookies.txt "https://example.com"
http -b @www.youtube.com_cookies.txt "https://example.com"

How It Works

  1. Detects which GM_cookie API variant the userscript manager exposes (callback, object, promise).
  2. Queries cookies for the current site via the browser's extension API.
  3. Retries with domain then empty details if the URL-scoped query fails.
  4. Converts to the selected format (Netscape, JSON, or header).
  5. Triggers a file download as example.com_cookies.txt.
  6. Format selection persists across sessions.

Compatibility

Manager Status
Tampermonkey ✅ Full support
Violentmonkey ✅ v2.35.1+ (enable HttpOnly per above)
Greasemonkey ❌ GM_cookie not supported

The exported file works with any tool that accepts Netscape cookie files — notably curl, wget, yt-dlp, aria2, and HTTPie. This is the same format used by the original Netscape browser and adopted by curl; it remains the standard for passing browser cookies to command-line HTTP tools.

Installation

  1. Install Violentmonkey or Tampermonkey
  2. Install this script
  3. Visit any site and use the VM/TM menu → Export Cookies

No configuration required. For full auth cookie export including HttpOnly cookies, enable cookie access in your manager's settings (see above).