5
I wonder how I can get information from a file .torrent using any of these classes:
5
I wonder how I can get information from a file .torrent using any of these classes:
5
To display file information torrent with the class Torrent-RW
, do the following:
require "Torrent.php";
$torrent = new Torrent('ubuntu-14.10-desktop-i386.iso.torrent');
echo '<pre>Privado? ', $torrent->is_private() ? 'Sim' : 'Não',
'<br>Anúncio: ';
var_dump($torrent->announce());
echo '<br>Arquivo: ', $torrent->name(),
'<br>Comentário: ', $torrent->comment(),
'<br>Tamanho em pedaços: ', $torrent->piece_length(),
'<br>Tamanho: ', $torrent->size(2),
'<br>HASH: ', $torrent->hash_info(),
'<br>Status: ';
var_dump($torrent->scrape());
The result will be something like this:
Privado? Não
Anúncio: array(2) {
[0]=>
array(1) {
[0]=>
string(39) "http://torrent.ubuntu.com:6969/announce"
}
[1]=>
array(1) {
[0]=>
string(44) "http://ipv6.torrent.ubuntu.com:6969/announce"
}
}
Arquivo: ubuntu-14.10-desktop-i386.iso
Comentário: Ubuntu CD releases.ubuntu.com
Tamanho em pedaços: 524288
Tamanho: 1.11 Go
HASH: 1619ecc9373c3639f4ee3e261638f29b33a6cbd6
Status: array(2) {
["http://ipv6.torrent.ubuntu.com:6969/scrape"]=>
string(29) "Tracker request timeout (30s)"
["http://torrent.ubuntu.com:6969/scrape"]=>
array(4) {
["complete"]=>
int(1609)
["downloaded"]=>
int(29)
["incomplete"]=>
int(72)
["name"]=>
string(29) "ubuntu-14.10-desktop-i386.iso"
}
}
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
Here it is one print how it should work.
– stderr
Strange, with your file, worked well, everything appears, but with mine do not work.
– Lucas Caresia
@Lucascarezia Test with other files, it may be that this file .torrent that you use to test is corrupted or something.
– stderr
I tried with some 7/8 files and they all give the same poblema
– Lucas Caresia