commit 33dc3c07ec87edc6be1252b1159d90b63fe16e70
parent 047e3fc61d17a70d45bc4b8819a3ed4fe4b9239e
Author: Paco Esteban <paco@onna.be>
Date: Wed, 21 Mar 2018 16:16:38 +0100
fixing app_id bug in the module
Diffstat:
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/Changes b/Changes
@@ -1,6 +1,7 @@
Revision history for Rarbg-torrentapi
{{$NEXT}}
+ - Torrentapi now needs app_id.
v0.1.5 2017-09-10 18:16:16 CEST
- PR #1 --> Fix ranked attribute. by baptistecdr
diff --git a/lib/Rarbg/torrentapi.pm b/lib/Rarbg/torrentapi.pm
@@ -46,6 +46,12 @@ has mode => (
default => 'list'
);
+has app_id => (
+ is => 'rw',
+ isa => 'Str',
+ default => 'p5-Rarbg-torrentapi'
+);
+
has _format => (
is => 'ro',
isa => 'Str',
@@ -78,7 +84,8 @@ has _token_time => (
sub _renew_token {
my $self = shift;
- my $res_json = $self->_ua->get( $BASEURL . "get_token=get_token" );
+ my $url = $BASEURL . "get_token=get_token&app_id=" . $self->app_id;
+ my $res_json = $self->_ua->get($url);
if ( $res_json->is_success ) {
$self->_token_time(time);
my $res = decode_json( $res_json->decoded_content );