Set timeout for URL shortener to 5 seconds
authorRalf Ertzinger <ralf@skytale.net>
Fri, 21 Dec 2012 14:02:01 +0000 (15:02 +0100)
committerRalf Ertzinger <ralf@skytale.net>
Fri, 21 Dec 2012 14:02:01 +0000 (15:02 +0100)
videosite.pl

index d7a549f..6ea4892 100644 (file)
@@ -176,7 +176,7 @@ sub expand_url_shortener {
         'shar\.es/[[:alnum:]]+',
         'goo\.gl/[[:alnum:]]+',
         );
-    my $ua = LWP::UserAgent->new(agent => 'Mozilla', max_redirect => 0);
+    my $ua = LWP::UserAgent->new(agent => 'Mozilla', max_redirect => 0, timeout => 5);
     my $i = 10;
 
     OUTER: while (($os ne $s) and ($i > 0)) {