Commit 83e2d31a authored by citronalco's avatar citronalco
Browse files

try to avoid broken downloads

parent eec56d2f
......@@ -86,7 +86,16 @@ foreach (@{$decodedProgramJSON->{'channelBroadcasts'}}) {
}
print "Downloading ".$filename."... ";
$mech->get($longestAudio{'downloadUrl'});
my $try=5;
do {
$mech->get($longestAudio{'downloadUrl'});
} while (--$try>0 and !$mech->success());
if ($try==0) {
print "failed.\n";
next;
}
$mech->save_content($DESTDIR."/".$filename);
my $mp3file=MP3::Tag->new($DESTDIR."/".$filename);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment