torrent file
5.3.1
A PHP Class to work with torrent files
composer require arokettu/torrent-file
<?php
use ArokettuTorrentTorrentFile;
// open file
$torrent = TorrentFile::load('debian.torrent');
// create for path (file or directory)
$torrent = TorrentFile::fromPath('/home/user/dists/debian');
// manipulate fields
$torrent->setAnnounce('http://tracker.example:1234');
// list files
foreach ($torrent->v1()->getFiles() as $file) {
echo implode('/', $file->path()) , ': ' , $file->length, PHP_EOL;
}
A CLI tool based on the library: https://sandfox.dev/php/torrent-file-cli.html
Read full documentation here: https://sandfox.dev/php/torrent-file.html
Also on Read the Docs: https://torrent-file.readthedocs.io/
Please file issues on our main repo at GitLab: https://gitlab.com/sandfox/torrent-file/-/issues
Feel free to ask any questions in our room on Gitter: https://gitter.im/arokettu/community
Supported versions:
The library is available as open source under the terms of the MIT License.