Monday, May 10, 2010

How to download ASL wt DVD script

#!/usr/bin/perl 

my $year = 2010;
my $x = 0;
for my $month ( 1 .. 12 ) {
   printf "downloading month %s", $month;
   for my $article ( 1 .. 6 ) {
       $file = sprintf "%s_%s_%04d%02d%02d_%02d.m4v", "w", "ASL", $year, $month, 15, $article;
       next if -e $file and -s $file < 16;
       $url = sprintf "http://download.jw.org/files/media_magazines/%s\n", $file;
       print $url, "\n";
       system("curl -O $url");
       $error=$_;
       print "$error\n";
       system("rm $file") if $error =~ /No such/ or $error =~ /File not found/ or -s $file < 16;
    }
 } 

No comments:

Post a Comment