Commit 9c6da098 authored by Bernhard Geier's avatar Bernhard Geier

try to avoid broken downloads

parent 0db33745
......@@ -56,7 +56,15 @@ foreach (@{$result->{'hits'}}) {
}
print $filename." downloading... ";
$browser->get($shoutcastBaseUrl.$parts[$i]->{'loopStreamId'});
my $try=5;
do {
$browser->get($shoutcastBaseUrl.$parts[$i]->{'loopStreamId'});
} while (--$try>0 and !$browser->success());
if ($try==0) {
print "failed.\n";
next;
}
$browser->save_content($DESTDIR."/".$filename);
my $tag=MP3::Tag->new($DESTDIR."/".$filename);
......
Markdown is supported
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