X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite%2FBase.pm;h=f6108f636b56fc0bc2fb7b3ff1ad93aab25da65b;hb=1cfec45c0c1cac8fdebca4313c3bcfb3a9f1ab07;hp=b31fcb6d8adbe428482683e73bd8a8f91e345b9c;hpb=bde8149e4eac9d8c194adf1daa99ca8ccddb6d82;p=videosite.git diff --git a/videosite/Base.pm b/videosite/Base.pm index b31fcb6..f6108f6 100644 --- a/videosite/Base.pm +++ b/videosite/Base.pm @@ -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;