From 4ef783996af76523173708b468afd4a093ee5c2e Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sat, 9 May 2015 10:36:23 +0300 Subject: [PATCH] Use HTTP::Tiny instead of LWP::Simple --- Makefile.PL | 1 - lib/Music/Tag/Coveralia.pm | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index e26f950..577e716 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -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/, }, diff --git a/lib/Music/Tag/Coveralia.pm b/lib/Music/Tag/Coveralia.pm index 6a23335..fe2e9c6 100644 --- a/lib/Music/Tag/Coveralia.pm +++ b/lib/Music/Tag/Coveralia.pm @@ -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 -- 2.30.2