-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.sh
executable file
·48 lines (41 loc) · 1.02 KB
/
upload.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
#!/bin/bash
echo "GET USER VARIABLES"
read -p "Title: " TITLE
read -p "Description: " DESC
read -p "Link: " LURL
read -p "Link Desc: " LDESC
read -p "Tag 1: " TAG1
read -p "Publish Day: " PUB
echo "SET GLOBAL VARIABLES"
YEAR="$(date "+%Y")"
MONTH="$(date "+%m")"
DAY="$(date "+%d")"
TNAME="CahlenLee_""$YEAR""$MONTH""$DAY""_""$TITLE"
FNAME=$(echo "$TNAME" | sed 's/ //g')
PROC=0
echo "PROCESS MP4"
for file in *.mp4
do
ffmpeg -i "$file" -c:v libx264 -r 24 -vf scale=854:480 -b:v 999k -c:a aac -ac 1 -b:a 128k -movflags faststart -af "dynaudnorm=f=33:g=65:p=0.66:m=33.3" -n "${FNAME}.mp4"
rm "$file"
done
echo "PROCESS JPG"
for file in *.jpg
do
jpegoptim -S 96 "$file"
mv "$file" "${FNAME}.jpg"
done
echo "CREATE DATA FILE"
/bin/cat <<EOM >data.txt
$TITLE
$DESC
$LURL
$LDESC
$TAG1
$PROC
EOM
echo "UPLOAD FILES"
scp -r "${FNAME}.mp4" "[email protected]:~/IPFS-Website/uploads/$PUB/"
scp -r "${FNAME}.jpg" "[email protected].:~/IPFS-Website/uploads/$PUB/"
scp -r "data.txt" "[email protected]:~/IPFS-Website/uploads/$PUB/"/"
echo "DONE"