my $self = $class->SUPER::new();
$self->{'NAME'} = 'sevenload';
- $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*sevenload.com/videos/([^/]+)(?:/.*)*)'];
+ $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*sevenload.com/videos/(\w+?)-.*)'];
bless($self, $class);
$self->_prepare_parameters();
$metadata->{'DLURL'} = undef;
# Get the XML file containing the video metadata
- unless(defined($content = $self->simple_get(sprintf('http://api.sevenload.com/api/player/id/%s', $2)))) {
+ unless(defined($content = $self->simple_get(sprintf('http://flash.sevenload.com/player?itemId=%s', $2)))) {
$self->error('Could not download XML metadata');
return undef;
}
- unless(defined($t = $p->XMLin($content))) {
+ unless(defined($t = $p->XMLin($content, KeepRoot => 1))) {
$self->error('Could not parse XML metadata');
return undef;
}
- $metadata->{'DLURL'} = $t->{'item'}->{'video'}->{'url'};
- $metadata->{'TITLE'} = $t->{'item'}->{'title'};
+ # Loop through the video streams
+ foreach(@{$t->{'playerconfig'}->{'playlists'}->{'playlist'}->{'items'}->{'item'}->{'videos'}->{'video'}->{'streams'}->{'stream'}}) {
+ if ($_->{'quality'} eq 'high') {
+ $metadata->{'DLURL'} = $_->{'locations'}->{'location'}->{'content'};
+ }
+ }
+ $metadata->{'TITLE'} = $t->{'playerconfig'}->{'playlists'}->{'playlist'}->{'items'}->{'item'}->{'title'};
unless(defined($metadata->{'DLURL'}) && defined($metadata->{'TITLE'})) {
$self->error('Could not extract download URL and title');