Skip to content

Instantly share code, notes, and snippets.

@bartman
Created May 5, 2010 15:52
Show Gist options
  • Save bartman/390985 to your computer and use it in GitHub Desktop.
Save bartman/390985 to your computer and use it in GitHub Desktop.
#!/bin/bash
URLS=$@
related_urls() {
w3m -dump_source 'http://www.youtube.com/watch?v=NS2xpf5O8nQ' 2>|/dev/null | sed -n -e 's,.*href="\(/watch.v=[^"]*\)&feature=related".*,http://www.youtube.com\1,p'
}
if [ "$1" = "--related" ] ; then
URLS=$(related_urls "$2")
fi
for n in $URLS ; do
clive --cclass='[A-Za-z0-9. -]' --filename-format='%t.%s' --format=best -c "$n"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment