[MPlayer-users] Usnatch 1.38 released

Szabolcs Nagy nszabolcs at gmail.com
Thu Jun 19 16:10:39 CEST 2008


On 6/19/08, aw585 at lafn.org <aw585 at lafn.org> wrote:
> Minor changes to allow coping with nationalized YouTube URLs such as
> nl.youtube.com.... and uk.youtube.com....

to dl youtube links i use

#!/bin/sh
URL=`echo $1 |sed 's|/v/|/watch?v=|'`
FN=`echo $URL |sed 's|&.*||;s|-|_|g'|tail -c12`'.flv'
wget -O $FN `wget $URL -O - |grep -m 1 'var swfArgs'|sed
's|.*{"|youtube.com/get_video?|;s|": "*|=|g;s|"*, "|\&|g;s|"}.*||'`


(bit ugly, but it works for the /v/ type of embedded video urls as well)
and to play directly:

#!/bin/sh
URL=`echo $1 |sed 's|/v/|/watch?v=|'`
mplayer -demuxer 35 -prefer-ipv4 -cache 4096 "http://"`wget $URL -O -
|grep -m 1 'var swfArgs'|sed 's|.*{"|youtube.com/get_video?|;s|":
"*|=|g;s|"*, "|\&|g;s|"}.*||'`


(demuxer 35 and cache 4096 might be overkill)



More information about the MPlayer-users mailing list