arokettu / torrent-file
A class to work with torrent files
5.3.1
2024-07-28 21:43 UTC
Requires
- php: ^8.1
- ext-hash: *
- arokettu/bencode: ^2.8 | ^3.1 | ^4.0
- nikic/iter: ^2.2
- psr/event-dispatcher: ^1.0
- symfony/filesystem: ^5.4 | ^6.0 | ^7.0
- symfony/finder: ^5.4 | ^6.0 | ^7.0
Requires (Dev)
- ext-openssl: *
- jetbrains/phpstorm-attributes: ^1.0
- league/event: ^3.0
- phpunit/phpunit: ^10.5.3
- psy/psysh: *
- sandfox.dev/code-standard: ^1.2024.07.05
- squizlabs/php_codesniffer: *
- vimeo/psalm: ^5.2
Suggests
- ext-openssl: for signature logic
- dev-master
- 5.3.1
- 5.3.0
- 5.2.2
- 5.2.1
- 5.2.0
- 5.1.0
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 4.x-dev
- 4.1.1
- 4.1.0
- 4.0.1
- 4.0.0
- 3.x-dev
- 3.3.1
- 3.3.0
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.1
- 3.0.0
- 2.x-dev
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.0
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.0
- 1.x-dev
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- 0.1.1
- 0.1.0
This package is auto-updated.
Last update: 2024-11-11 15:22:33 UTC
README
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.