sub new {
my $class = shift;
- my $self = $class->SUPER::new();
+ my $self = $class->SUPER::new(
+ NAME => 'asyncfilegetter',
+ );
- $self->{'NAME'} = 'asyncfilegetter';
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ return bless($self, $class);
}
sub get {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
+ my $self = $class->SUPER::new(
+ NAME => 'asyncwgetfilegetter',
+ );
- $self->{'NAME'} = 'asyncwgetfilegetter';
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ return bless($self, $class);
}
sub get {
'_CONNECTORS' => sub { return ({ 'name' => 'direct',
'schemas' => {} }) },
'_CONNECTOR' => undef,
+ @_,
};
bless($self, $class);
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self->{'NAME'} = 'bliptv';
- $self->{_SELFTESTURL} = 'http://blip.tv/rebelliouspixelscom/buffy-vs-edward-twilight-remixed-2274024';
- $self->{_SELFTESTTITLE} = 'Buffy vs Edward (Twilight Remixed)';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*blip.tv/\S+/\S+)'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ my $self = $class->SUPER::new(
+ NAME => 'bliptv',
+ _SELFTESTURL => 'http://blip.tv/rebelliouspixelscom/buffy-vs-edward-twilight-remixed-2274024',
+ _SELFTESTTITLE => 'Buffy vs Edward (Twilight Remixed)',
+ PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*blip.tv/\S+/\S+)'],
+ );
+
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
+ my $self = $class->SUPER::new(
+ NAME => 'break',
+ PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*break.com/index/([-a-zA-Z0-9_]+?)\.html)'],
+ );
- $self->{'NAME'} = 'break';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*break.com/index/([-a-zA-Z0-9_]+?)\.html)'];
-
- bless($self, $class);
-
- $self->_prepare_parameters();
-
- return $self;
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
+ my $self = $class->SUPER::new(
+ NAME => 'broadcaster',
+ PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*broadcaster\.com/clip/(\d+))'],
+ );
- $self->{'NAME'} = 'broadcaster';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*broadcaster\.com/clip/(\d+))'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self->{'NAME'} = 'collegehumor';
- $self->{_SELFTESTURL} = 'http://www.collegehumor.com/video/5635400/pixar-intro-parody';
- $self->{_SELFTESTTITLE} = 'Pixar Intro Parody';
- $self->{'PATTERNS'} = ['(http://www.collegehumor.com/video:(\d+))',
- '(http://www.collegehumor.com/video/(\d+))'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ my $self = $class->SUPER::new(
+ NAME => 'collegehumor',
+ _SELFTESTURL => 'http://www.collegehumor.com/video/5635400/pixar-intro-parody',
+ _SELFTESTTITLE => 'Pixar Intro Parody',
+ PATTERNS => ['(http://www.collegehumor.com/video:(\d+))',
+ '(http://www.collegehumor.com/video/(\d+))'],
+ );
+
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
+ my $self = $class->SUPER::new(
+ NAME => 'dailymotion',
+ 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;
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
+ my $self = $class->SUPER::new(
+ NAME => 'doubleviking',
+ PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*doubleviking.com/videos/(?:[-a-zA-Z0-9_ %]+/)*page0\.html/(\d+)\.html$)'],
+ );
- $self->{'NAME'} = 'doubleviking';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*doubleviking.com/videos/(?:[-a-zA-Z0-9_ %]+/)*page0\.html/(\d+)\.html$)'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self->{'NAME'} = 'filegetter';
- $self->{'_PARAMS'} = {'MINFREE' => ['500000', 'The amount of space that needs to be available on the filesystem before the video is downloaded (in kilobytes)'], 'FILEPATTERN', => ['/tmp/%s - %s - %s.flv', "The file name to save the file under. This is a string which is passed to a sprintf call later on. The parameters passed to that sprintf call, in order, are:\n- The site the video is from\n- The ID of the video\n- The title of the video\n- The URL of the video file itself\n- The URL of the site the video was taken from\nAll parameters are encoded (space and / replaced by _)"]};
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ my $self = $class->SUPER::new(
+ NAME => 'filegetter',
+ _PARAMS => {
+ MINFREE => ['500000', 'The amount of space that needs to be available on the filesystem before the video is downloaded (in kilobytes)'],
+ FILEPATTERN => ['/tmp/%s - %s - %s.flv', "The file name to save the file under. This is a string which is passed to a sprintf call later on. The parameters passed to that sprintf call, in order, are:\n- The site the video is from\n- The ID of the video\n- The title of the video\n- The URL of the video file itself\n- The URL of the site the video was taken from\nAll parameters are encoded (space and / replaced by _)"]
+ },
+ );
+
+ return bless($self, $class);
}
sub get {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self = {%{$self},
+ my $self = $class->SUPER::new(
NAME => 'FlashGetter',
- TYPE => 'getter'
- };
+ TYPE => 'getter',
+ @_,
+ );
return bless($self, $class);
}
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self->{'NAME'} = 'google';
- $self->{'PATTERNS'} = ['(http://video\.google\.com/videoplay\?docid=([-\d]+))'];
- $self->{'_PARAMS'} = {'QUALITY' => ['normal', 'Quality of the video to download. normal = standard resolution flash video, h264 = high resolution MPEG4 video']};
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ my $self = $class->SUPER::new(
+ NAME => 'google',
+ PATTERNS => ['(http://video\.google\.com/videoplay\?docid=([-\d]+))'],
+ _PARAMS => {
+ QUALITY => ['normal', 'Quality of the video to download. normal = standard resolution flash video, h264 = high resolution MPEG4 video']
+ },
+ );
+
+ return bless($self, $class);
}
sub _parse {
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);
}
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self->{'NAME'} = 'HTTPJSONGetter';
- $self->{'_PARAMS'} = {'URL' => ['http://www.example.com/getjson.pl', "The URL to call in order to trigger a download. The JSON encoded information will be POSTed to this URL."]};
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ my $self = $class->SUPER::new(
+ NAME => 'HTTPJSONGetter',
+ _PARAMS => {
+ URL => ['http://www.example.com/getjson.pl', "The URL to call in order to trigger a download. The JSON encoded information will be POSTed to this URL."]
+ },
+ );
+
+ return bless($self, $class);
}
sub get {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self->{'NAME'} = 'HTTPRPCGetter';
- $self->{'_PARAMS'} = {'URL' => ['http://www.example.com/get.pl?type=%s&vid=%s&title=%s&url=%s', "The URL to call in order to trigger a download. This is a string which is passed to a sprintf call later on. The parameters passed to that sprintf call, in order, are:\n- The site the video is from\n- The ID of the video\n- The title of the video\n- The URL of the video file itself\n- The URL of the site the video was taken from\nAll parameters are hexencoded"]};
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ my $self = $class->SUPER::new(
+ NAME => 'HTTPRPCGetter',
+ _PARAMS => {
+ URL => ['http://www.example.com/get.pl?type=%s&vid=%s&title=%s&url=%s', "The URL to call in order to trigger a download. This is a string which is passed to a sprintf call later on. The parameters passed to that sprintf call, in order, are:\n- The site the video is from\n- The ID of the video\n- The title of the video\n- The URL of the video file itself\n- The URL of the site the video was taken from\nAll parameters are hexencoded"]
+ },
+ );
+
+ return bless($self, $class);
}
sub get {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
+ my $self = $class->SUPER::new(
+ NAME => 'liveleak',
+ PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*liveleak.com/view\?i=([^\&]+))'],
+ );
- $self->{'NAME'} = 'liveleak';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*liveleak.com/view\?i=([^\&]+))'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
+ my $self = $class->SUPER::new(
+ NAME => 'mncast',
+ PATTERNS => ['(http://www\.mncast\.com/\?(\d+))'],
+ );
- $self->{'NAME'} = 'mncast';
- $self->{'PATTERNS'} = ['(http://www\.mncast\.com/\?(\d+))'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
+ my $self = $class->SUPER::new(
+ NAME => 'metacafe',
+ PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*metacafe.com/watch/(\d+)(?:\S+)?)'],
+ );
- $self->{'NAME'} = 'metacafe';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*metacafe.com/watch/(\d+)(?:\S+)?)'];
-
- bless($self, $class);
-
- $self->_prepare_parameters();
-
- return $self;
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self->{'NAME'} = 'motherless';
- $self->{_SELFTESTURL} = 'http://motherless.com/4976432';
- $self->{_SELFTESTTITLE} = 'Teen masturbation in shower';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*motherless.com/([a-zA-Z0-9]+))'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ my $self = $class->SUPER::new(
+ NAME => 'motherless',
+ _SELFTESTURL => 'http://motherless.com/4976432',
+ _SELFTESTTITLE => 'Teen masturbation in shower',
+ _PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*motherless.com/([a-zA-Z0-9]+))'],
+ );
+
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
+ my $self = $class->SUPER::new(
+ NAME => 'myvideo',
+ PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*myvideo.de/watch/(\d+))'],
+ );
- $self->{'NAME'} = 'myvideo';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*myvideo.de/watch/(\d+))'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
+ my $self = $class->SUPER::new(
+ NAME => 'nullgetter',
+ );
- $self->{'NAME'} = 'nullgetter';
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ return bless($self, $class);
}
sub get {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self->{'NAME'} = 'redtube';
- $self->{_SELFTESTURL} = 'http://www.redtube.com/8269';
- $self->{_SELFTESTTITLE} = 'Porn bloopers with pretty girl';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*redtube.com/(\d+))'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ my $self = $class->SUPER::new(
+ NAME => 'redtube',
+ _SELFTESTURL => 'http://www.redtube.com/8269',
+ _SELFTESTTITLE => 'Porn bloopers with pretty girl',
+ PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*redtube.com/(\d+))'],
+ );
+
+ return bless($self, $class);
}
sub div($$) {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self->{'NAME'} = 'sevenload';
- $self->{_SELFTESTURL} = 'http://de.sevenload.com/videos/uqDvKzh-vilogo-TV-Spot';
- $self->{_SELFTESTTITLE} = 'vilogo TV-Spot';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*sevenload.com/videos/(\w+?)-.*)'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ my $self = $class->SUPER::new(
+ NAME => 'sevenload',
+ _SELFTESTURL => 'http://de.sevenload.com/videos/uqDvKzh-vilogo-TV-Spot',
+ _SELFTESTTITLE => 'vilogo TV-Spot',
+ PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*sevenload.com/videos/(\w+?)-.*)'],
+ );
+
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self->{'NAME'} = 'snotr';
- $self->{_SELFTESTURL} = 'http://www.snotr.com/video/1836';
- $self->{_SELFTESTTITLE} = 'Brilliant thief';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*snotr\.com/video/(\d+))'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ my $self = $class->SUPER::new(
+ NAME => 'snotr',
+ _SELFTESTURL => 'http://www.snotr.com/video/1836',
+ _SELFTESTTITLE => 'Brilliant thief',
+ PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*snotr\.com/video/(\d+))'],
+ );
+
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
+ my $self = $class->SUPER::new(
+ NAME => 'spikedhumor',
+ PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*spikedhumor.com/articles/(\d+)(?:/.*)*)'],
+ );
- $self->{'NAME'} = 'spikedhumor';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*spikedhumor.com/articles/(\d+)(?:/.*)*)'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self->{'NAME'} = 'veoh';
- $self->{_SELFTESTURL} = 'http://www.veoh.com/watch/v18348952fyn2twbe';
- $self->{_SELFTESTTITLE} = '518_2 kureyon shinchan';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*veoh.com/+watch/(\w+)\??)'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ my $self = $class->SUPER::new(
+ NAME => 'veoh',
+ _SELFTESTURL => 'http://www.veoh.com/watch/v18348952fyn2twbe',
+ _SELFTESTTITLE => '518_2 kureyon shinchan',
+ PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*veoh.com/+watch/(\w+)\??)'],
+ );
+
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self->{'NAME'} = 'vimeo';
- $self->{_SELFTESTURL} = 'http://vimeo.com/35055590';
- $self->{_SELFTESTTITLE} = 'Hello';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*vimeo.com/(?:m/)?(\d+))'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ my $self = $class->SUPER::new(
+ NAME => 'vimeo',
+ _SELFTESTURL => 'http://vimeo.com/35055590',
+ _SELFTESTTITLE => 'Hello',
+ PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*vimeo.com/(?:m/)?(\d+))'],
+ );
+
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self->{'NAME'} = 'wimp';
- $self->{_SELFTESTURL} = 'http://www.wimp.com/insanebuilding/';
- $self->{_SELFTESTTITLE} = 'Insane building.';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*wimp.com/([^/]+)/?)'];
-
- bless($self, $class);
-
- $self->_prepare_parameters();
-
- return $self;
+ my $self = $class->SUPER::new(
+ NAME => 'wimp',
+ _SELFTESTURL => 'http://www.wimp.com/insanebuilding/',
+ _SELFTESTTITLE => 'Insane building.',
+ PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*wimp.com/([^/]+)/?)'],
+ );
+
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
+ my $self = $class->SUPER::new(
+ NAME => 'yahoo',
+ PATTERNS => ['(http://video\.yahoo\.com/watch/\d+/(\d+))'],
+ );
- $self->{'NAME'} = 'yahoo';
- $self->{'PATTERNS'} = ['(http://video\.yahoo\.com/watch/\d+/(\d+))'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self->{'NAME'} = 'youtube';
- $self->{_SELFTESTURL} = 'http://www.youtube.com/watch?v=dMH0bHeiRNg';
- $self->{_SELFTESTTITLE} = 'Evolution of Dance - By Judson Laipply';
- $self->{'PATTERNS'} = ['(https?://(?:[-a-zA-Z0-9_.]+\.)*youtube\.(?:com|de|co.uk)/watch(?:_popup)?\?.*?v=([-a-zA-Z0-9_]+))',
- '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtube\.(?:com|de|co.uk)/watch\#\!v=([-a-zA-Z0-9_]+))',
- '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtube\.(?:com|de|co.uk)/v/([-a-zA-Z0-9_]+))',
- '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtube\.(?:com|de|co.uk)/embed/([-a-zA-Z0-9_]+))',
- '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtube\.(?:com|de|co.uk)/user/[[:alnum:]]+\?v=([-a-zA-Z0-9_]+))',
- '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtube\.(?:com|de|co.uk)/(?:user/)?[[:alnum:]]+#p/(?:\w+/)+\d+/([-a-zA-Z0-9_]+))',
- '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtu\.be/watch\?v=([-a-zA-Z0-9_]+))',
- '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtu\.be/([-a-zA-Z0-9_]+))',
- '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtube\.(?:com|de|co.uk)/user/\w+\?.*/([-a-zA-Z0-9_]+))'];
- $self->{'_PARAMS'} = {
- 'QUALITY' => ['normal', 'Quality of the video to download.', {
- 'normal' => 'standard resolution flash video',
- 'high' => 'higher resolution flash video',
- 'h264' => 'high resolution MPEG4 video',
- 'hd' => 'HD720 resolution'}],
- 'USERNAME' => ['', 'Username to use for YouTube login'],
- 'PASSWORD' => ['', 'Password to use for YouTube login'],
- 'HTTPS' => [1, 'Whether to use HTTPS (if available) to connect to YouTube']};
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ my $self = $class->SUPER::new(
+ NAME => 'youtube',
+ _SELFTESTURL => 'http://www.youtube.com/watch?v=dMH0bHeiRNg',
+ _SELFTESTTITLE => 'Evolution of Dance - By Judson Laipply',
+ PATTERNS => ['(https?://(?:[-a-zA-Z0-9_.]+\.)*youtube\.(?:com|de|co.uk)/watch(?:_popup)?\?.*?v=([-a-zA-Z0-9_]+))',
+ '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtube\.(?:com|de|co.uk)/watch\#\!v=([-a-zA-Z0-9_]+))',
+ '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtube\.(?:com|de|co.uk)/v/([-a-zA-Z0-9_]+))',
+ '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtube\.(?:com|de|co.uk)/embed/([-a-zA-Z0-9_]+))',
+ '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtube\.(?:com|de|co.uk)/user/[[:alnum:]]+\?v=([-a-zA-Z0-9_]+))',
+ '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtube\.(?:com|de|co.uk)/(?:user/)?[[:alnum:]]+#p/(?:\w+/)+\d+/([-a-zA-Z0-9_]+))',
+ '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtu\.be/watch\?v=([-a-zA-Z0-9_]+))',
+ '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtu\.be/([-a-zA-Z0-9_]+))',
+ '(https?://(?:[-a-zA-Z0-9_.]+\.)*youtube\.(?:com|de|co.uk)/user/\w+\?.*/([-a-zA-Z0-9_]+))'],
+ _PARAMS => {
+ QUALITY => ['normal', 'Quality of the video to download.', {
+ normal => 'standard resolution flash video',
+ high => 'higher resolution flash video',
+ h264 => 'high resolution MPEG4 video',
+ hd => 'HD720 resolution'}],
+ USERNAME => ['', 'Username to use for YouTube login'],
+ PASSWORD => ['', 'Password to use for YouTube login'],
+ HTTPS => [1, 'Whether to use HTTPS (if available) to connect to YouTube']
+ },
+ );
+
+ return bless($self, $class);
}
sub _parse {
sub new {
my $class = shift;
- my $self = $class->SUPER::new();
-
- $self->{'NAME'} = 'zeropunctuation';
- $self->{_SELFTESTURL} = 'http://www.escapistmagazine.com/videos/view/zero-punctuation/5346-Amy';
- $self->{_SELFTESTTITLE} = 'Amy';
- $self->{'PATTERNS'} = ['(http://www.escapistmagazine.com/videos/view/zero-punctuation/([-A-Za-z0-9]+))'];
-
- bless($self, $class);
- $self->_prepare_parameters();
-
- return $self;
+ my $self = $class->SUPER::new(
+ NAME => 'zeropunctuation',
+ _SELFTESTURL => 'http://www.escapistmagazine.com/videos/view/zero-punctuation/5346-Amy',
+ _SELFTESTTITLE =>'Amy',
+ PATTERNS => ['(http://www.escapistmagazine.com/videos/view/zero-punctuation/([-A-Za-z0-9]+))'],
+ );
+
+ return bless($self, $class);
}
sub _parse {