Cookie Exporter | Netscape, JSON, Header

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

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

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

Tendrás que instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Tendrás que instalar una extensión como Tampermonkey antes de poder instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

Autor
piknockyou
Instalaciones diarias
0
Instalaciones totales
2
Calificaciones
0 0 0
Versión
3.0.9
Creado
22/7/2026
Actualizado
22/7/2026
Tamaño
12,4 KB
Licencia
AGPL-3.0
Funciona en
Todos los sitios

☕ 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).