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.

Source Distribution

torrent-bencode3-0.1.1.tar.gz (4.3 kB view details)

Uploaded Source

File details

Details for the file torrent-bencode3-0.1.1.tar.gz.

File metadata

  • Download URL: torrent-bencode3-0.1.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.8.0

File hashes

Hashes for torrent-bencode3-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6f2820f6cdb1c866f2c1f70f4c523fc6a418451fd8c84531ef8a0154fb675b9a
MD5 42312dc83ba9d501415d4b21a8c2abcc
BLAKE2b-256 6211fdeacaeb0fcb1f568fc403f48cf74882713b216a657d8ad8fafe7d2de15a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page