#!/usr/bin/env bash set -euo pipefail cd "$(dirname "$0")" if [ -f ".env" ]; then while IFS='=' read -r key value; do [[ -n "$key" && ! "$key" =~ ^[[:space:]]*# ]] && export "$key"="$value" done < <(grep -E '^[[:space:]]*[A-Za-z_][A-Za-z0-9_]*=[^[:space:]]*[[:space:]]*$' .env | sed 's/[[:space:]]*#.*$//' | tr -d '\r') fi python3 -m venv .venv || true source .venv/bin/activate python -m pip install --upgrade pip python -m pip install -U -r requirements.txt python -m pip install -U yt-dlp mkdir -p downloads exec python -m bot.app