- my ($self, $file) = @_;
- my $url = $WebService::Strike::BASE_URL . '/torrents/download/?hash=' . $self->hash;
- my $ht = WebService::Strike::_ht(); ## no critic (ProtectPrivate)
- my $response = $ht->get($url);
- return unless $response->{success};
- $response = decode_json $response->{content};
- $url = $response->{message};
-
- if (defined $file) {
- $response = $ht->mirror($url, $file);
- return $response->{success}
- } else {
- $response = $ht->get($url);
- return $response->{success} && $response->{content}
- }