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
Youtube: new video formats, again
[videosite.git]
/
videosite
/
VimeoGrabber.pm
diff --git
a/videosite/VimeoGrabber.pm
b/videosite/VimeoGrabber.pm
index
4371e53
..
ba76cff
100644
(file)
--- a/
videosite/VimeoGrabber.pm
+++ b/
videosite/VimeoGrabber.pm
@@
-8,7
+8,7
@@
package videosite::VimeoGrabber;
use videosite::GrabberBase;
@ISA = qw(videosite::GrabberBase);
use videosite::GrabberBase;
@ISA = qw(videosite::GrabberBase);
-use LWP::
Simple qw(!get)
;
+use LWP::
UserAgent
;
use XML::Simple;
use Digest::MD5 qw(md5_hex);
use Data::Dumper;
use XML::Simple;
use Digest::MD5 qw(md5_hex);
use Data::Dumper;
@@
-41,6
+41,7
@@
sub _parse {
my $dlpath;
my $timestamp;
my $hash;
my $dlpath;
my $timestamp;
my $hash;
+ my $ua = LWP::UserAgent->new(agent => 'Mozilla');
$url =~ m|$pattern|;
$url = $1;
$url =~ m|$pattern|;
$url = $1;
@@
-53,11
+54,14
@@
sub _parse {
$metadata->{'DLURL'} = undef;
# Get the XML file containing the video metadata
$metadata->{'DLURL'} = undef;
# Get the XML file containing the video metadata
- unless(defined($content = LWP::Simple::get(sprintf('http://www.vimeo.com/moogaloop/load/clip:%s/local?context=default&context_id=undefined', $2)))) {
+ $content = $ua->get(sprintf('http://www.vimeo.com/moogaloop/load/clip:%s', $2));
+ unless ($content->is_success()) {
$self->error('Could not download XML metadata');
return undef;
}
$self->error('Could not download XML metadata');
return undef;
}
+ $content = $content->decoded_content();
+
unless(defined($t = $p->XMLin($content, KeepRoot => 1))) {
$self->error('Could not parse XML metadata');
return undef;
unless(defined($t = $p->XMLin($content, KeepRoot => 1))) {
$self->error('Could not parse XML metadata');
return undef;