- Flask-based web interface on port 8080 - Dashboard with channel statistics and sync status - Channel management (add/remove channels via UI) - Settings page for all configuration options - Cookie file upload interface - Real-time log viewer - Manual sync trigger from web UI - Updated Dockerfile to include Flask and web assets - Updated Unraid template with WebUI port - Updated README with web UI documentation
57 lines
1.6 KiB
Bash
57 lines
1.6 KiB
Bash
#!/bin/bash
|
|
# Entrypoint script for YouTube Sync Docker container
|
|
|
|
set -e
|
|
|
|
echo "=========================================="
|
|
echo "YouTube Channel Sync Docker"
|
|
echo "=========================================="
|
|
echo "Download Directory: $DOWNLOAD_DIR"
|
|
echo "Config Directory: $CONFIG_DIR"
|
|
echo "Sync Schedule: $SYNC_SCHEDULE"
|
|
echo "Max Quality: ${MAX_QUALITY}p"
|
|
echo "Sleep Interval: ${SLEEP_INTERVAL}s"
|
|
echo "Timezone: $TZ"
|
|
echo "Web UI: http://localhost:8080"
|
|
echo "=========================================="
|
|
|
|
# Create example channels file if it doesn't exist
|
|
if [ ! -f "$CONFIG_DIR/channels.txt" ]; then
|
|
echo "[INFO] Creating example channels.txt..."
|
|
cat > "$CONFIG_DIR/channels.txt" << 'EOF'
|
|
# YouTube Channel Configuration
|
|
# Format: CHANNEL_ID|Channel Name
|
|
# One channel per line. Lines starting with # are ignored.
|
|
#
|
|
# Examples:
|
|
# UCfDNi1aEljAQ17mUrfUjkvg|Alton Brown
|
|
# UCoq2qlWgvvKJzW_hBkLIE8w|Flavour Trip
|
|
#
|
|
# To find a channel ID:
|
|
# 1. Go to the channel's main page
|
|
# 2. View page source (Ctrl+U or Cmd+U)
|
|
# 3. Search for "channelId" or look in the URL
|
|
EOF
|
|
fi
|
|
|
|
# Create log file
|
|
touch /var/log/youtube-sync.log
|
|
|
|
# Set up cron job if SYNC_SCHEDULE is provided
|
|
if [ "$SYNC_SCHEDULE" != "manual" ]; then
|
|
echo "[INFO] Setting up cron schedule: $SYNC_SCHEDULE"
|
|
echo "$SYNC_SCHEDULE /app/sync.sh >> /var/log/youtube-sync.log 2>&1" > /etc/crontabs/root
|
|
|
|
# Start crond in the background
|
|
crond -f -l 2 &
|
|
CRON_PID=$!
|
|
echo "[INFO] Cron daemon started (PID: $CRON_PID)"
|
|
else
|
|
echo "[INFO] Manual mode enabled. Use Web UI to trigger syncs."
|
|
fi
|
|
|
|
# Start Flask web UI
|
|
echo "[INFO] Starting web UI on port 8080..."
|
|
cd /app
|
|
exec python3 app.py
|