Re: [dwm] last.fm + youtube downloader scripts

From: Ian Daniher <it.daniher_AT_gmail.com>
Date: Tue, 6 Jan 2009 01:45:22 -0500

Hi All,
Perhaps my first 'release' was premature. In testing I found
a rather atrocious bug which rendered my script useless with some
youtube videos.
I just completed a partial rewrite and have tested it with great success.

##<CODE>##
UGETURL=$(curl -s $1 |grep fullscreenUrl)
URLPARAMS="${UGETURL#*/watch_fullscreen}"
SPLIT=`echo "$URLPARAMS" | sed -e 's/&/\n/g'`
video_id=`echo "$SPLIT" | grep video_id=`
t=`echo "$SPLIT" | grep t=`
URL="http://www.youtube.com/get_video?&$video_id&$t"
echo $URL
##</CODE>##

The bug came from having the positions or "t" and "video_id" hardcoded via awk.
By splitting "URLPARAMS" and grepping for "t" and "video_id", the script can
extract the information necessary no matter where it is located.

As for setting up a hotkey in w3m, I got distracted from
the manpage by my bugfix but I'll post to the mailing
list as soon as I have it figured out.

Best,

--
Ian Daniher
On 1/6/09, bill lam <cbill.lam_AT_gmail.com> wrote:
> How to configure w3m to use this youtube-dl ? That is not mentioned in
> README.
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> 唐詩253 崔顥  長干行二首之一
>     君家何處住  妾住在橫塘  停船暫借問  或恐是同鄉
>
>
Received on Tue Jan 06 2009 - 06:45:22 UTC

This archive was generated by hypermail 2.2.0 : Tue Jan 06 2009 - 06:48:04 UTC