Skip to main content

torrent文件的编码、解码

Project description

TorrentBEncode3

用于编码、解码torrent文件的bencode格式, 需要Python3.5+

安装

pip3 install torrent-bencode3

测试

  1. git clone https://github.com/skytoup/TorrentBEncode3
  2. cd TorrentBEncode3
  3. pip3 install -r requirements-test.txt
  4. tox

使用

from bencode import dumps, loads, dump, load


s = loads(b'11:hello world')  # b'hello world'
dumps(s)  # b'11:hello world'

with open('/path/to/torrent', 'rb') as f:
    obj = load(f)
    with open('/path/to/save/torrent', 'wb') as wf:
        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.

Files for torrent-bencode3, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size torrent-bencode3-0.1.1.tar.gz (4.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page