[add] change cron script file for exemple
This commit is contained in:
parent
277ca16643
commit
1456ee20a8
|
@ -1,4 +1,4 @@
|
||||||
data
|
data
|
||||||
tmp
|
tmp
|
||||||
videos
|
videos
|
||||||
.project
|
.projectbin/cronTask.sh
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>mytube.local</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>com.aptana.projects.webnature</nature>
|
||||||
|
<nature>com.aptana.editor.php.phpNature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash/
|
#!/bin/bash/
|
||||||
finalDest=/srv/http/mytube.local/videos/
|
finalDest=/srv/http/sovigall.local/videos/
|
||||||
tempDest=/srv/http/mytube.local/tmp/
|
tempDest=/srv/http/sovigall.local/tmp/
|
||||||
threads=3 # nb cpu core - 1
|
threads=3 # nb cpu core - 1
|
||||||
cd $tempDest
|
cd $tempDest
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/bash/
|
||||||
|
finalDest=/path/of/sovigall/videos/
|
||||||
|
tempDest=/path/of/sovigall/tmp/
|
||||||
|
threads=3 # nb cpu core - 1
|
||||||
|
cd $tempDest
|
||||||
|
|
||||||
|
nbProcessLauch=$(ps -e | 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"
|
||||||
|
sleep 5
|
||||||
|
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
|
Loading…
Reference in New Issue