Skip to content
Projekte

Über uns

Pick-a-Recipe: AI-powered recipe extraction from TikTok, YouTube & Instagram videos with automatic import to Tandoor/Mealie recipe managers.

KI und maschinelles Lernen

So werden diese Zahlen gemessen

What you can do

  • 🎥 Multi-platform video support (TikTok, YouTube, Instagram, etc.)
  • 🎙️ Audio transcription with language detection
  • 👁️ Visual text extraction from video frames
  • 🤖 AI-powered recipe generation with structured ingredients

Gemessener Sternzuwachs

in 24h
0
in 7 days
+1
in 15 days
+3
in 1 month
Verlauf wird gesammelt

Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.

README.md

Original

Pick-a-Recipe

Pick-a-Recipe

Python Docker Hub Docker Pulls Flask License

Extract recipes from social media videos (TikTok, YouTube, Instagram, etc.) and automatically import them into your self-hosted recipe manager.

Overview

Pick-a-Recipe is a Python application that:

  1. Downloads videos from TikTok, YouTube, Instagram, and other platforms using yt-dlp
  2. Transcribes audio using Whisper AI (via faster-whisper)
  3. Extracts on-screen text (ingredients, instructions) using vision-capable LLMs
  4. Generates structured recipes using an AI provider you configure (OpenAI, Google Gemini, Anthropic, or any OpenAI-compatible endpoint)
  5. Uploads to recipe managers - supports Tandoor and Mealie

Features

  • 🎥 Multi-platform video support (TikTok, YouTube, Instagram, etc.)
  • 🎙️ Audio transcription with language detection
  • 👁️ Visual text extraction from video frames
  • 🤖 AI-powered recipe generation with structured ingredients
  • 🍽️ Automatic nutrition and serving size estimation, backed by Open Food Facts
  • 🖼️ Dish image extraction with manual selection option
  • 🌐 Web UI with real-time progress updates
  • 🔐 User authentication and settings management
  • 🐳 Docker support for easy deployment
  • 📱 PWA Support - Install as app on mobile, share URLs directly from Android/iOS

Requirements

  • Python 3.11+
  • FFmpeg (for video/audio processing)
  • An API key for OpenAI, Google Gemini or Anthropic — or any OpenAI-compatible endpoint (OpenRouter, Groq, a local Ollama, …)
  • Self-hosted Tandoor or Mealie instance (optional)

Installation

Using Docker (Recommended)

Option 1: Pull from Docker Hub (Easiest)

docker run -d \
  --name pick-a-recipe \
  -p 5006:5006 \
  -e FLASK_SECRET_KEY="your-secure-secret-key" \
  -e LOG_LEVEL=info \
  -v pick-a-recipe-data:/app/data \
  pickeld/pick-a-recipe:latest

Open http://localhost:5006 and pick a username and password. That first visit is the only time the setup page is available; once an account exists it closes for good.

No identity provider is needed. If you would rather sign in through single sign-on, see Authentication.

Option 2: Using Docker Compose

Create a docker-compose.yml file:

version: "3.8"

services:
  pick-a-recipe:
    image: pickeld/pick-a-recipe:latest
    container_name: pick-a-recipe
    restart: unless-stopped
    ports:
      - "5006:5006"
    environment:
      - FLASK_SECRET_KEY=your-secure-secret-key
      # info by default. debug when a bug report needs every step; restart after changing it.
      - LOG_LEVEL=info
    volumes:
      - pick-a-recipe-data:/app/data

volumes:
  pick-a-recipe-data:

Then run:

docker-compose up -d

Open http://localhost:5006 and create your account.

