98 lines
2.6 KiB
Bash
Executable File
98 lines
2.6 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Script de configuración rápida para TubeScript-API
|
|
echo "🚀 Configuración Rápida de TubeScript-API"
|
|
echo "=========================================="
|
|
echo ""
|
|
|
|
# Verificar Python
|
|
echo "1. Verificando Python..."
|
|
if command -v python3 &> /dev/null; then
|
|
PYTHON_VERSION=$(python3 --version)
|
|
echo "✅ $PYTHON_VERSION encontrado"
|
|
else
|
|
echo "❌ Python 3 no está instalado"
|
|
exit 1
|
|
fi
|
|
|
|
# Verificar FFmpeg
|
|
echo ""
|
|
echo "2. Verificando FFmpeg..."
|
|
if command -v ffmpeg &> /dev/null; then
|
|
echo "✅ FFmpeg encontrado"
|
|
ffmpeg -version | head -1
|
|
else
|
|
echo "❌ FFmpeg no está instalado"
|
|
echo ""
|
|
echo "Instala FFmpeg con:"
|
|
echo " macOS: brew install ffmpeg"
|
|
echo " Linux: sudo apt-get install ffmpeg"
|
|
exit 1
|
|
fi
|
|
|
|
# Verificar yt-dlp
|
|
echo ""
|
|
echo "3. Verificando yt-dlp..."
|
|
if command -v yt-dlp &> /dev/null; then
|
|
echo "✅ yt-dlp encontrado"
|
|
else
|
|
echo "⚠️ yt-dlp no encontrado, se instalará con pip"
|
|
fi
|
|
|
|
# Instalar dependencias
|
|
echo ""
|
|
echo "4. Instalando dependencias de Python..."
|
|
pip3 install -r requirements.txt
|
|
|
|
# Crear archivos de configuración si no existen
|
|
echo ""
|
|
echo "5. Verificando archivos de configuración..."
|
|
if [ ! -f "stream_config.json" ]; then
|
|
echo '{"platforms": {"YouTube": {"rtmp_url": "", "stream_key": "", "enabled": false}, "Facebook": {"rtmp_url": "", "stream_key": "", "enabled": false}, "Twitch": {"rtmp_url": "", "stream_key": "", "enabled": false}, "X (Twitter)": {"rtmp_url": "", "stream_key": "", "enabled": false}, "Instagram": {"rtmp_url": "", "stream_key": "", "enabled": false}, "TikTok": {"rtmp_url": "", "stream_key": "", "enabled": false}}}' > stream_config.json
|
|
echo "✅ Archivo stream_config.json creado"
|
|
else
|
|
echo "✅ stream_config.json ya existe"
|
|
fi
|
|
|
|
if [ ! -f "streams_state.json" ]; then
|
|
echo '{}' > streams_state.json
|
|
echo "✅ Archivo streams_state.json creado"
|
|
else
|
|
echo "✅ streams_state.json ya existe"
|
|
fi
|
|
|
|
# Verificar .gitignore
|
|
echo ""
|
|
echo "6. Verificando .gitignore..."
|
|
if [ -f ".gitignore" ]; then
|
|
echo "✅ .gitignore existe"
|
|
else
|
|
echo "⚠️ .gitignore no existe, creando..."
|
|
cat > .gitignore << EOF
|
|
# Configuraciones sensibles
|
|
stream_config.json
|
|
streams_state.json
|
|
cookies.txt
|
|
|
|
# Python
|
|
__pycache__/
|
|
*.py[cod]
|
|
.Python
|
|
venv/
|
|
EOF
|
|
echo "✅ .gitignore creado"
|
|
fi
|
|
|
|
echo ""
|
|
echo "=========================================="
|
|
echo "✅ Configuración completada!"
|
|
echo ""
|
|
echo "Para iniciar el panel web:"
|
|
echo " streamlit run streamlit_app.py"
|
|
echo ""
|
|
echo "Para iniciar la API (opcional):"
|
|
echo " python3 main.py"
|
|
echo ""
|
|
echo "📖 Lee QUICKSTART.md para más información"
|
|
echo "=========================================="
|