Building on youtube.sh, this downloads an entire youtube channel. Usefull for marathon viewing sessions.

#!/bin/bash if [ "x$1" = "x" ] then echo channeldown "(username)" exit fi if [ ! "x$2" = "x" ] then MAX=$2 else MAX=100 fi USER=$1 i=1 while [ $i -lt "$MAX" ] do wget http://gdata.youtube.com/feeds/api/users/$USER/uploads\?start-index="$i"\&max-results=50 -O $USER.$i.raw let "i+=50" done #results=($(cat $USER*raw | sed 's/.*\(http:\/\/www.youtube.com\/watch?v=.\{11\}\).*/\1/g;/^http/!s/.*//g;/watch/!s/.*//g' | sort | uniq)) results=($(cat $USER*raw | sed 's/http/\nhttp/g' | grep 'api/videos' | sed 's/.*videos\///g;s/[<\/].*//g'|sort | uniq)) echo $results mkdir /downloads/watch/misc/$USER for X in ${results[@]} do X="http://youtube.com/watch?v=$X" echo $X >> $USER.log youtube-dl -o "/downloads/watch/misc/$USER/%(upload_date)s.%(stitle)s.%(ext)s" "$X" done rm $USER*raw