Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/coah80/yoink/llms.txt

Use this file to discover all available pages before exploring further.

Yoink is configured through a combination of environment variables loaded at startup (via a .env file or the process environment) and constants compiled directly into the binary. Environment variables control runtime behavior like ports and API keys; compiled constants enforce hard limits such as queue sizes, file retention, and rate limiting. This page documents both layers.

Environment Variables

All variables are read by config.Load() at startup. Any variable not set falls back to its default. Copy .env.example to .env and edit as needed before running ./yoink.

Server

Controls the network interface and operational mode of the Yoink HTTP server.
VariableDefaultDescription
PORT3001TCP port the server listens on. The server binds to :<PORT> on all interfaces.
NODE_ENVdevelopmentRuntime environment. Set to production to enable production-mode behaviors (e.g., stricter error responses).

Authentication

Secrets used to protect privileged API endpoints.
VariableDefaultDescription
BOT_SECRET(none)Shared secret that authenticates requests from the Discord bot to bot-only API routes. If unset, bot endpoints are unprotected and Yoink will log a warning at startup.
COBALT_API_KEY(none)API key sent to authenticated Cobalt API instances. Leave blank if your Cobalt instance does not require authentication.
Leaving BOT_SECRET unset exposes bot endpoints to anyone who can reach your server. Always configure this before a public deployment.

Cobalt API

Yoink uses the Cobalt API as a fast path for supported sites. You can point it at one or more self-hosted Cobalt instances.
VariableDefaultDescription
COBALT_APIShttps://co.eepy.todayComma-separated list of Cobalt API base URLs. Yoink distributes requests across all entries.
SESSION_GENERATOR_URLhttp://localhost:8080URL of the session token generator service used to create authenticated Cobalt sessions.
SESSION_TOKEN_REFRESH_MIN15How often (in minutes) Cobalt session tokens are refreshed. Minimum effective value is 1.
To add redundancy, list multiple Cobalt instances:
COBALT_APIS=https://co.eepy.today,https://cobalt.your-domain.com
If one instance is unavailable, Yoink automatically tries the next.

AI / Transcription

Required only if you want to enable the transcription feature, which uses OpenAI’s Whisper large model.
VariableDefaultDescription
OPENAI_API_KEY(none)OpenAI API key. Enables the transcription endpoint, which calls the Whisper large model for audio-to-text. Leave blank to disable transcription.

Proxy

Configure a rotating proxy pool for outbound download requests. Yoink constructs proxy URLs in the format http://<PROXY_USER_PREFIX><N>:<PROXY_PASSWORD>@<PROXY_HOST>:<PROXY_PORT> where N is a number from 1 to PROXY_COUNT.
VariableDefaultDescription
PROXY_HOST(none)Hostname or IP address of the proxy server.
PROXY_PORT80Port of the proxy server.
PROXY_USER_PREFIX(none)Username prefix for proxy authentication. The proxy index number is appended to this prefix.
PROXY_PASSWORD(none)Password for proxy authentication.
PROXY_COUNT0Number of proxy slots in the rotation pool. Set to 0 to disable proxying entirely.
Proxy support is optional. If PROXY_HOST is not set or PROXY_COUNT is 0, all outbound requests use the default network interface.

Alerts

Discord webhook integration for server health alerts and error notifications.
VariableDefaultDescription
DISCORD_WEBHOOK_URL(none)Full Discord webhook URL. Setting this value enables Discord alert delivery. Leave blank to disable.
DISCORD_PING_USER_ID(none)Discord user ID to @mention in alert messages. Optional — alerts are sent without a ping if omitted.

Extractor

URL of the metadata extractor service used during the download pipeline.
VariableDefaultDescription
EXTRACTOR_URLhttp://localhost:3099Base URL of the extractor microservice. Yoink calls this service to resolve video metadata before dispatching download jobs.

Discord Bot

These variables are read by the yoink-bot binary (cmd/bot/main.go). The bot will exit at startup if any required variable is not set.
VariableRequiredDefaultDescription
DISCORD_TOKENYes(none)Discord bot token from the Discord Developer Portal.
DISCORD_APP_IDYes(none)Application (client) ID of your Discord application.
BOT_SECRETYes(none)Shared secret sent with every bot-to-server API request. Must match the BOT_SECRET value on the Yoink server.
YOINK_API_URLNohttp://localhost:3003Internal URL the bot uses to call the Yoink REST API.
YOINK_PUBLIC_URLNo(value of YOINK_API_URL)Public-facing URL embedded in bot response messages. Defaults to YOINK_API_URL if not set.

