yt-dlf/start.sh
Claude Fable 5 a3eb962b90 Transcribe videos without subtitles via faster-whisper fallback
When yt-dlp yields no subtitle files, the server now runs
scripts/transcribe.py (faster-whisper, large-v3-turbo, CUDA with CPU
fallback) on the downloaded media and feeds the resulting VTT through
the existing Markdown conversion.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1w53ybPWArpZpcei9JPYX
2026-08-29 22:20:55 +02:00

52 lines
2.5 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)
#
# USERS_FILE Path to the user database file. (default: users.txt next to start.sh)
# Manage users with: python3 scripts/add_user.py <username> <password>
#
# ADS_DIR Directory containing ads-left.html and ads-right.html.
# (default: same directory as start.sh)
#
# WHISPER_PYTHON Python interpreter with faster-whisper installed, used to
# transcribe media that has no subtitles. (default: python3)
# WHISPER_MODEL faster-whisper model name. (default: large-v3-turbo)
# WHISPER_DEVICE Force "cuda" or "cpu". (default: try cuda, fall back to cpu)
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"
# export USERS_FILE="$(dirname "$0")/users.txt"
# export ADS_DIR="$(dirname "$0")"
exec node build/index.js