Skip to main content

The tool to work with torrent files.

Project description

https://github.com/idlesign/torrentool

LBC Python 2
https://img.shields.io/pypi/v/torrentool.svg https://img.shields.io/pypi/l/torrentool.svg https://img.shields.io/coveralls/idlesign/torrentool/master.svg https://img.shields.io/travis/idlesign/torrentool/master.svg https://landscape.io/github/idlesign/torrentool/master/landscape.svg?style=flat

Description

The tool to work with torrent files.

Works on Python 2.7+ and 3.5+.

Includes:

  • Command line interface (requires click package to be installed)

  • Torrent utils (file creation, read and modification)

  • Bencoding utils (decoder, encoder)

Using CLI

; Make .torrent out of `video.mkv`
$ torrentool torrent create /home/my/files_here/video.mkv

; Make .torrent out of entire `/home/my/files_here` dir,
; and put some open trackers announce URLs into it,
; and publish file on torrent caching service, so it is ready to share.
$ torrentool torrent create /home/my/files_here --open_trackers --cache

; Print out existing file info.
$ torrentool torrent info /home/my/some.torrent

Use command line --help switch to know more.

From your Python code

from torrentool.api import Torrent

# Reading and modifying an existing file.
my_torrent = Torrent.from_file('/home/idle/some.torrent')
my_torrent.total_size  # Total files size in bytes.
my_torrent.magnet_link  # Magnet link for you.
my_torrent.comment = 'Your torrents are mine.'  # Set a comment.
my_torrent.to_file()  # Save changes.

# Or we can create a new torrent from a directory.
new_torrent = Torrent.create_from('/home/idle/my_stuff/')  # or it could have been a single file
new_torrent.announce_urls = 'udp://tracker.openbittorrent.com:80'
new_torrent.to_file('/home/idle/another.torrent')

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

torrentool-1.0.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

torrentool-1.0.0-py2.py3-none-any.whl (13.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file torrentool-1.0.0.tar.gz.

File metadata

  • Download URL: torrentool-1.0.0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/2.7

File hashes

Hashes for torrentool-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7847637e2603ad8eaa263410764e19e7bed2fac2c48d4007b5126fdfa5a7c1a1
MD5 8c5ed8eedd5c2e53e87469e980dd0f3d
BLAKE2b-256 cb5464ade7bae9d37af3fcd29ea8ec760af34b9bf6fe4ef64ef54b986695fe89

See more details on using hashes here.

File details

Details for the file torrentool-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for torrentool-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 eef9e81b01ac445c96eaf4f1fc006b68ddfbdd7b0f9577b786d3403570b70be9
MD5 ea7abc9fc2211897b7a33c870ee18baa
BLAKE2b-256 33644b28566387d613bd416b336c5bc1f28ecaa0400b86d08627fb0ec95f4dda

See more details on using hashes here.

Supported by

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