mirror of
https://gitlab.com/sandfox/torrent-file.git
synced 2026-04-21 06:32:34 +00:00
PHP Torrent File Class
- PHP 100%
| docs | ||
| src | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .readthedocs.yaml | ||
| CHANGELOG.md | ||
| composer.json | ||
| LICENSE.md | ||
| phpcs.xml | ||
| phpunit.xml | ||
| psalm.xml | ||
| README.md | ||
PHP Torrent File Library
A PHP Class to work with torrent files
Installation
composer require arokettu/torrent-file
Usage
<?php
use Arokettu\Torrent\TorrentFile;
// 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;
}
Features
- Torrent file data manipulation
- Torrent file creation
- Torrent file listing
- Support for torrent files version 1, version 2, Hybrid v1+v2, a lot of BEPs like Nodes, Url Lists, etc
- Torrent file signing
CLI tool
A CLI tool based on the library: https://sandfox.dev/php/torrent-file-cli.html
Documentation
Read full documentation here: https://sandfox.dev/php/torrent-file.html
Also on Read the Docs: https://torrent-file.readthedocs.io/
Support
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:
- 5.x (current, PHP 8.1+)
License
The library is available as open source under the terms of the MIT License.