use strict;
use warnings;
use parent qw/Exporter/;
-our $VERSION = '1.000001';
+our $VERSION = '1.000003';
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;
-our $http = HTTP::Tiny->new(agent => "WWW-Offliberty/$VERSION ", default_headers => {Referer => "http://offliberty.com/"});
+our $http = HTTP::Tiny->new(agent => "WWW-Offliberty/$VERSION ", default_headers => {Referer => 'http://offliberty.com/'});
sub off{
my ($url, @params) = @_;
- my $ret = $http->post_form(OFF_URL, {track => $url, @params});
- die $ret->{reason} unless $ret->{success};
+ 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/);
}
B<video_file> 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<http://offliberty.com>