Skip to content

Instantly share code, notes, and snippets.

@wridgers
Created April 26, 2012 20:41
Show Gist options
  • Save wridgers/2502982 to your computer and use it in GitHub Desktop.
Save wridgers/2502982 to your computer and use it in GitHub Desktop.
Leach lots of GQ videos, in HD.
#!/bin/sh
for i in `seq 1 10`;
do
wget -q "http://www.youtube.com/user/goingquantum/videos?page=$i" -O page.$i.txt
done
cat page.*.txt > total.txt
grep -o "/watch?v=\([^\"\&]*\)" total.txt | sed 's/\/watch?v=//g' | uniq > ids.txt
videos="1"
while read line; do
if [ -n "$line" ]; then
already_exists=false
for j in *;
do
if [[ "$j" =~ "${line}" ]]; then
already_exists=true
fi
done
if $already_exists; then
echo "[$videos] Skipping: $line"
else
echo "[$videos] Downloading: $line"
youtube-dl -t -r 500k -c -w $line
fi
videos=$[$videos+1]
fi
done < "ids.txt"
rm ids.txt page.*.txt total.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment