-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathreclip.sh
More file actions
executable file
·56 lines (47 loc) · 1.31 KB
/
Copy pathreclip.sh
File metadata and controls
executable file
·56 lines (47 loc) · 1.31 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
#!/bin/bash
set -e
cd "$(dirname "$0")"
# Check prerequisites
missing=""
if ! command -v python3 &> /dev/null; then
missing="$missing python3"
fi
if ! command -v yt-dlp &> /dev/null; then
missing="$missing yt-dlp"
fi
if ! command -v ffmpeg &> /dev/null; then
missing="$missing ffmpeg"
fi
if [ -n "$missing" ]; then
echo "Missing required tools:$missing"
echo ""
if command -v brew &> /dev/null; then
echo "Install with: brew install$missing"
elif command -v apt &> /dev/null; then
echo "Install with: sudo apt install$missing"
else
echo "Please install:$missing"
fi
exit 1
fi
# Set up venv and install Python deps
if [ ! -d "venv" ]; then
echo "Setting up virtual environment..."
python3 -m venv venv
source venv/bin/activate
pip install -q flask yt-dlp
else
source venv/bin/activate
fi
# Keep yt-dlp fresh — sites (Instagram, Facebook, etc.) break its extractors
# frequently, and the usual fix is simply updating yt-dlp. Skip with RECLIP_NO_UPDATE=1.
if [ -z "$RECLIP_NO_UPDATE" ]; then
echo "Updating yt-dlp..."
pip install -q -U yt-dlp || echo " (couldn't update yt-dlp — continuing with the installed version)"
fi
PORT="${PORT:-8899}"
export PORT
echo ""
echo " ReClip is running at http://localhost:$PORT"
echo ""
python3 app.py