X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite%2FDailyMotionGrabber.pm;h=081b4b4034e748371f91917ffde49687400d0a2a;hb=ffc24eec49bbdb6117e3a67e6080c119fba6575d;hp=d08e71bc927f976a7772c742af4d3a0deb3d167a;hpb=b97a01912322f6ebccf2713c3bbbcc266f02c7b5;p=videosite.git diff --git a/videosite/DailyMotionGrabber.pm b/videosite/DailyMotionGrabber.pm index d08e71b..081b4b4 100644 --- a/videosite/DailyMotionGrabber.pm +++ b/videosite/DailyMotionGrabber.pm @@ -1,6 +1,7 @@ +# Grabber for dailymotion.com # -# download strategy revised using -# http://www.kde-apps.org/content/show.php?content=41456 +# (c) 2007 by Ralf Ertzinger +# licensed under GNU GPL v2 package DailyMotionGrabber; @@ -17,11 +18,13 @@ sub new { my $class = shift; my $self = $class->SUPER::new(); - $self->{'NAME'} = 'youtube'; - $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*.dailymotion.com/(?:[^/]+/)*video/([-a-zA-Z0-9_]+)']; + $self->{'NAME'} = 'dailymotion'; + $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*dailymotion.com/(?:[^/]+/)*video/([-a-zA-Z0-9_]+))']; bless($self, $class); + $self->_prepare_parameters(); + return $self; } @@ -62,14 +65,17 @@ sub _parse { if ('meta' eq $e->[0]) { if ('title' eq $e->[1]->{'name'}) { $metadata->{'TITLE'} = $e->[1]->{'content'}; + $metadata->{'TITLE'} =~ s/^Dailymotion\s*:\s*//; } } } # Look for the download URL foreach $e (@text) { - if ($e->[0] =~ m|\.add_variable("url", "([^\"]+)")|) { + if ($e->[0] =~ m|\.addVariable\("url", "([^\"]+)"|) { $metadata->{'DLURL'} = $1; + $metadata->{'DLURL'} =~ s/%(..)/chr(hex($1))/ge; + } }