Use HTTP::Tiny instead of LWP::Simple
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 9 May 2015 07:36:23 +0000 (10:36 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 9 May 2015 07:36:23 +0000 (10:36 +0300)
Makefile.PL
lib/Music/Tag/Coveralia.pm

index e26f95044e59286e0a97371a0d39a7d6cdbda7ed..577e716e3a2496a7bc48050b2e910ee08614f548 100644 (file)
@@ -15,7 +15,6 @@ WriteMakefile(
        PREREQ_PM         => {
                qw/Music::Tag 0
                   Music::Tag::Generic 0
-                  LWP::Simple 0
                   WWW::Search 0
                   WWW::Search::Coveralia 0/,
        },
index 6a2333503ee96b4c08b0e7c3fcff651e74786581..fe2e9c66f0908c089f3130bc0faa80d6bfe4cfa7 100644 (file)
@@ -7,12 +7,14 @@ use parent qw/Music::Tag::Generic/;
 
 our $VERSION = '0.000_001';
 
-use LWP::Simple qw/get/;
+use HTTP::Tiny;
 use WWW::Search;
 
 sub required_values { qw/album/ }
 sub set_values { qw/picture/ }
 
+my $ht = HTTP::Tiny->new(agent => "Music-Tag-Coveralia/$VERSION");
+
 sub get_tag {
        my ($self) = @_;
 
@@ -25,7 +27,9 @@ sub get_tag {
                next if $self->info->has_data('artist') && $self->info->get_data('artist') ne $res->artist;
                $self->status(0, 'Selected album ' . $res->title . ' by ' . $res->artist);
                if ($res->cover('frontal')) {
-                       $self->info->set_data(picture => {_Data => get $res->cover('frontal')});
+                       my $resp = $ht->get($res->cover('frontal'));
+                       last unless $resp->{success};
+                       $self->info->set_data(picture => {_Data => $resp->{content}});
                        $self->tagchange('picture');
                }
                last
This page took 0.011407 seconds and 4 git commands to generate.