Compiled-In Constants

The following values are fixed at compile time in internal/config/config.go. They cannot be changed via environment variables; rebuild the binary to change them.

Queue and Job Limits

ConstantValueDescription
MaxQueueSize50Maximum number of jobs that can be queued across all job types at any one time.
MaxJobsPerClient3Maximum number of concurrent active jobs allowed per client IP address.
Per-type job concurrency limits (maximum simultaneous jobs of each type):
Job TypeMax Concurrent
playlist2
convert2
compress1
transcribe1
fetchUrl2

File and Storage Limits

ConstantValueDescription
DiskSpaceMinGB5 GBMinimum free disk space required before Yoink will accept new jobs.
FileSizeLimit8 GBMaximum size of any single output file.
FileRetention20 minutesHow long completed output files are kept on disk before automatic cleanup.
MaxPlaylistVideos1000Maximum number of videos in a single playlist download job.
MaxVideoDuration4 hoursMaximum duration of a single video that Yoink will download.

Timeout Values

ConstantValueDescription
HeartbeatTimeout30 secondsTime between required client heartbeats before a job is considered abandoned.
SessionIdleTimeout60 secondsTime a session may be idle before it is expired.
BotDownloadExpiry5 minutesHow long bot-triggered download results are held before expiry.
PlaylistDownloadExp12 hoursHow long playlist zip archives are retained after completion.
AsyncJobTimeout1 hourMaximum total wall-clock time allowed for any single async job.
ChunkTimeout30 minutesTimeout for a single chunk upload or download operation.

Rate Limiting

Yoink applies an in-memory sliding-window rate limiter to every incoming request, keyed by client IP. Rate limit headers (X-RateLimit-Limit, X-RateLimit-Remaining) are included in every response.
ConstantValueDescription
RateLimitWindow60 secondsDuration of the sliding rate-limit window.
RateLimitMax60 requestsMaximum number of requests allowed per IP within the window.
When the limit is exceeded the server returns HTTP 429 with a JSON body:
{
  "error": "Too many requests. Please slow down.",
  "resetIn": 42
}

Allowed Media Formats

These values are validated server-side against the AllowedFormats, AllowedModes, AllowedQualities, AllowedPresets, AllowedDenoise, and QualityHeight maps in config.go.

Video Containers

FormatMIME Type
mp4video/mp4
webmvideo/webm
mkvvideo/x-matroska
movvideo/quicktime

Audio Formats

FormatMIME Type
mp3audio/mpeg
m4aaudio/mp4
opusaudio/opus
wavaudio/wav
flacaudio/flac

Video Quality Targets

LabelTarget Height
2160p2160 px
1440p1440 px
1080p1080 px
720p720 px
480p480 px
360p360 px

Compression Options

ValueDescription
sizeTarget a specific output file size in megabytes.
qualityTarget a perceptual quality level rather than a file size.

Re-encode Modes

Controls when Yoink forces a full re-encode during download processing.
ValueDescription
autoRe-encode only when necessary (e.g., format conversion requires it).
alwaysAlways re-encode the output, regardless of the input format.
neverNever re-encode; copy streams as-is. May fail if the container is incompatible.

Crop Ratios

Supported aspect ratios for video cropping operations.
Value
16:9
9:16
1:1
4:3
4:5

Audio Bitrates

Allowed audio bitrate values (in kbps) for audio encoding and conversion.
Value
64
96
128
192
256
320

CORS Configuration

By default Yoink allows requests from all origins (with credentials disabled). To restrict origins, create a cors-origins.txt file in the same directory as the ./yoink binary, with one origin per line. Lines beginning with # are treated as comments.
cors-origins.txt
# Allow the production frontend
https://yoink.your-domain.com

# Allow a staging environment
https://staging.your-domain.com
When cors-origins.txt is present and non-empty, Yoink enables AllowCredentials: true and restricts AllowedOrigins to only the listed values.

Build docs developers (and LLMs) love