Re: [SLUG] youtube download script

From: draeath (draeath@gmail.com)
Date: Wed Apr 01 2009 - 15:30:00 EST


Nice!

I bow before your Bash-Fu!

On Wed, 1 Apr 2009 2:53 pm, Eben King wrote:
> Woohoo! Got Youtube to work!
>
> <start>
> #! /bin/sh
>
> url="$1"
>
> finalurl="$(wget -q -O - "$url" | grep fullscreenUrl | cut -f 2 -d "'"
> | cut -f 2- -d '?' | tr '&' '\n' | grep -e ^video_id= -e ^t= | tr '\n'
> '&' | sed 's@^\(.*\)&$@http://youtube.com/get_video.php?\1@')"
>
> if [ z"$finalurl" = z ] ; then
> echo No movie here.
> else
> filename="${0##*/}-${url##*=}.flv"
> wget -O "$filename" "$finalurl" && exit
> fi
>
> echo "Sorry, don't know how to get this."
> <end>
>
> Note that "finalurl=" is all one line.
>
> --
> -eben QebWenE01R@vTerYizUonI.nOetP http://royalty.mine.nu:81
>
> "You're one of those condescending Unix computer users!"
> "Here's a nickel, kid. Get yourself a better computer" - Dilbert
> -----------------------------------------------------------------------
> This list is provided as an unmoderated internet service by Networked
> Knowledge Systems (NKS). Views and opinions expressed in messages
> posted are those of the author and do not necessarily reflect the
> official policy or position of NKS or any of its employees.
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:28:15 EDT