X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite%2FGrabberBase.pm;h=576d7e487e4c44671c919bd03706a2d2396f6150;hb=HEAD;hp=e354bc9a1f40d64b3e790a9b6b917837a9494b76;hpb=a33c3a8a1fc98179619e13fd64bc5d2f3c2ddc4d;p=videosite.git diff --git a/videosite/GrabberBase.pm b/videosite/GrabberBase.pm index e354bc9..576d7e4 100644 --- a/videosite/GrabberBase.pm +++ b/videosite/GrabberBase.pm @@ -3,19 +3,20 @@ package videosite::GrabberBase; use videosite::Base; +use MIME::Base64; +use Data::Dumper; @ISA = qw(videosite::Base); use strict; sub new { my $class = shift; - my $self = $class->SUPER::new(); - - $self = {%{$self}, + my $self = $class->SUPER::new( NAME => 'FlashGrab', TYPE => 'grabber', PATTERNS => [], - }; + @_, + ); return bless($self, $class); } @@ -40,6 +41,12 @@ sub get($$) { last; } } + if (defined($res)) { + if (defined($self->_cached_ua())) { + $res->{COOKIES} = encode_base64("#LWP-Cookies-1.0\n" . $self->_cached_ua()->cookie_jar->as_string(), ""); + } + } + return wantarray?($res, $pattern):$res; } }