diff --git a/.gitignore b/.gitignore index 1624d7b..259c1c4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ data tmp videos -.project \ No newline at end of file +.projectbin/cronTask.sh diff --git a/.project b/.project new file mode 100644 index 0000000..2449bfd --- /dev/null +++ b/.project @@ -0,0 +1,13 @@ + + + mytube.local + + + + + + + com.aptana.projects.webnature + com.aptana.editor.php.phpNature + + diff --git a/bin/cronTask.sh b/bin/cronTask.sh index 0ffc103..689b593 100644 --- a/bin/cronTask.sh +++ b/bin/cronTask.sh @@ -1,6 +1,6 @@ #!/bin/bash/ -finalDest=/srv/http/mytube.local/videos/ -tempDest=/srv/http/mytube.local/tmp/ +finalDest=/srv/http/sovigall.local/videos/ +tempDest=/srv/http/sovigall.local/tmp/ threads=3 # nb cpu core - 1 cd $tempDest diff --git a/bin/cronTask.sh.sample b/bin/cronTask.sh.sample new file mode 100644 index 0000000..1a69619 --- /dev/null +++ b/bin/cronTask.sh.sample @@ -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