help help help in youtube

hi,
i',m the newbie in perl and i get the follow code.
it is the script for download youtube video .
i would like to know that"how to retrieve the %3a to : and %2f to / in
this script
and read this script more easy.
any one can help me, i want to get some from this regpex
"file name getyoutube.pl"
"/getyoutube.pl http://www.youtube.com/watch?v=kH8cS1AkqiI"
#!/usr/bin/perl -w
use LWP::Simple;LWP::Simple::get(shift) =~ /<title>YouTube -
(.*?)<\/title>.*player2.swf\?(video_id=([0-9a-z]+).+?)\"/is && exec
"wget -c -S -O $3.flv \"http://youtube.com/get_video.php?$2\" && ffmpeg
-i $3.flv -ab 56 -ar 22050 -b 500 -s 320x240
\"".( [at] ARGV?shift:"$1.mpg")."\" && echo && echo YouTube:$3 saved as
\\\"$1.mpg\\\""



in case, about the ffmpeg and wget, i understood what that doing,but
in perl(rexp) i can't understand.
may be the flow...i also no 100% understand,can expand ?

thank a lot.
Perlstudent [ Mo, 22 Januar 2007 13:48 ] [ ID #1604369 ]

Re: help help help in youtube

Perlstudent wrote:

> any one can help me, i want to get some from this regpex

Next time, put the subject of you posting in the Subject: of your posting.

> /<title>YouTube -(.*?)<\/title>.*player2.swf\?(video_id=([0-9a-z]+).+?)\"/is

The first part is obvious:
<title>YouTube - WorldMap Live Storm-Worm</title>

The second set of parentheses looks at
var fo = new SWFObject("/player2.swf?video_id=kH8cS1AkqiI&l=40&t=OEgsToPD skIj7q6NT71MnrRBo7WFZDnv",
and sets $2 to
video_id=kH8cS1AkqiI&l=40&t=OEgsToPDskIj7q6NT71MnrRBo7WFZDnv
and $3 to
kH8cS1AkqiI

So what part do you have trouble understanding?
() They set $1, $2, $3 on successful match.
.*? This requests the minimal match that lets the rest match.
[0-9a-z]+ Alphabetic and numeric characters only, at least one of them.
//is Treat uppercase and lowercase the same, allow /./ to match "\n".

-Joe

P.S. When posting to english newsgroups, it is better to use Character-Encoding: ISO-8859-1
instead of Character-Encoding: big5.
Joe Smith [ Mo, 22 Januar 2007 20:22 ] [ ID #1604370 ]

Re: help help help in youtube

thank a lot.
Joe Smith =BCg=B9D=A1G

> Perlstudent wrote:
>
> > any one can help me, i want to get some from this regpex
>
> Next time, put the subject of you posting in the Subject: of your posting.
>
> > /<title>YouTube -(.*?)<\/title>.*player2.swf\?(video_id=3D([0-9a-z]+).+=
?)\"/is
>
> The first part is obvious:
> <title>YouTube - WorldMap Live Storm-Worm</title>
>
> The second set of parentheses looks at
> var fo =3D new SWFObject("/player2.swf?video_id=3DkH8cS1AkqiI&l=3D40&t=
=3DOEgsToPDskIj7q6NT71MnrRBo7WFZDnv",
> and sets $2 to
> video_id=3DkH8cS1AkqiI&l=3D40&t=3DOEgsToPDskIj7q6NT71MnrRBo7 WFZDnv
> and $3 to
> kH8cS1AkqiI
>
> So what part do you have trouble understanding?
> () They set $1, $2, $3 on successful match.
> .*? This requests the minimal match that lets the rest match.
> [0-9a-z]+ Alphabetic and numeric characters only, at least one of th=
em.
> //is Treat uppercase and lowercase the same, allow /./ to match=
"\n".
>
> -Joe
>
> P.S. When posting to english newsgroups, it is better to use Character-En=
coding: ISO-8859-1
> instead of Character-Encoding: big5.
Perlstudent [ Di, 23 Januar 2007 06:40 ] [ ID #1605536 ]
Perl » alt.perl » help help help in youtube

Vorheriges Thema: Sending attachments using server side mail gateway?
Nächstes Thema: newbie struggling to protect ebook using PERL