Some platforms block anonymous downloads. dwnld-any stores cookies as Netscape-format text files under ~/.config/dwnld-any/cookies/ and loads them via environment variables.
| Platform | Required? | Env variable | Default file |
|---|---|---|---|
| Yes | YTDLP_COOKIES_INSTAGRAM |
~/.config/dwnld-any/cookies/instagram.txt |
|
| YouTube | Optional | YTDLP_COOKIES_YOUTUBE |
~/.config/dwnld-any/cookies/youtube.txt |
| Optional | YTDLP_COOKIES_REDDIT |
~/.config/dwnld-any/cookies/reddit.txt |
|
| X (Twitter) | Optional | YTDLP_COOKIES_X (or X_AUTH_TOKEN + X_CT0) |
~/.config/dwnld-any/cookies/x.txt |
Run python -m dwnld setup to see which cookies are configured.
mkdir -p ~/.config/dwnld-any/cookiesUse a browser extension that exports Netscape cookie format (.txt):
-
Install one of:
- Get cookies.txt LOCALLY (Chrome/Edge)
- cookies.txt (Firefox)
-
Log in to the platform in that browser (instagram.com, youtube.com, etc.).
-
Open the site, click the extension, and export cookies for that domain.
-
Save the file to the path in the table above.
Security: Cookie files are session keys. Never commit them to git or paste them in chat. If exposed, log out everywhere and export fresh cookies.
Instagram downloads will fail without cookies.
- Go to instagram.com and log in.
- Export cookies with your extension.
- Save as:
~/.config/dwnld-any/cookies/instagram.txt
Add to ~/.zshrc or ~/.bashrc:
export YTDLP_COOKIES_INSTAGRAM=~/.config/dwnld-any/cookies/instagram.txtReload: source ~/.zshrc
python -m dwnld setup
# instagram row should show: readyThe file should include (at minimum) for .instagram.com:
sessionidcsrftokends_user_id
Helps when YouTube shows “Sign in to confirm you're not a bot.”
- Log in at youtube.com.
- Export cookies → save to
~/.config/dwnld-any/cookies/youtube.txt. - Export:
export YTDLP_COOKIES_YOUTUBE=~/.config/dwnld-any/cookies/youtube.txt
Reddit often blocks anonymous API access (HTTP 429). dwnld-any uses --impersonate chrome by default; cookies help when that is not enough.
- Log in at reddit.com.
- Export cookies → save to
~/.config/dwnld-any/cookies/reddit.txt. - Export:
export YTDLP_COOKIES_REDDIT=~/.config/dwnld-any/cookies/reddit.txt
Note: Text-only posts have no video — only posts with embedded video can be downloaded.
Public tweets usually work without cookies. Export cookies if you hit login or rate-limit errors.
- Log in at x.com.
- Export cookies → save to
~/.config/dwnld-any/cookies/x.txt. - Export:
export YTDLP_COOKIES_X=~/.config/dwnld-any/cookies/x.txt
If you already have auth_token and ct0 from your browser's dev tools (Application/Storage → Cookies → x.com), set them directly — no file export needed:
export X_AUTH_TOKEN=<your auth_token value>
export X_CT0=<your ct0 value>Both must be set together — a lone X_AUTH_TOKEN or X_CT0 is treated as not configured. If YTDLP_COOKIES_X also points at an existing file, that file takes precedence over these raw values.
Security: the same rule as cookie files applies — set these as env vars in your own shell/session, never paste the actual token values in chat.
Add all exports to your shell profile:
# ~/.zshrc
export YTDLP_COOKIES_INSTAGRAM=~/.config/dwnld-any/cookies/instagram.txt
export YTDLP_COOKIES_YOUTUBE=~/.config/dwnld-any/cookies/youtube.txt
export YTDLP_COOKIES_REDDIT=~/.config/dwnld-any/cookies/reddit.txt
export YTDLP_COOKIES_X=~/.config/dwnld-any/cookies/x.txtOr copy .env.example to .env in the repo and source it during sessions (do not commit .env).
When an agent asks for cookies:
- Do not paste cookie values in chat.
- Tell the agent the file path on your machine, e.g.
~/.config/dwnld-any/cookies/instagram.txt. - Or export fresh cookies to that path and confirm the env var is set.
- The agent runs
python -m dwnld setupto verifyfile_exists: true.
| Symptom | Fix |
|---|---|
empty media on Instagram |
Re-export cookies; session may have expired |
| YouTube bot check | Add YTDLP_COOKIES_YOUTUBE |
| Reddit HTTP 429 | Add YTDLP_COOKIES_REDDIT or retry later |
| X login required | Add YTDLP_COOKIES_X |
| File not found | Check path and export in the same shell session |