git://git.camperquake.de
/
videosite.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
139748a
)
FileGetter: Use full blown HTTP::UserAgent to set the User-Agent
author
Ralf Ertzinger
<ralf@skytale.net>
Sat, 23 Jul 2011 20:33:50 +0000
(22:33 +0200)
committer
Ralf Ertzinger
<ralf@skytale.net>
Sat, 23 Jul 2011 20:33:50 +0000
(22:33 +0200)
videosite/FileGetter.pm
patch
|
blob
|
history
diff --git
a/videosite/FileGetter.pm
b/videosite/FileGetter.pm
index
66f5f0d
..
dab7ff3
100644
(file)
--- a/
videosite/FileGetter.pm
+++ b/
videosite/FileGetter.pm
@@
-10,7
+10,6
@@
use videosite::GetterBase;
@ISA = qw(videosite::GetterBase);
use strict;
@ISA = qw(videosite::GetterBase);
use strict;
-use LWP::Simple qw(!get);
use File::Basename;
sub new {
use File::Basename;
sub new {
@@
-31,6
+30,7
@@
sub get {
my $video = shift;
my $dlfile;
my $dirname;
my $video = shift;
my $dlfile;
my $dirname;
+ my $ua = $self->ua();
my $res;
$dlfile = sprintf($self->_getval('FILEPATTERN'),
my $res;
$dlfile = sprintf($self->_getval('FILEPATTERN'),
@@
-48,8
+48,9
@@
sub get {
$self->debug('Going to download %s to %s', $video->{'DLURL'}, $dlfile);
$self->debug('Going to download %s to %s', $video->{'DLURL'}, $dlfile);
- if (200 != ($res = LWP::Simple::mirror($video->{'DLURL'}, $dlfile))) {
- $self->error('Could not download %s to %s (%s)', $video->{'DLURL'}, $dlfile, $res);
+ $res = $ua->mirror($video->{'DLURL'}, $dlfile);
+ if (!$res->is_success()) {
+ $self->error('Could not download %s to %s (%s)', $video->{'DLURL'}, $dlfile, $res->code());
return 0;
}
return 0;
}