Windows 11/10  ·  Chrome / Firefox / Edge  ·  Private & member-only content

gallery-dl Cookies & Login on Windows — Authentication Guide

Many sites require login to download private galleries. gallery-dl reads cookies directly from your browser — no passwords stored, no manual export needed for Chrome, Firefox, and Edge.

Pass browser cookies to gallery-dl in one command

Works for most sites — Instagram, Twitter/X, Pixiv, DeviantArt, Reddit, Patreon and more. Make sure you're logged in to the site in your browser first.

Use cookies from Chrome (most common)
gallery-dl --cookies-from-browser chrome "URL"
Use cookies from Firefox
gallery-dl --cookies-from-browser firefox "URL"
Use cookies from Microsoft Edge
gallery-dl --cookies-from-browser edge "URL"
Use cookies from Brave
gallery-dl --cookies-from-browser brave "URL"
Important: The browser must be closed or at least not actively syncing when gallery-dl reads cookies on Windows. If you get a "database locked" error, close Chrome/Firefox completely and try again.

Using a cookies.txt file with gallery-dl on Windows

More reliable for automation and scheduled tasks — export once, reuse many times.

Step 01

Install a cookies export extension

Install Get cookies.txt LOCALLY from the Chrome Web Store or Firefox Add-ons. This exports in Netscape format that gallery-dl understands.

Step 02

Log in to the target site

Open the site in your browser and make sure you're fully logged in. Complete any 2FA if required.

Step 03

Export cookies for that site

Click the extension icon while on the site → Export. Save the file as cookies.txt in your gallery-dl folder, e.g. C:\Tools\gallery-dl\instagram-cookies.txt

Step 04

Pass the file to gallery-dl

Use --cookies flag or add the path to your config file for permanent use.

Use a cookies.txt file — CLI
gallery-dl --cookies "C:\Tools\gallery-dl\instagram-cookies.txt" "URL"
Set cookies file permanently in config.json (per site)
"instagram": { "cookies": "C:/Tools/gallery-dl/instagram-cookies.txt" }

Site-specific authentication tips

Instagram

Required for private accounts and high-res downloads. Log in via browser, then:

gallery-dl --cookies-from-browser chrome "https://www.instagram.com/username/"

Twitter / X

Required for private accounts and to access full-resolution media. Twitter cookies expire frequently — re-export if it stops working.

gallery-dl --cookies-from-browser chrome "https://x.com/username/media"

Pixiv

Required for R-18 content and full image downloads. Log in at pixiv.net, then pass cookies.

gallery-dl --cookies-from-browser chrome "https://www.pixiv.net/users/USER_ID"

Patreon

Required for patron-only content. You must have an active subscription to the creator.

gallery-dl --cookies-from-browser chrome "https://www.patreon.com/creator"

gallery-dl cookies — frequently asked questions

gallery-dl says "Login required" even with cookies
Your cookies may have expired. Log out and back in on the site, then re-run the --cookies-from-browser command. For cookies.txt files, export a fresh copy. Also make sure your browser is completely closed before gallery-dl reads its cookie database on Windows.
"database is locked" when using --cookies-from-browser on Windows
Chrome and Edge lock their SQLite cookie database while running. Close all browser windows completely (check the system tray too), then run gallery-dl again. Alternatively, export to a cookies.txt file and use --cookies instead.
Is it safe to pass browser cookies to gallery-dl?
gallery-dl reads cookies locally from your browser — they never leave your machine. The tool is open source and audited. Never share your cookies.txt file — it grants full account access to whoever has it. Delete the file when you no longer need it.
Does gallery-dl support username/password login?
Some extractors support direct username/password login via -u USERNAME -p PASSWORD. However, this doesn't work for sites with 2FA or modern auth flows. The --cookies-from-browser method is more reliable and recommended for most sites.
How do I use cookies in the gallery-dl config file?
Add the cookies path under the site key in your config.json: "extractor": { "instagram": { "cookies": "C:/Tools/gallery-dl/cookies.txt" } } This applies cookies automatically for every Instagram download without needing the CLI flag.