I have updated my youtube script, because it sometimes keeps downloading movies that I had already seen.
pts/4 jan ~/youtube_script$ cat youtube
#!/bin/sh
LOG=/home/jan/youtube_script/youtube.log/
LIST=/home/jan/youtube_script/youtube.list
DOWNLOADDIR=/home/jan/youtube_downloads/
for URL in `cat $LIST`
do
echo ----[start]
echo $URL
# change DIR to DOWNLOADDIR
cd $DOWNLOADDIR
# check URL
for VIDEO in `lynx -dump "$URL" | grep watch?v | sed 's# ##g' | cut -d"." -f2-`
do
echo $VIDEO
X=`echo $VIDEO | cut -d "=" -f2- | cut -d "&" -f1 `
X=$LOG$X
echo $X
# Only download video when it was not downloaded before
if [ -e $X ]
then
touch $X
echo Already downloaded --skip
else
touch $X
echo Downloading $X
timelimit -t 7200 -T 360 clive $VIDEO --format=best
fi
done
echo ----[end]
done
# CLEAN $LOG
find $LOG -mtime +30 -delete
pts/4 jan ~/youtube_script$