The Torrent RW does not have a function that returns the Magnet Link. Only the Torrent-parse, through function magnet()
. Take an example:
error_reporting(E_STRICT);
include 'Torrent.php';
$torrent = new Torrent('tails-i386-1.2.3.torrent');
echo "<pre>";
echo "Nome do arquivo: ". $torrent->name() . "<br>";
echo "Tamanho: ". $torrent->size(2) . "<br>";
echo "Piece length: ". $torrent->piece_length() . "<br>";
echo "HASH: ". $torrent->hash_info() . "<br>";
echo 'Privado: '. ($torrent->is_private() ? 'Sim' : 'Não'). "<br>";
echo 'Comentário: '. $torrent->comment() . "<br>";
echo 'Anúncio: '. $torrent->announce() . "<br>";
echo 'Status: ', var_dump($torrent->scrape()) . "<br>";
echo "Magnet link: ". $torrent->magnet() . "<br>";
The way out will be something like this:
Nome do arquivo: tails-i386-1.2.3
Tamanho: 907.67 Mo
Piece length: 262144
HASH: 957a82ee0d2fb0938952167d6c34dbf7e37a8946
Privado: Não
Comentário:
Anúncio: http://torrent.gresille.org/announce
Status: array(1) {
["http://torrent.gresille.org/scrape"]=>
array(3) {
["complete"]=>
int(239)
["downloaded"]=>
int(8)
["incomplete"]=>
int(0)
}
}
Magnet link: magnet:?xt=urn:btih:957a82ee0d2fb0938952167d6c34dbf7e37a8946&dn=tails-i386-1.2.3&xl=951765793&tr=http://torrent.gresille.org/announce
I didn’t understand your doubt, it’s programming?
– Renaro Santos
Yes, those two classes I passed present the problems I mentioned above.
– Lucas Caresia
Lucas, I edited the question to make it more objective, the way it was was vague, so the rain negative, if my editing is wrong, you can reverse it.
– stderr
Thanks for the help.
– Lucas Caresia