Instagram & Cookies

Instagram often blocks anonymous downloads. ClipCookBook uses a Netscape cookie file with yt-dlp so video imports keep working. Cookies are optional for platforms that do not require login.

  • Default path: data/cookies.txt (override with YT_DLP_COOKIES)
  • Format: Netscape cookies export
  • Must include a valid Instagram sessionid (the app validates this)

Do not commit cookie files to git; treat them like passwords.

Upload in the app

Open /cookies on your ClipCookBook instance (bookmark the URL — it is not linked in the main header).

There you can:

  • Check whether cookies are present and look valid
  • Upload a cookie file or paste Netscape cookie text
  • Follow short instructions for refreshing cookies

Access requires site login, SITE_PASSWORD (Bearer), or a trusted home/LAN request — same trust model as the admin cookie API.

Local helper (Playwright)

The app repository includes tools/instagram-cookies/: a small Playwright script that opens a clean browser, lets you log into Instagram, exports Netscape cookies, and can upload them to your app.

cd tools/instagram-cookies
bun install
bunx playwright install chromium
bun run refresh -- --url https://your-app --password "SITE_PASSWORD"

Your app root package.json may also expose cookies:refresh as a convenience wrapper.

When cookies expire

If cookies are configured but auth still fails:

  1. Import may fall back to public Instagram metadata (caption / thumbnail) so you can still get a recipe without video.
  2. If SMTP and SMTP_ALERT_TO are set, you get a one-time email until a successful cookie download clears the alert flag.

Refresh cookies via /cookies or the helper when that happens.

See the full table in Installation. The most relevant ones:

Variable Role
YT_DLP_COOKIES Path to the cookie file
SMTP_ALERT_TO Where expired-cookie alerts are sent
SITE_PASSWORD Used by the upload API / helper