Make use of login redo.
This commit is contained in:
parent
9eeaac8cac
commit
50c548b577
1 changed files with 11 additions and 3 deletions
|
|
@ -121,11 +121,20 @@ do {
|
||||||
$count++;
|
$count++;
|
||||||
} while ($nextLink = $mech->find_link(class => 'next_page'));
|
} while ($nextLink = $mech->find_link(class => 'next_page'));
|
||||||
|
|
||||||
$count = 0;
|
$count = $startCount;
|
||||||
foreach my $videoURL (@allVideoLinks) {
|
foreach my $videoURL (@allVideoLinks) {
|
||||||
my $v = sprintf("%.4d", $count);
|
my $v = sprintf("%.4d", $count);
|
||||||
$mech->get($videoURL->url_abs());
|
|
||||||
print STDERR "Downloading $v: ", encode('UTF-8', $videoURL->text());
|
print STDERR "Downloading $v: ", encode('UTF-8', $videoURL->text());
|
||||||
|
if (defined $haveURL{$videoURL->url_abs()}) {
|
||||||
|
print STDERR ".... already have.\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if ( ($startCount % 50) == 0) {
|
||||||
|
print STDERR " ... redoing login ...";
|
||||||
|
&redo_login;
|
||||||
|
}
|
||||||
|
$mech->get($videoURL->url_abs());
|
||||||
|
|
||||||
my $videoResponse = $mech->follow_link(text_regex => qr/Download full/i);
|
my $videoResponse = $mech->follow_link(text_regex => qr/Download full/i);
|
||||||
my $filename = $videoResponse->filename();
|
my $filename = $videoResponse->filename();
|
||||||
$filename =~ s/-/_/g;
|
$filename =~ s/-/_/g;
|
||||||
|
|
@ -138,7 +147,6 @@ foreach my $videoURL (@allVideoLinks) {
|
||||||
print STDERR " .... done.\n";
|
print STDERR " .... done.\n";
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Local variables:
|
# Local variables:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue