Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

One-liner Youtube Downloader

by Onur (Beadle)
on Dec 24, 2007 at 00:54 UTC ( #658820=snippet: print w/replies, xml ) Need Help??
Description: 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: snippet [id://658820]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2021-12-05 16:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (31 votes). Check out past polls.

    Notices?