X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite%2FDailyMotionGrabber.pm;h=081b4b4034e748371f91917ffde49687400d0a2a;hb=ffc24eec49bbdb6117e3a67e6080c119fba6575d;hp=66fb8a0adde558d93511a28630ff25b1902c5e5f;hpb=3eca2f3ce7592dd3c723c65c0934c81a37881eed;p=videosite.git diff --git a/videosite/DailyMotionGrabber.pm b/videosite/DailyMotionGrabber.pm index 66fb8a0..081b4b4 100644 --- a/videosite/DailyMotionGrabber.pm +++ b/videosite/DailyMotionGrabber.pm @@ -1,3 +1,8 @@ +# Grabber for dailymotion.com +# +# (c) 2007 by Ralf Ertzinger +# licensed under GNU GPL v2 + package DailyMotionGrabber; use GrabberBase; @@ -18,6 +23,8 @@ sub new { bless($self, $class); + $self->_prepare_parameters(); + return $self; } @@ -58,6 +65,7 @@ sub _parse { if ('meta' eq $e->[0]) { if ('title' eq $e->[1]->{'name'}) { $metadata->{'TITLE'} = $e->[1]->{'content'}; + $metadata->{'TITLE'} =~ s/^Dailymotion\s*:\s*//; } } } @@ -65,9 +73,9 @@ sub _parse { # Look for the download URL foreach $e (@text) { if ($e->[0] =~ m|\.addVariable\("url", "([^\"]+)"|) { - my $decoded = $1; - $decoded =~ s/%(..)/chr(hex($1))/ge; - $metadata->{'DLURL'} = $decoded; + $metadata->{'DLURL'} = $1; + $metadata->{'DLURL'} =~ s/%(..)/chr(hex($1))/ge; + } }