-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
50 lines (39 loc) · 935 Bytes
/
install.sh
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
DOWNLOAD_URL="https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z"
FILE_NAME="ffmpeg.gz"
FOLDER_NAME="ffmpeg/bin"
extract_ffmpeg () {
echo "Attempting to extract ffmpeg"
dir_name="$(pwd)/$FOLDER_NAME"
if [ -d $FOLDER_NAME ]
then
rm -rf $FOLDER_NAME
fi
mkdir -p $FOLDER_NAME
res=$(7z e $FILE_NAME -o"$dir_name" *.exe -r)
if [ $? -eq 0 ]
then
echo "Successfully extracted ffmpeg"
rm $FILE_NAME
else
echo "Error while extracting ffmpeg"
rm $FILE_NAME
exit 1
fi
}
download_ffmpeg() {
echo "Attempting to download ffmpeg"
res=$(curl -s -w "%{response_code}" $DOWNLOAD_URL -o $FILE_NAME -L)
if [ $res -eq 200 ]
then
echo "Successfully downloaded ffmpeg"
else
echo "Error: couldn't download ffmpeg"
exit 1
fi
}
install_and_run() {
var=$(pip install -r video_compressor/requirements.txt -q)
}
download_ffmpeg
extract_ffmpeg
exit 0