Last active
December 27, 2015 08:59
-
-
Save geekdadley/7300818 to your computer and use it in GitHub Desktop.
Use flvcd to automatically download youku page in a batch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| # download flv pieces and put them at current dir with name as 01,02,03,etc. | |
| # So less than 100 pieces are expected | |
| use strict; | |
| if(@ARGV != 1) | |
| { | |
| print "download_youku <URL>\n"; | |
| exit 1; | |
| } | |
| my ($original_youku) = @ARGV; | |
| my $flvcdpage = `curl "http://www.flvcd.com/parse.php?kw=$original_youku&flag=one&format=super 1 >>/dev/null 2>>/dev/null"`; | |
| chomp($flvcdpage); | |
| my @urls = ($flvcdpage =~ m/<BR><a href=\"(.*?)\" target=\"_blank\" onclick=\"_alert/g); | |
| my $name=1; | |
| foreach(@urls) | |
| { | |
| system(sprintf("wget --user-agent='chrome' $_ -O %02d.flv",$name)); | |
| #(printf("wget --user-agent='chrome' $_ -O %02d.flv\n",$name)); | |
| $name++; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment