OPSnet / bencode-torrent

PHP library for encoding and decoding BitTorrent BEncode data, focused around Gazelle.
The Unlicense
11 stars 2 forks source link

Support for v2 #4

Open paxter opened 3 years ago

paxter commented 3 years ago

Are there any plans to implement specification v2 (BEP 52)? Some clients already implemented this.

https://www.bittorrent.org/beps/bep_0052.html https://blog.libtorrent.org/2020/09/bittorrent-v2/

itismadness commented 3 years ago

Looking at the v2 specification, it seems like the only thing for this library is to rework the BencodeTorrent methods that involves files (getSize, getFileList, hasFiles, and getGazelleFileList) such that it looks for $this->data['info']['file tree'], otherwise falls back to $this->data['info']['files'].

Rhilip commented 2 years ago

I make a fork Rhilip/Bencode, the Class Rhilip\Bencode\TorrentFile support both bittorrent v1 and v2