35 lines
849 B
Bash
35 lines
849 B
Bash
#!/bin/bash/
|
|
finalDest=/path/of/sovigall/videos/
|
|
tempDest=/path/of/sovigall/tmp/
|
|
threads=3 # nb cpu core - 1
|
|
cd $tempDest
|
|
|
|
nbProcessLauch=$(ps -ef | grep -v grep | grep youtube-dl | wc -l)
|
|
|
|
if [ $nbProcessLauch != 0 ]
|
|
then
|
|
echo 'bye'
|
|
exit
|
|
fi
|
|
|
|
for file in $tempDest*.hash
|
|
do
|
|
if [ -f $file ];
|
|
then
|
|
while read urlHash url destination
|
|
do
|
|
youtube-dl -R 0 -c --write-thumbnail --write-info-json --recode-video webm --no-check-certificate -f 45/46/37/45/22/44/35/34/5 -o "$urlHash.%(ext)s" "$url"
|
|
convert "$urlHash.jpg" -resize 260 "$urlHash.thumb.jpg"
|
|
sleep 10
|
|
if [ ! -f $urlHash.*.part ]
|
|
then
|
|
rm $file
|
|
sleep 1
|
|
mv $urlHash* $finalDest$destination
|
|
fi
|
|
done < $file
|
|
fi
|
|
done
|
|
|
|
# -rc_lookahead 16 -g 360 -threads 3
|