SvelteKit web frontend for yt-dlp and ffmpeg. Paste a YouTube URL to download best-quality video, subtitles (original + EN + DE), and thumbnail. Subtitles are converted to clean Markdown. Optional audio extraction to MP3. Supports ZIP & Send mode: downloaded files are packed into a ZIP and delivered to the browser, with optional server-side cleanup after delivery. An extra directory (ZIP_EXTRA_DIR) can be bundled into every ZIP. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
39 lines
1.7 KiB
Bash
Executable File
39 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# yt-dlf startup script
|
|
#
|
|
# Environment variables:
|
|
# PORT Port to listen on (default: 3000)
|
|
# ORIGIN Public URL of this server, e.g. http://myserver:3000 (required in production)
|
|
# YTDLP_PATH Path to yt-dlp binary (default: yt-dlp, must be on PATH)
|
|
# FFMPEG_PATH Path to ffmpeg binary (default: ffmpeg, must be on PATH)
|
|
#
|
|
# DOWNLOAD_DIR Directory where downloaded files are stored (default: ~/YouTube)
|
|
#
|
|
# ZIP_AND_SEND Set to "true" to ZIP the downloaded files and offer them as a
|
|
# browser download instead of (only) saving them on the server.
|
|
# A random prefix is added to the directory name to avoid collisions
|
|
# when multiple users download the same video simultaneously.
|
|
# (default: false)
|
|
#
|
|
# DELETE_AFTER_SEND When ZIP_AND_SEND=true: delete the files from the server after
|
|
# the ZIP has been sent to the browser. (default: false)
|
|
#
|
|
# DELETE_DELAY Seconds to wait before deleting files after the ZIP has been sent.
|
|
# Only relevant when DELETE_AFTER_SEND=true. (default: 0)
|
|
#
|
|
# ZIP_EXTRA_DIR Optional directory whose files are added to every ZIP alongside
|
|
# the downloaded files. Subdirectory structure within ZIP_EXTRA_DIR
|
|
# is preserved. Only used when ZIP_AND_SEND=true. (default: none)
|
|
|
|
export PORT="${PORT:-3000}"
|
|
export ORIGIN="${ORIGIN:-http://localhost:${PORT}}"
|
|
|
|
# Uncomment and adjust the lines below to configure:
|
|
# export DOWNLOAD_DIR="$HOME/YouTube"
|
|
# export ZIP_AND_SEND="false"
|
|
# export ZIP_EXTRA_DIR="/path/to/extra/files"
|
|
# export DELETE_AFTER_SEND="false"
|
|
# export DELETE_DELAY="0"
|
|
|
|
exec node build/index.js
|