Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

One-liner Youtube Downloader

by Onur (Beadle)
on Dec 24, 2007 at 00:54 UTC ( [id://658820]=CUFP: print w/replies, xml ) Need Help??

This program downloading youtube videos with using wget. Videos are directly downloading. If you want to convert downloaded videos to mpeg from flv, you must have ffmpeg and add this code to end of the program:
`ffmpeg -i $_[1] -ab 128 -ar 44100 -b 500 -s 320x240 $_[1].mpg`;
Using:
perl youtube-downloader http://www.youtube.com/watch?v=dXmKDkAAamc
use strict;use LWP::Simple;@_ = get ($ARGV[0]) =~ /var swfArgs = {hl:' +en',(video_id):'([\w_-]{11,11})',(l):'([\d]+)',(t):'([\w_-]+)',(sk):' +([\w_-]+)'};/;my $url = "http://www.youtube.com/get_video.php?";for ( +my $i = 0; $i < @_; $i = $i + 2){$url .= "&" . $_[$i] . "=" . $_[$i+1 +];}`wget -O $_[1].flv "$url"`;

Replies are listed 'Best First'.
Re: One-liner Youtube Downloader
by tomfahle (Priest) on Dec 24, 2007 at 07:00 UTC

      Yeah, that's a better solution, by the looks of it. What I find almost comical is how much more trouble he had to go to to achieve similar results in gawk and vbscript.

        Methinks he is economical with the truth.

        Also misinformed if he thinks a BSc in Computer Science couldn't give him an insight into Machine Learning, AI, or Neural Networks.
        We all know the trouble that 2 degrees and lots of experience gets you!
      didn't work. I hate perl one liners because they're impossible to troubleshoot for me.
        Well this is the wrong forum to complain (you probably need to use the win32 version)
Re: One-liner Youtube Downloader
by Anonymous Monk on May 06, 2010 at 05:39 UTC
    Try this http://pastebin.com/tWSAz8sQ

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://658820]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-25 13:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found