torrent文件的编码、解码
Project description
TorrentBEncode3
用于编码、解码torrent文件的bencode格式, 需要Python3.5+
安装
pip3 install torrent-bencode3
测试
git clone https://github.com/skytoup/TorrentBEncode3
cd TorrentBEncode3
pip3 install -r requirements-test.txt
tox
使用
from bencode import BEncode
s = BEncode.loads(b'11:hello world') # b'hello world'
BEncode.dumps(s) # b'11:hello world'
with open('/path/to/torrent', 'rb') as f:
obj = BEncode.load(f)
with open('/path/to/save/torrent', 'wb') as wf:
BEncode.dump(obj, wf)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
torrent-bencode3-0.1.0.tar.gz
(4.4 kB
view hashes)