in reply to Trying to download video from URL links
use LWP::Simple; $url = get("https://class.coursera.org/automata-002/lecture/index"); $link = ''; foreach (split /\n/, $url){ if(/download\.mp4/){ $_ =~m/href="(.+)"/; $link = $1; } if(/(Video \(MP4\) for )(.+)<\/div>/){ print "downloading $2\n" if $1; $file = get($link); open FILE,'>'.$2.'.mp4' or die $!; print FILE $file; close FILE; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Trying to download video from URL links
by soonix (Chancellor) on Dec 22, 2013 at 12:04 UTC | |
|
Re^2: Trying to download video from URL links
by soulrain (Initiate) on Dec 22, 2013 at 05:17 UTC |