Skip to main content

LibtorrentX

A python wrapper for libtorrent, makes it easy to manage torrents. Built in support for state management and state recovery after restart.

  • Easily pause and resume your torrent streams.
  • Optimized settings for faster download speeds.

Install via pip

pip install libtorrentx

Simple demo app

from libtorrentx import LibTorrentSession
import time

magnet = "magnet:?xt=urn:btih:4C9B41D664D7B6B23F0BF39AE185858CBADDA3FF"
output_dir = "./downloads"
session = LibTorrentSession()
handle = session.add_torrent(magnet, output_dir)

while True:
    props = handle.props()

    if not props.ok:
        print("waiting for torrent to start...")
        time.sleep(1)
        continue

    print(props.string)

    if props.is_finished:
        break

    time.sleep(1)

or use CLI python -m libtorrentx -m magnet:?xt=urn:btih:4C9B41D664D7B6B23F0BF39AE185858CBADDA3FF

Output

Spider-Man.No.Way.Home.2022.1080p.BluRay.1600MB.DD5.1.x264-GalaxyRG[TGx], 1.20 MB/s, 19%
Spider-Man.No.Way.Home.2022.1080p.BluRay.1600MB.DD5.1.x264-GalaxyRG[TGx], 12.00 MB/s, 19%
Spider-Man.No.Way.Home.2022.1080p.BluRay.1600MB.DD5.1.x264-GalaxyRG[TGx], 28.11 MB/s, 77%
Spider-Man.No.Way.Home.2022.1080p.BluRay.1600MB.DD5.1.x264-GalaxyRG[TGx], 29.00 MB/s, 100%

You can stop the execution and restart again, the download will resume from previous state.

Install via Docker

docker build . -t libtorrentx
docker run --rm -it -v $(pwd)/downloads:/app/downloads libtorrentx -m magnet:?xt=urn:btih:4C9B41D664D7B6B23F0BF39AE185858CBADDA3FF

Release files for libtorrentx 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libtorrentx 0.0.8
File Size Uploaded
libtorrentx-0.0.8.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for libtorrentx 0.0.8
File Interpreter ABI Platform
libtorrentx-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / libtorrentx-0.0.8.tar.gz

Download URL libtorrentx-0.0.8.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
de47a39e2d7dc5328e33a055c765c57b9ba4d1a306d9246e2ff54d5832dae9ac
BLAKE2b-256 checksum
How to use checksums
9311de8a026c76095ee4b1dc8aaf23dc6386197ec068c7728b7b8e1c93d714a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release files / libtorrentx-0.0.8-py3-none-any.whl

Download URL libtorrentx-0.0.8-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3482d78f77c4646e405f4405ae0178d1acde7199de1877c7b097fee1c02a0b72
BLAKE2b-256 checksum
How to use checksums
ab39c6f5a9789c7cf8cfc0ade218f25d558af2e99bd9cde1b31c5f1810f63d57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.0.8 This release

2 release files

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

2 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page