NAME

WebService::Strike::Torrent - Class representing information about a torrent

SYNOPSIS

use WebService::Strike;
my $t = strike 'B425907E5755031BDA4A8D1B6DCCACA97DA14C04';
say $t->hash;             # B425907E5755031BDA4A8D1B6DCCACA97DA14C04
say $t->title;            # Arch Linux 2015.01.01 (x86/x64)
say $t->category;         # Applications
say $t->sub_category;     # '' (empty string)
say $t->seeds;
say $t->leeches;
say $t->count;            # 1
say $t->size;             # 615514112
say $t->date;             # 1420502400
say $t->uploader;         # The_Doctor-
say @{$t->names};         # archlinux-2015.01.01-dual.iso
say @{$t->lengths};       # 615514112
say $t->magnet;           # magnet:?xt=urn:btih:B425907E5755031BDA4A8D1B6DCCACA97DA14C04&dn=Arch%20Linux%202015.01.01%20%28x86%2Fx64%29
my $tor = $t->torrent;    # $torrent contains the torrent file contents
$t->torrent('x.torrent'); # Download torrent file to x.torrent
say $t->description;      # <HTML fragment describing Arch Linux>

$t = strike 'ED70C185E3E3246F30B2FDB08D504EABED5EEA3F';
say $t->title;                          # The Walking Dead S04E15 HDTV x264-2HD
say $t->imdb_id;                        # tt1520211
my $i = $t->imdb;
say $i->{title}, ' (', $i->{year}, ')'; # The Walking Dead (2010)
say $i->{genre};                        # Drama, Horror, Thriller

DESCRIPTION

WebService::Strike::Torrent is a class that represents information about a torrent.

Methods:

hash, torrent_hash

The info_hash of the torrent.

title, torrent_title

The title of the torrent.

category, torrent_category

The category of the torrent.

sub_category

The subcategory of the torrent.

seeds

The number of seeders.

leeches

The number of leechers.

count, file_count

The number of files contained in the torrent.

size

The total size of the files in the torrent in bytes.

date, upload_date

Unix timestamp when the torrent was uploaded, with precision of one day.

uploader, uploader_username

Username of the user who uploaded the torrent.

file_names

Arrayref of paths of files in the torrent.

file_lengths

Arrayref of lengths of files in the torrent, in bytes.

magnet, magnet_uri

Magnet link for the torrent.

torrent([$filename])

Downloads the torrent from Strike. With no arguments, returns the contents of the torrent file. With an argument, stores the torrent in $filename.

Both forms return a true value for success and false for failure.

description

The description of the torrent. This method sends an extra request to Strike. Successful responses are cached.

imdb_id

The IMDB ID of the torrent, or undef if the torrent has no associated IMDB ID.

imdb

Calls strike_imdb from WebService::Strike on imdb_id. Caches the response. Returns undef if the torrent has no associated IMDB ID.

SEE ALSO

WebService::Strike, https://getstrike.net/api/

AUTHOR

Marius Gavrilescu, <marius@ieval.ro>

COPYRIGHT AND LICENSE

Copyright (C) 2015 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.20.2 or, at your option, any later version of Perl 5 you may have available.