youtube-automation/run_watcher.sh

42 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# YouTube Thumbnail Watcher Service Startup Script
set -e
echo "🎬 Starting YouTube Thumbnail Watcher Service"
echo "============================================="
# Check if .env file exists
if [ ! -f .env ]; then
echo "❌ Error: .env file not found!"
echo "💡 Copy .env.example to .env and configure your settings"
exit 1
fi
# Check if Python virtual environment exists
if [ ! -d venv ]; then
echo "📦 Creating Python virtual environment..."
python3 -m venv venv
fi
# Activate virtual environment
echo "🔧 Activating virtual environment..."
source venv/bin/activate
# Install dependencies
echo "📥 Installing dependencies..."
pip install -r requirements.txt
# Check configuration
echo "⚙️ Checking configuration..."
python3 -c "import config; print('Configuration loaded successfully')"
# Start the watcher service
echo "🚀 Starting watcher service..."
echo " - Press Ctrl+C to stop"
echo " - Logs are written to /tmp/youtube_watcher.log"
echo ""
cd src
python3 watcher_service.py