-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·207 lines (184 loc) · 6.63 KB
/
setup.sh
File metadata and controls
executable file
·207 lines (184 loc) · 6.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
#!/bin/bash
cat <<'EOF'
#========================================#
# #
# SCRIPTFLOW INSTALLER #
# #
# ScriptFlow Installation Script #
# #
#========================================#
EOF
#
# ScriptFlow Installation Script
#
echo "🎬 Setting up ScriptFlow..."
echo "✨ The most advanced FREE video transcriber with merge tools & quality options"
echo ""
# System check
echo "🔍 Checking system requirements..."
# Check Python
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 is required but not installed."
echo " 📥 Download from: https://python.org/downloads/"
echo " 📋 Make sure to check 'Add Python to PATH' during installation"
exit 1
fi
python_version=$(python3 --version 2>&1 | cut -d' ' -f2)
echo "✅ Python $python_version found"
# Check pip
if ! command -v pip3 &> /dev/null; then
echo "❌ pip3 is required but not installed."
echo " Run: python3 -m ensurepip --upgrade"
exit 1
fi
echo "✅ pip3 found"
# Virtual environment recommendation
echo ""
read -p "🤔 Create isolated virtual environment? (Recommended) [Y/n]: " create_venv
if [[ $create_venv =~ ^[Nn]$ ]]; then
echo "⚠️ Proceeding with global installation"
else
echo "📦 Creating virtual environment..."
python3 -m venv transcriber_env
# Activation instructions based on OS
if [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; then
echo "🪟 Windows detected"
echo " To activate: transcriber_env\\Scripts\\activate"
echo " To deactivate: deactivate"
else
source transcriber_env/bin/activate
echo "✅ Virtual environment activated"
echo " To activate later: source transcriber_env/bin/activate"
echo " To deactivate: deactivate"
fi
fi
# Install Python packages
echo ""
echo "📦 Installing Python packages..."
echo " • streamlit (beautiful web interface)"
echo " • faster-whisper (90% smaller than PyTorch!)"
echo " • yt-dlp (universal video downloader)"
echo " • reportlab (PDF generation)"
echo ""
pip3 install -r requirements.txt
if [ $? -eq 0 ]; then
echo "✅ Python packages installed successfully"
else
echo "❌ Failed to install Python packages"
echo " Try: pip3 install --upgrade pip"
echo " Then run this script again"
exit 1
fi
# FFmpeg installation
echo ""
echo "🎵 Installing FFmpeg (required for audio processing)..."
if command -v ffmpeg &> /dev/null; then
echo "✅ FFmpeg already installed"
else
echo "⚠️ FFmpeg not found. Installing..."
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "🐧 Linux detected"
if command -v apt &> /dev/null; then
echo " Using apt package manager..."
sudo apt update && sudo apt install -y ffmpeg
elif command -v yum &> /dev/null; then
echo " Using yum package manager..."
sudo yum install -y ffmpeg
elif command -v dnf &> /dev/null; then
echo " Using dnf package manager..."
sudo dnf install -y ffmpeg
elif command -v pacman &> /dev/null; then
echo " Using pacman package manager..."
sudo pacman -S ffmpeg
else
echo "❌ Please install ffmpeg manually for your Linux distribution"
echo " Ubuntu/Debian: sudo apt install ffmpeg"
echo " CentOS/RHEL: sudo dnf install ffmpeg"
echo " Arch: sudo pacman -S ffmpeg"
exit 1
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "🍎 macOS detected"
if command -v brew &> /dev/null; then
echo " Using Homebrew..."
brew install ffmpeg
else
echo "❌ Homebrew not found. Please install it first:"
echo " /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\""
echo " Then run: brew install ffmpeg"
exit 1
fi
elif [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; then
echo "🪟 Windows detected"
echo "❌ Please install FFmpeg manually on Windows:"
echo " 1. Download from: https://ffmpeg.org/download.html#build-windows"
echo " 2. Extract to C:\\ffmpeg"
echo " 3. Add C:\\ffmpeg\\bin to your system PATH"
echo " 4. Restart your terminal/command prompt"
echo " 5. Run this script again"
echo ""
echo "📺 Alternatively, use Windows Package Manager:"
echo " winget install ffmpeg"
exit 1
fi
fi
echo "✅ FFmpeg ready"
# Create default directories
echo ""
echo "📁 Setting up directories..."
mkdir -p ~/Transcriptions
mkdir -p ~/.scriptflow
echo "✅ Created ~/Transcriptions (default save location)"
echo "✅ Created ~/.scriptflow (for user preferences)"
# Test installation
echo ""
echo "🧪 Testing installation..."
python3 -c "
try:
from faster_whisper import WhisperModel
import streamlit as st
import yt_dlp
from reportlab.pdfgen import canvas
print('✅ All packages imported successfully!')
print('✅ Installation test passed!')
except ImportError as e:
print(f'❌ Import error: {e}')
exit(1)
"
if [ $? -eq 0 ]; then
echo ""
echo "🎉 Installation Complete! ScriptFlow is ready!"
echo ""
echo "📊 What's New in V2.0:"
echo " ✨ Transcript merge tool"
echo " 🎥 Video quality selection"
echo " 📄 PDF export support"
echo " 📦 Batch ZIP downloads"
echo " ✏️ In-browser transcript editing"
echo " 💾 User preferences saving"
echo ""
echo "🚀 Quick Start:"
echo " 1. Run: streamlit run main.py"
echo " 2. Open browser to displayed URL"
echo " 3. Start transcribing!"
echo ""
echo "📁 Default save location: ~/Transcriptions"
echo "💡 First run downloads AI model (~74MB for base model)"
echo ""
echo "🌟 Features:"
echo " • YouTube videos & playlists with quality selection"
echo " • Local files (drag & drop)"
echo " • +99languages supported"
echo " • Merge multiple transcripts"
echo " • Export as TXT, SRT, PDF, ZIP"
echo " • Completely FREE & works offline"
echo ""
echo "👨💻 Created by Youssef Mazini"
echo "🔗 GitHub: https://github.com/yomazini"
echo "💼 LinkedIn: https://www.linkedin.com/in/youssef-mazini/"
echo "🐦 Twitter: https://x.com/mazini_youssef"
else
echo "❌ Installation test failed"
echo "Please check the errors above and try again"
exit 1
fi