X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FWWW%2FOffliberty.pm;h=b2fdbcdfe7a5c95df12ce86b73f7be34a87127be;hb=refs%2Ftags%2F1.000005;hp=a5404b62893931281c055c68236493971fa99b80;hpb=934b4ce32f69eaf8181073fd9cd5e8372ce1100e;p=www-offliberty.git diff --git a/lib/WWW/Offliberty.pm b/lib/WWW/Offliberty.pm index a5404b6..b2fdbcd 100644 --- a/lib/WWW/Offliberty.pm +++ b/lib/WWW/Offliberty.pm @@ -4,10 +4,10 @@ use 5.008009; use strict; use warnings; use parent qw/Exporter/; -our $VERSION = '1.000002'; +our $VERSION = '1.000005'; our @EXPORT_OK = qw/off/; -use constant OFF_URL => 'http://offliberty.com/off02.php'; +our $OFF_URL = 'http://offliberty.com/off03.php'; use HTML::TreeBuilder; use HTTP::Tiny; @@ -16,7 +16,7 @@ our $http = HTTP::Tiny->new(agent => "WWW-Offliberty/$VERSION ", default_headers sub off{ my ($url, @params) = @_; - my $ret = $http->post_form(OFF_URL, {track => $url, @params}); + my $ret = $http->post_form($OFF_URL, {track => $url, @params}); die $ret->{reason} unless $ret->{success}; ## no critic (RequireCarping) my $root = HTML::TreeBuilder->new_from_content($ret->{content}); map { $_->attr('href') } $root->look_down(qw/_tag a class download/); @@ -53,6 +53,14 @@ audio-only URL when called with no parameters, and two URLs B set to B<1>. In contrast, Vimeo URLs with no parameters return both audio-only and audio/video variants. +Note: The URL of the service sometimes changes, which breaks this +module. If you notice this, please report a bug on RT. While the bug +is being fixed, you can override the URL locally by doing: + + $WWW::Offliberty:OFF_URL = 'http://offliberty.com/correct_url.php'; + +before calling off. + =head1 SEE ALSO L @@ -63,7 +71,7 @@ Marius Gavrilescu, Emarius@ieval.roE =head1 COPYRIGHT AND LICENSE -Copyright (C) 2013-2015 by Marius Gavrilescu +Copyright (C) 2013-2017 by Marius Gavrilescu This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.18.1 or,