#!/bin/bash # Joe Gillotti - 3/26/2012 # Save *all* videos from red tube # Our user agent, so it doesn't look like we're curl agent="Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2" # The first page to start at page="http://www.redtube.com/" # Go forever.. while :; do # Get all video id links on this page nums=`curl -s --user-agent "$agent" "$page" | egrep 'href="\/[0-9]+"' | grep -v class | sed 's/^[\t]*|//g' | cut -d\" -f2 | sed 's/\///'` # Go through all of them for i in $nums; do # URL to .mp4 file with the special session key at the end vid=`curl -s --user-agent "$agent" http://www.redtube.com/$i | grep videos.mp4.redtubefiles.com | grep -v param | cut -d\' -f2 | grep -v src` # Name of video name=`curl -s --user-agent "$agent" http://www.redtube.com/$i | grep '