Add MotherlessGrabber
[videosite.git] / videosite / Base.pm
index b31fcb6..f6108f6 100644 (file)
@@ -181,7 +181,11 @@ sub ua {
     my $self = shift;
     my $ua;
 
-    $ua = LWP::UserAgent->new('agent' => 'Mozilla/5.0', 'cookie_jar' => HTTP::Cookies->new);
+    $ua = LWP::UserAgent->new(
+            'agent' => 'Mozilla/5.0',
+            'cookie_jar' => HTTP::Cookies->new,
+            'timeout' => 15,
+            );
 
     # Remove a currently defined HTTPS proxy. See below for a longer explanation.
     delete($ENV{'HTTPS_PROXY'});
@@ -217,9 +221,17 @@ sub ua {
         }
     }
 
+    $self->{_CACHED_UA} = $ua;
+
     return $ua;
 }
 
+sub _cached_ua {
+    my $self = shift;
+
+    return $self->{_CACHED_UA};
+}
+
 sub simple_get {
     my $self = shift;
     my $url = shift;