BitTorrent-Simple
view release on metacpan or search on metacpan
script/torrent view on Meta::CPAN
# âââ Tracker Communication ââââââââââââââââââââââââââââââââââââââââââââââââââââ
sub contact_tracker {
my ($announce, $info_hash, $peer_id, $left, $event) = @_;
my $sep = ($announce =~ /\?/) ? '&' : '?';
my $url = $announce . $sep
. 'info_hash=' . uri_escape($info_hash, "^A-Za-z0-9\\-_.!~*'()")
. '&peer_id=' . uri_escape($peer_id, "^A-Za-z0-9\\-_.!~*'()")
. '&port=6881'
. '&uploaded=0'
. '&downloaded=0'
. '&left=' . $left
. '&compact=1';
$url .= "&event=$event" if $event;
print " Contacting: $announce\n";
my $ua = LWP::UserAgent->new(timeout => 15);
my $resp = $ua->get($url);
unless ($resp->is_success) {
( run in 0.752 second using v1.01-cache-2.11-cpan-b16cb0d3907 )