Manual Installation

  1. Clone the repository:

    git clone https://github.com/pickeld/pick-a-recipe.git
    cd pick-a-recipe
    
  2. Install system dependencies:

    # macOS
    brew install ffmpeg
    
    # Ubuntu/Debian
    sudo apt-get install ffmpeg
    
  3. Create a virtual environment and install Python dependencies:

    python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    
  4. For the mobile apps to sign in, set JWT_SECRET_KEY, which signs their tokens:

    export JWT_SECRET_KEY=$(python -c "import secrets; print(secrets.token_hex(32))")
    

    Without it the web app works, but the handshake reports mobile_auth: false, the apps stop before sign-in, and the /api/mobile/* sign-in endpoints answer 503. Keep the same value across restarts: a new one signs every app out.

  5. Run the application from the repository root:

    PYTHONPATH="$PWD" python ui/app.py
    

    ui/app.py imports the modules at the repository root (config, uploaders and the rest) by name, and python ui/app.py puts only ui/ on the import path, so without PYTHONPATH it stops with ModuleNotFoundError: No module named 'config'. The Docker image sets PYTHONPATH=/app for the same reason.

  6. Open http://localhost:5006 and create your account on the setup page.

Configuration

All configuration is managed through the web UI settings page (/settings). Instance configuration is admin-only: under OIDC, an operator must be in OIDC_ADMIN_GROUP (default admins) to change settings.

Authentication

Sign-in is always required. Settings holds your LLM, Mealie and Tandoor API keys, so an instance anyone can reach is an instance that hands those out.

Two modes, selected with AUTH_MODE:

AUTH_MODE Behaviour
local (default) Username and password accounts stored by this app. No identity provider needed.
oidc Single sign-on through any OpenID Connect provider — Authentik, Authelia, Keycloak, Pocket ID, Zitadel, Okta … Accounts and groups come from that provider.

local — accounts stored by this app (default)

Start the app and open it in a browser. With no account yet, every page redirects to /setup, where you choose a username and password:

docker run -d --name pick-a-recipe -p 5006:5006 \
  -v pick-a-recipe-data:/app/data \
  pickeld/pick-a-recipe:latest

The setup page is reachable only while the instance has no account, and closes permanently once one exists — so nobody can use it to add a second admin or reset your password. If your instance is already reachable from the internet when you first start it, create the account promptly: until you do, whoever loads that page first gets it. AUTH_LOCAL_USERNAME prefills the username field, nothing more.

Passwords must be at least 10 characters, with no composition rules: length is what makes a password hard to guess, while forced symbols mostly produce predictable substitutions. They are stored as Argon2id hashes with a per-account salt, and rehashed automatically if the cost parameters are ever raised.

Repeated failures are slowed progressively rather than locking the account, which would let anyone who knows your username lock you out at will. Wrong password and no-such-user return the same message and take comparable time, so the login form cannot be used to discover which accounts exist.

Accounts and admins

The account created on the setup page is an admin. Admins see the whole settings page and manage accounts there; everyone else gets a sign-in and a password form. That split exists because settings holds your API keys, so an ordinary account should not be able to read them.

Admins can add accounts, grant or revoke admin rights, set a password for someone who forgot theirs, and delete accounts. There is no self-registration: on a self-hosted instance, an open sign-up form is a way in for anyone who finds the URL. Two rules cannot be worked around, because either would leave the instance with no way back in: you cannot remove your own admin rights, and you cannot remove the last admin's.

Everyone can delete their own account under Delete my account in Settings (DELETE /api/me), after typing their current password; with oidc, their username. The last admin cannot, so the instance always keeps one. Admins delete other accounts in the accounts list (with oidc, which has no list, through DELETE /api/users/<username>); their own goes through Delete my account.

Deleting an account removes its queued and in-progress jobs, its pending uploads, its extraction history, its app sign-ins and push subscriptions, and its favorites, ratings, notes, cook log, share links and calendar feed token. Recipes saved to the Library, Mealie or Tandoor are left alone (Library recipes, collections and meal plan entries it created lose their author), and so are older history entries that could not be traced to an account. Deleting or demoting someone takes effect on their next request rather than whenever their cookie expires, so revoking access is immediate. With oidc, the identity provider's account is not touched, and signing in again creates a fresh, empty account.

Extraction history (the Done and Failed rows on the Tasks page) is per account: everyone sees and manages their own, and admins see everyone's. Entries recorded before this existed, whose owner could not be worked out from their job, are visible to everyone but only an admin can delete, retry or re-upload them.

Changing your own password requires your current one, so a borrowed session cannot be used to lock you out of your own account.

In oidc mode the rest of this section does not apply: accounts, passwords and group membership live in the identity provider, and the settings page says so instead of offering controls that could not work. Deleting accounts still works, as above.

Upgrading from AUTH_MODE=none

That mode is gone; authentication can no longer be switched off. An instance still setting it boots with a warning and is treated as local, landing on the setup page. Ownership of recipes and history is recorded against the username that mode used, so the setup page offers that name and reuses the account rather than creating a second one — accept it, pick a password, and your history carries over. Typing a different name starts with an empty history. Update your configuration to AUTH_MODE=local, or drop the variable entirely.

oidc — single sign-on

Works with any OpenID Connect provider: Authentik, Authelia, Keycloak, Pocket ID, Zitadel, Okta and the rest. Nothing here is specific to one of them — the app only uses OIDC discovery, the authorization code flow and standard claims.

Register a confidential OAuth2/OIDC client for the app with the redirect URI https://your-host/auth/callback, then set:

AUTH_MODE=oidc
OIDC_ISSUER_URL=https://auth.example.com/application/o/pick-a-recipe
OIDC_CLIENT_ID=...
OIDC_CLIENT_SECRET=...
OIDC_PROVIDER_NAME=Authentik   # optional, names the sign-in button

OIDC_ISSUER_URL is the URL whose /.well-known/openid-configuration describes the provider. Everything else is discovered from there.

Access is gated on group membership: users need OIDC_USER_GROUP (default pick-a-recipe-users), and admins additionally need OIDC_ADMIN_GROUP (default admins). Set OIDC_USER_GROUP= (empty) to let every authenticated user in, which is what you want from a provider that does not publish groups.

Each sign-in records on the account whether the groups made it an admin, and every request (browser, app or app WebView) reads the role from that record, never from the session cookie. The record is trusted for 24 hours: after that the account works as a plain user until its next sign-in through the provider, which re-reads the groups and restores admin rights. An admin who needs them again opens /auth/login, or signs out and in. So removing someone from OIDC_ADMIN_GROUP takes effect at their next sign-in, and within 24 hours at most. A sign-in the provider's groups refuse drops the role at once. Being removed from OIDC_USER_GROUP does not end sessions that are already open; delete the account under Users for that.

Groups are read from the claim named by OIDC_GROUPS_CLAIM (default groups), accepting a list of names, a space- or comma-separated string, or a list of objects with name/path. Keycloak's leading / on path-style groups is ignored, so configure the plain name. Publishing that claim is provider-specific: Authentik needs the authentik read groups scope mapping on the provider, Keycloak a group membership mapper, Authelia the groups scope.

Behind a reverse proxy, set PUBLIC_URL (or OIDC_REDIRECT_URI) so the OIDC callback URL matches what you registered with the provider, and set SESSION_COOKIE_SECURE=true when serving over HTTPS.

Password sign-in is refused outright in this mode, so an account that happens to carry a password cannot be used to go around single sign-on.

With AUTH_MODE=oidc set but no issuer or client credentials configured, nobody can sign in and the login page says so. It fails closed on purpose; drop AUTH_MODE to fall back to local accounts.

Upgrading: AUTH_MODE=authentik and the AUTHENTIK_* variables still work — they map onto oidc and the matching OIDC_* names, with a note in the log. Nothing needs changing to keep an existing Authentik setup running.

Mobile app sign-in

The mobile apps authenticate with bearer tokens. Set a signing key to enable them:

JWT_SECRET_KEY=$(python -c "import secrets; print(secrets.token_hex(32))")

With JWT_SECRET_KEY unset the whole mobile surface stays disabled and those endpoints return 503.

The app asks for your server's address on first launch — nothing is compiled in, since everyone runs their own instance — then reads /api/auth/status and offers whichever sign-in that instance has. Under local it posts the username and password to /api/mobile/auth/login, which applies the same throttle ladder as the web form, so neither is a way around the other. Under oidc a password is refused there: group membership governs access, not any password an account happens to carry.

For single sign-on the app cannot hold the OIDC client secret, so it opens the system browser and the server completes the code exchange with the provider. The app sends a PKCE challenge (code_challenge, code_challenge_method=S256) to GET /api/mobile/auth/login-url, which confirms it with code_challenge_method: "S256" in its reply. After sign-in the browser returns to exactly par://auth/callback?code=…&state=… (the scheme is configurable with MOBILE_DEEP_LINK_SCHEMES). The code is single-use, lasts 60 seconds and is worthless without the verifier: the app trades it for a token pair at POST /api/mobile/auth/token with {code, code_verifier, device_label, platform}. An app that intercepts the deep link therefore gets nothing it can use. Apps that send no challenge (releases before this change) still receive the pair in the URL fragment; that path is being retired.

Access tokens last 15 minutes and refresh tokens 30 days. POST /api/mobile/auth/refresh rotates them: each refresh spends the token it is given and returns the next pair. The same token presented again within 60 seconds gets that pair back, so a lost response does not cost the session; presented later, it ends the session. Every app session ends after 90 days however often it is refreshed, and sooner on POST /api/mobile/auth/logout or when the account is deleted. Changing your own password signs out your other app devices but keeps the one making the change; an admin reset signs out all of them. Identity-provider group changes are not re-checked until the next sign-in, at most 90 days later. Clients follow the session contract.

Bearer tokens are accepted on the existing API endpoints alongside cookie sessions; cookies take precedence when both are present.

Settings

Setting Description
AI Providers The models this instance can reach — see AI providers
AI Extraction Which provider turns video and page content into a recipe
Speech to Text Whisper on this server, or a provider with an audio endpoint
Recipe Language Target language for recipe output (e.g., hebrew, english)
Target Language Code ISO language code for transcription (e.g., he, en)
Whisper Model Whisper model size (tiny, small, medium, large)
Output Target Recipe manager: tandoor or mealie
Tandoor Host URL of your Tandoor instance
Tandoor API Key API token from Tandoor
Mealie Host URL of your Mealie instance
Mealie API Key API token from Mealie
Confirm Before Upload Show recipe preview before uploading
Nutrition lookup Look ingredients the built-in table does not know up in Open Food Facts (on by default; no API key needed)

Nutrition

Per-serving nutrition is worked out from the ingredient list, not guessed by the model. Each ingredient is converted to grams and costed against a built-in table of per-100 g figures covering the ~180 foods that come up most often, in English and Hebrew.

Anything the table does not recognise is looked up in Open Food Facts — an open, collaborative food database with worldwide coverage, which needs no API key or account. Because its entries are individual branded products, the median of several popular matches is used rather than the first hit. Results are cached, outbound searches are capped at ten a minute to stay within what Open Food Facts asks of clients, and a failed lookup is simply skipped: nutrition is an extra, and never fails an extraction.

Turn Nutrition lookup off in Settings for a fully offline instance. The built-in table keeps working either way.

Open Food Facts data is published under the Open Database License.

AI providers

Nothing is hardcoded to a vendor. Under Settings -> AI Providers you add as many providers as you like, each one a name plus four things:

Field What it is
API type The dialect the endpoint speaks: OpenAI (Responses API), OpenAI-compatible (Chat Completions), Google Gemini, or Anthropic (Claude)
API key The provider's key. A local server (Ollama, LM Studio, vLLM) needs none
Model Free text, always. Suggestions come from models.dev, but a model it has never heard of works just the same
Base URL Only for OpenAI-compatible endpoints — https://openrouter.ai/api/v1, https://api.groq.com/openai/v1, http://localhost:11434/v1, whatever you run

So OpenRouter is no longer a special case in the code: it is one OpenAI-compatible endpoint among many, distinguished only by its base URL. The same field reaches Groq, Together, DeepSeek, Mistral, xAI, LiteLLM, a self-hosted vLLM or an Ollama on your LAN.

The sections below then choose from those providers rather than carrying keys of their own:

  • AI Extraction turns video and page content into a structured recipe. It also reads on-screen text and picks the dish photo, so it needs a model that can see images.
  • Speech to Text either runs Whisper on this server — no API, no network — or posts the audio to a provider with an OpenAI-compatible /audio/transcriptions endpoint. A provider that fails falls back to local Whisper rather than losing the audio.

The HuggingFace token under Speech to Text is not an AI provider key: it only makes the Whisper weights download faster and at a higher rate limit.

If a model is retired, the app fails over to the next known-good model for that dialect and writes the working one back to that provider. OpenAI-compatible providers have no such chain — a model name that works on Groq is a 404 on OpenRouter — so there you get a clear error naming the provider instead.

Upgrading: an existing install keeps working untouched. The old llm_provider, openai_*, gemini_* and openrouter_* settings are read as a provider registry on first load, with the provider you had selected still selected.

Usage

Web UI

  1. Navigate to http://localhost:5006
  2. Log in with your credentials
  3. Paste a video URL (TikTok, YouTube, Instagram, etc.)
  4. Click "Extract Recipe"
  5. Watch the real-time progress as the video is processed
  6. If "Confirm Before Upload" is enabled, review and optionally edit the recipe
  7. The recipe is automatically uploaded to your configured recipe manager

PWA / Mobile App (Share Links Directly)

Pick-a-Recipe supports PWA (Progressive Web App) installation, allowing you to share video links directly from your phone:

Android

  1. Open https://your-server:5006 in Chrome
  2. Tap the menu (⋮) → "Add to Home screen"
  3. Now when sharing any video link, choose "Pick-a-Recipe" from the share sheet

iPhone / iPad

  1. Open https://your-server:5006 in Safari
  2. Tap the Share button → "Add to Home Screen"
  3. Open the app from your home screen
  4. Share video links from TikTok/Instagram/YouTube using the Share button → "Pick-a-Recipe"

Note: PWA features require HTTPS in production. For local testing, localhost works without HTTPS.

Command Line

For testing or batch processing, you can use the CLI:

# Basic usage
python main.py "https://www.tiktok.com/@user/video/1234567890"

# Skip upload (just generate recipe JSON)
python main.py --no-upload "https://www.youtube.com/watch?v=VIDEO_ID"

Mobile apps (iOS + Android)

The Android and iOS apps are native shells around this web app: each web route shows as a native screen, following the path configuration the server compiles from contracts/parity.yaml. Neither app has a server compiled in. Everyone runs their own instance, so on first launch the app asks for the server's address, checks it with GET /api/app/handshake, and then offers whichever sign-in that server has (see "Mobile app sign-in" under Authentication; the server needs JWT_SECRET_KEY).

App Where Status
Android mobile/android, Kotlin Android 10 (API 29) and later. Built on every release.
iOS mobile/ios, Swift iPhone, iOS 18 and later. Unsigned, simulator only; parked until Android ships.

mobile/maestro holds the Android smoke flows and mobile/fastlane the Play listing metadata.

Contracts. The rules both apps follow live in AGENTS.md: the bridge wire rules and compatibility ("Compatibility"), and how an app signs its WebView in with a one-time code ("WebView session"). The token rules are below.

Session contract

Every app client follows these rules. Each sign-in opens a family on the server. POST /api/mobile/auth/refresh spends the refresh token it is given and returns the family's next pair, and the server signs every family out after 90 days however often it is refreshed.

  • Persist every replacement pair before using it or replaying a request. The old refresh token is spent the moment the server answers.
  • One writer for the stored pair. Share-sheet activities, extensions and widgets that read the same storage must coordinate with the app, or one of them will spend a token the other still holds. Writes after a sign-out or a server switch must be dropped, not applied.
  • Retry transient failures with the token you hold. If a refresh times out or gets a 5xx, keep the pair. The server keeps a 60-second grace window: the same spent token returns the same new pair inside it. Presenting a spent token after the window is treated as theft and ends the family.
  • Stop on a terminal rejection. A 400 or 401 from refresh means the session is gone: clear it and show sign-in. Do not retry. A 401 on the request replayed after a successful refresh keeps the pair and fails only that request: during a rollout, a replica without mobile auth can refuse a live pair.
  • Sign out on the server first. Send {"refresh_token": …} to POST /api/mobile/auth/logout (no bearer header, short timeout, never retried on 401) before clearing local state or switching servers, and send it to the server that issued the token. It answers 204 either way. Offline, a sign-out only clears the device; the server-side session runs out on its own.
  • A password change signs out the account's other devices. The device that changed it stays signed in; an admin reset signs out all of them.
  • Password sign-in sends device_label and platform (android, ios or other) so the server can name the session.
  • Do not open the browser without the acknowledgment. login-url answers 200 {auth_url, state, code_challenge_method: "S256"}. The last field says the server stored the challenge; a server without it is older, and would put the tokens themselves in the redirect. Say that mobile sign-in is not configured on the server, since trying again cannot help.
  • Exchange the code once. POST /api/mobile/auth/token with {code, code_verifier, device_label, platform}, no bearer header, redirects not followed, never retried on 401 or after a timeout. It answers 200 {access_token, refresh_token, token_type, expires_in}; every refused grant (expired, spent, wrong verifier) is 400 {"error": "invalid_grant"}, and a server without JWT_SECRET_KEY answers 503. Either way the attempt is over: the user starts again, and a pair already stored stays as it was.

Both apps receive the browser sign-in at par://auth/callback, and the server only redirects to schemes listed in MOBILE_DEEP_LINK_SCHEMES; changing the scheme means changing the apps and the server. How each app stores its tokens is in its own README.

Android releases

Every release builds both Android artifacts with Gradle, from the release tag (scripts/version_code.py turns it into the versionCode):

  • release-apk.yml runs assembleRelease -Ppar.signingKey=apk and attaches the APK to the GitHub release, signed with the app signing key.
  • release-play.yml runs bundleRelease -Ppar.signingKey=upload and uploads the AAB, signed with the Play upload key, to Google Play's internal track (without the PLAY_SERVICE_ACCOUNT_JSON secret it keeps the AAB as a run artifact). A manual run can promote a tag from internal to closed testing or production (a release candidate to closed testing only), or, on the internal track with dry_run, build and check without uploading.

Both lanes fail unless the build is signed with the certificate pinned for its key set. The keystores and passwords are repository secrets; the key aliases are the repository variables ANDROID_KEY_ALIAS and PLAY_UPLOAD_KEY_ALIAS. To build a release by hand, see "Release builds" in mobile/android/README.md.

Upgrading from the Flutter app

Up to v26.12.03-29 the Android app was a Flutter app; v26.12.03-30 is the first Kotlin release. The Kotlin app keeps its package (com.pickel.pickarecipe) and signing key, so it installs over the Flutter app in place (the first Kotlin release candidate, v26.12.03-30-rc1, was checked doing so over v26.12.03-27). From v26.12.03-34 (#264), on first launch it also takes over the server address the Flutter app saved and deletes what the Flutter app kept in its secure storage, tokens included, so upgraded users sign in once more. The Kotlin app needs Android 10 (API 29), where the Flutter app ran on Android 7 (API 24): phones on Android 7 to 9 stay on v26.12.03-29.

Testing

docs/mobile-test-plan.md is the checklist for each Android release candidate on a physical phone, including how release candidates are tagged and installed. Each app's README lists its unit and device tests.

Project Structure

pick-a-recipe/
├── main.py              # CLI entry point
├── chef.py              # AI recipe generation
├── config.py            # Configuration management
├── video_downloader.py  # Video downloading (yt-dlp)
├── transcriber.py       # Audio transcription (Whisper)
├── image_extractor.py   # Dish image extraction
├── mealie.py            # Mealie API integration
├── tandoor.py           # Tandoor API integration
├── recipe_exporter.py   # Recipe export utilities
├── helpers.py           # Utility functions and prompts
├── ai_providers.py      # Configurable AI providers + one client per dialect
├── frame_selector.py    # Picks the dish photo via the configured provider
├── model_catalog.py     # Model suggestions with prices (models.dev, OpenRouter live) for the settings page
├── ui/                  # Flask web UI
│   ├── app.py           # Flask application
│   ├── database.py      # SQLite database management
│   ├── templates/       # HTML templates
│   └── static/          # CSS and JavaScript
├── Dockerfile
├── docker-compose.yml
├── docker-compose.srv2.yml   # srv2 reference (see portainer/ for production)
├── build-and-push.sh         # Publish pickeld/pick-a-recipe to Docker Hub
├── portainer/
│   ├── stack.yml             # Portainer / srv2 production stack
│   └── stack.env             # Stack env template (copy to stack.env.local)
├── scripts/
│   ├── portainer-migrate.sh  # srv2 deploy: pull image + restart stack
│   └── portainer-deploy.sh   # Deploy via Portainer API
└── requirements.txt

Docker Deployment

Docker Hub Image

The official image is available on Docker Hub: pickeld/pick-a-recipe

# Pull the latest image
docker pull pickeld/pick-a-recipe:latest

# Or pin an exact build: every push to main is also tagged with its commit SHA
docker pull pickeld/pick-a-recipe:<commit-sha>

Published for linux/amd64 and linux/arm64, so the same tag works on Intel/AMD machines, a Raspberry Pi 4 or 5 running a 64-bit OS, Apple Silicon and ARM cloud servers. 32-bit ARM (linux/arm/v7, e.g. 32-bit Raspberry Pi OS) is not supported: faster-whisper's CTranslate2 backend and deno ship no builds for it.

Environment Variables

Variable Description Default
HOST Host to bind to 0.0.0.0
PORT Port to listen on 5006
FLASK_SECRET_KEY Secret key for session cookies Auto-generated
FLASK_DEBUG Enable debug mode false
MAX_CONCURRENT_JOBS Parallel extraction workers (1–16) 3 (or Settings value)
AUTH_MODE local for accounts stored by this app, or oidc for SSO (details) local
AUTH_LOCAL_USERNAME Prefills the username field on the setup page admin
OIDC_ISSUER_URL OIDC issuer URL, the one serving /.well-known/openid-configuration (required when AUTH_MODE=oidc) —
OIDC_CLIENT_ID OAuth2 client ID (required when AUTH_MODE=oidc) —
OIDC_CLIENT_SECRET OAuth2 client secret (required when AUTH_MODE=oidc) —
OIDC_USER_GROUP Group required for access; empty admits any authenticated user pick-a-recipe-users
OIDC_ADMIN_GROUP Group granting admin rights admins
OIDC_GROUPS_CLAIM Claim the group names are read from groups
OIDC_SCOPES Scopes requested at the provider openid email profile groups
OIDC_PROVIDER_NAME Name shown on the sign-in button SSO
OIDC_REDIRECT_URI Callback URL, when PUBLIC_URL is not enough derived
AUTHENTIK_* Deprecated aliases for the OIDC_* variables above —
JWT_SECRET_KEY Signing key for mobile app tokens; unset disables mobile auth —
MOBILE_DEEP_LINK_SCHEMES Comma-separated URL schemes the app's sign-in callback (<scheme>://auth/callback) may use par
VAPID_PUBLIC_KEY / VAPID_PRIVATE_KEY Web Push signing pair (details) Generated on first use
VAPID_SUBJECT Contact URI push services can use to reach you mailto:[email protected]
PUSH_RELAY_ORIGINS Comma-separated HTTPS origins of push relays (details) none
PUSH_UNIFIEDPUSH Allow the UnifiedPush servers in UNIFIEDPUSH_ORIGINS false
UNIFIEDPUSH_ORIGINS Comma-separated HTTPS origins of UnifiedPush servers none
SESSION_COOKIE_SECURE Set secure cookie flag (use with HTTPS) false
UPLOAD_MAX_BYTES Largest video file POST /api/jobs/upload accepts, in bytes (clamped to 1 MiB–2 GiB). The default stays under Cloudflare's 100 MB request limit; raise it only when no proxy in front caps bodies lower 99614720 (95 MiB)

Notifications

Extraction takes minutes, so the useful signal — your recipe is saved, it failed, or it is waiting on you — lands after you have already closed the tab. Turn on Settings → Notifications in each browser you want notified, and the app pushes that signal to the OS.

Approvals are the ones worth enabling: they expire, and a missed one discards the extraction. That notification carries the deadline and is not delivered after the window closes.

Requires HTTPS (or localhost) — browsers refuse push on plain HTTP. On iOS, add the app to the Home Screen first; Safari only allows push for installed PWAs.

Nothing to configure: the server mints a VAPID key pair on first use and stores it in the database. Set VAPID_PUBLIC_KEY / VAPID_PRIVATE_KEY to manage the pair yourself instead — they take precedence when both are set. Generate one with:

python -c "
import base64
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import ec
k = ec.generate_private_key(ec.SECP256R1())
b64 = lambda b: base64.urlsafe_b64encode(b).rstrip(b'=').decode()
print('VAPID_PUBLIC_KEY=' + b64(k.public_key().public_bytes(
    serialization.Encoding.X962, serialization.PublicFormat.UncompressedPoint)))
print('VAPID_PRIVATE_KEY=' + b64(
    k.private_numbers().private_value.to_bytes(32, 'big')))
"

Changing the pair invalidates every existing subscription — each browser has to re-enable notifications — so keep it out of source control and treat it like any other credential. A push relay answers 403 vapid_key_mismatch for a subscription made with the old pair; the server logs it and keeps the row.

The server only sends to known push services, and checks this when a browser subscribes and again before every send:

  • Browser push services, always: fcm.googleapis.com, updates.push.services.mozilla.com, web.push.apple.com and subdomains of notify.windows.com.
  • Push relays listed in PUSH_RELAY_ORIGINS, as exact origins such as https://relay.example.com. Off by default; empty or none also means off. Relay endpoints must look like /push/<id>.
  • UnifiedPush servers listed in UNIFIEDPUSH_ORIGINS, only while PUSH_UNIFIEDPUSH=true. The server connects to the address it checked is public, so a listed name cannot be pointed at your network later. These sends ignore HTTPS_PROXY and REQUESTS_CA_BUNDLE: the server must reach the UnifiedPush host directly, and the host needs a publicly trusted certificate. An origin listed as a relay too is used only as a relay.

The native apps read the result from GET /api/app/handshake: features.push_relay, features.unifiedpush and the list push_relay_origins.

Only https:// on port 443 is accepted, and redirects are never followed. Invalid list entries are ignored with a warning in the log. A subscription whose host is no longer allowed is skipped and logged, never deleted, so a config change can be undone. Rows are deleted only when the push service answers 404 or 410. Each notification is at most 2,048 bytes of JSON: long recipe names and errors are cut short with "…".

Docker Compose (Using Docker Hub)

version: "3.8"

services:
  pick-a-recipe:
    image: pickeld/pick-a-recipe:latest
    container_name: pick-a-recipe
    restart: unless-stopped
    ports:
      - "5006:5006"
    environment:
      - HOST=0.0.0.0
      - PORT=5006
      - FLASK_SECRET_KEY=your-secure-secret-key
      # Local accounts by default; create yours on first visit at /setup
    volumes:
      - pick-a-recipe-data:/app/data

volumes:
  pick-a-recipe-data:

Building and Publishing to Docker Hub

CI publishes the multi-arch image (linux/amd64, linux/arm64) on every push to main — see .github/workflows/deploy.yml — and will not move :latest unless both architectures built. To push one by hand:

docker logout && docker login -u pickeld   # or [email protected]
./build-and-push.sh latest

Published as pickeld/pick-a-recipe on Docker Hub.

yt-dlp updates

yt-dlp is pinned in requirements.txt, so every image is built and tested with a known version. Don't bump it by hand: .github/workflows/yt-dlp-update.yml checks PyPI once a day, and when a new stable yt-dlp is out it commits fix: update yt-dlp to X on a bot/yt-dlp-X branch, runs CI there, pushes that commit to main once CI passes, and then dispatches a release and a deploy. Nightly builds are ignored.

  • Run it by hand from Actions → Update yt-dlp → Run workflow. dry_run is on by default and only reports what it would do; untick it for a real run.
  • A failed bump: CI's failed jobs are re-run once to rule out a flake. If they fail again, the bot/yt-dlp-X branch stays behind with a link to the CI run in the run summary. Later runs skip that version while the branch exists but still try any newer yt-dlp; delete the branch to let X try again.

The container still upgrades yt-dlp when it starts (see the Dockerfile CMD), so it can run a newer version than the pin between image updates.

srv2 / Portainer deployment

Production on srv2 is managed by Portainer. Add credentials to portainer/stack.env.local, then deploy:

cd /opt/pick-a-recipe
cp portainer/stack.env portainer/stack.env.local
# Edit stack.env.local: FLASK_SECRET_KEY, PORTAINER_URL, PORTAINER_USER, PORTAINER_PASSWORD

./scripts/portainer-migrate.sh

Or deploy/update directly:

./scripts/portainer-deploy.sh --pull --force-recreate

Important: Do not use docker compose up directly — Portainer will show "created outside of Portainer" and limit control. Always deploy via the scripts above or the Portainer UI.

Note: Existing srv2 installs may still use the legacy Docker volume social_recipe_social-recipes for data; the stack preserves it automatically.

Building from Source

If you prefer to build the image yourself:

git clone https://github.com/pickeld/pick-a-recipe.git
cd pick-a-recipe
docker build -t pick-a-recipe .
docker run -p 5006:5006 -e FLASK_SECRET_KEY="your-secret" pick-a-recipe

Supported Platforms

Pick-a-Recipe uses yt-dlp for video downloading, which supports:

  • TikTok
  • YouTube
  • Instagram Reels
  • Facebook Videos
  • Twitter/X Videos
  • And many more

Instagram troubleshooting

Instagram frequently blocks automated downloads. Pick-a-Recipe installs yt-dlp[curl-cffi] for browser impersonation, which is required for most public reels.

If you still see "Instagram sent an empty media response":

  1. Update to the latest Docker image or reinstall: pip install "yt-dlp[curl-cffi]". A new yt-dlp release reaches the image within a day or so (see yt-dlp updates); restarting the container also upgrades it in place.
  2. Confirm the reel opens in a private/incognito browser window (not logged in). If it does not, the post is private — upload a cookies.txt in Settings while logged into Instagram.
  3. Upload cookies in Settings → Video Downloads (export from your browser while logged into instagram.com).

This is an upstream Instagram/yt-dlp limitation, not a bug in the recipe extraction itself. See yt-dlp issue #17074 for background.

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Ähnliche Projekte entdecken

Wird geladen…