BitTorrent
view release on metacpan or search on metacpan
lib/BitTorrent.pm view on Meta::CPAN
our @EXPORT = qw(
getHealth
getTrackerInfo
);
our $VERSION = '0.10';
our $TorrentScrape = "/var/lib/perl/torrent-checker.php";
sub new(){
my $self = bless {}, shift;
return $self;
}; # new()
sub getTrackerInfo(){
my $self = shift;
my $file = shift;
my $content;
if ( $file =~ /^http/i ) {
$content = get($file);
} else {
open(RH,"<$file") or warn;
binmode(RH);
lib/BitTorrent.pm view on Meta::CPAN
};
}
$result{'total_size'} = $tsize;
return \%result;
}; # sub getTrackerInfo(){
sub getHealth(){
my $self = shift;
my $torrent = shift;
# init
my $Hash = ();
my %Hash = ();
# get torrent
my $random = int(rand(100000)+1);
lib/BitTorrent.pm view on Meta::CPAN
$Hash->{seeder} = $Seeder;
$Hash->{leecher} = $Leecher;
return $Hash;
}; # sub sub getHealth(){
sub bin2hex() {
my ($d) = @_;
$d =~ s/(.)/sprintf("%02x",ord($1))/egs;
$d = lc($d);
return $d;
}; # sub bin2hex() {
sub bdecode {
( run in 0.539 second using v1.01-cache-2.11-cpan-65fba6d93b7 )