git://git.camperquake.de
/
videosite.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix quoting in AsyncWgetFileGetter again
[videosite.git]
/
videosite
/
MNCastGrabber.pm
diff --git
a/videosite/MNCastGrabber.pm
b/videosite/MNCastGrabber.pm
index
55c5e2c
..
45954f9
100644
(file)
--- a/
videosite/MNCastGrabber.pm
+++ b/
videosite/MNCastGrabber.pm
@@
-3,12
+3,11
@@
#
# Grabber for mncast.com
#
# Grabber for mncast.com
-package MNCastGrabber;
+package
videosite::
MNCastGrabber;
-use GrabberBase;
-@ISA = qw(GrabberBase);
+use
videosite::
GrabberBase;
+@ISA = qw(
videosite::
GrabberBase);
-use LWP::Simple qw(!get);
use XML::Simple;
use HTML::TokeParser;
use Data::Dumper;
use XML::Simple;
use HTML::TokeParser;
use Data::Dumper;
@@
-17,15
+16,13
@@
use strict;
sub new {
my $class = shift;
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 _parse {
@@
-38,6
+35,7
@@
sub _parse {
my $t;
my @accum;
my $vid;
my $t;
my @accum;
my $vid;
+ my $ua = $self->ua();
$url =~ m|$pattern|;
$url = $1;
$url =~ m|$pattern|;
$url = $1;
@@
-50,7
+48,7
@@
sub _parse {
$metadata->{'DLURL'} = undef;
# First, get a webpage containing the video ID
$metadata->{'DLURL'} = undef;
# First, get a webpage containing the video ID
- unless(defined($content =
LWP::Simple::get(sprintf('http://www.mncast.com/player/index.asp?mnum=%s', $2)
))) {
+ unless(defined($content =
$self->simple_get(sprintf('http://www.mncast.com/player/index.asp?mnum=%s', $2), $ua
))) {
$self->error('Could not download player page');
return undef;
}
$self->error('Could not download player page');
return undef;
}
@@
-65,7
+63,7
@@
sub _parse {
}
# Get the XML file containing the video metadata
}
# Get the XML file containing the video metadata
- unless(defined($content =
LWP::Simple::get(sprintf('http://www.mncast.com/_MovieInfo_/_MovieInfoXML_Tag_v2.asp?movieID=%s&loginPNum=-1&player=0', $vid)
))) {
+ unless(defined($content =
$self->simple_get(sprintf('http://www.mncast.com/_MovieInfo_/_MovieInfoXML_Tag_v2.asp?movieID=%s&loginPNum=-1&player=0', $vid), $ua
))) {
$self->error('Could not download XML metadata');
return undef;
}
$self->error('Could not download XML metadata');
return undef;
}