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

Description

The tool to work with torrent files.

Works on Python 3.6+.

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.

Note

Some commands require requests package to be installed.

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.

Files for torrentool, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size torrentool-1.1.0-py2.py3-none-any.whl (12.6 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size torrentool-1.1.0.tar.gz (15.5 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