🐍 Python Library

Watch torrents while downloading

Stream video content directly to VLC as it downloads. Smart piece prioritization ensures smooth playback from the start.

Terminal
$ torrent-dl "magnet:?xt=urn:btih:..."
Downloading metadata...
Starting download: movie.mp4
Serving on http://localhost:1149
Launching VLC player...

Installation

1

Install libtorrent

sudo apt-get install python3-libtorrent
2

Install torrent-dl

pip install torrent-dl

Built for streaming

Everything you need for seamless torrent playback

Instant Playback

Start watching within seconds. Smart piece prioritization downloads the beginning of files first for immediate playback.

🔁

Seek Support

Skip ahead freely. The download strategy adapts to your viewing position, fetching needed pieces on demand.

🌐

HTTP Streaming

Built-in HTTP server serves content to any media player. Supports range requests for proper seeking.

💾

Keep Downloads

Files are saved to disk as they download. Watch now, keep forever.

🔗

Magnet Links

Works with magnet URIs. Just paste a link and start watching.

Configurable

Custom download paths, port settings, upload/download limits. Tune it to your needs.

Simple to use

One command to start streaming

Basic usage

torrent-dl "magnet:?xt=urn:btih:..."

Opens VLC and starts playback automatically

Server mode

torrent-dl --serve "magnet:?xt=urn:btih:..."

Starts HTTP server without launching VLC

Custom port and path

torrent-dl -p 8080 -d ~/Movies "magnet:..."

Serve on port 8080, save to ~/Movies

Command options

--serve Run as HTTP server without launching VLC
-p, --port HTTP server port (default: 1149)
-d, --download Download directory path
--verbose Show detailed logging output
--player Media player to use (default: vlc)

How it works

Smart downloading for smooth streaming

1

Fetch Metadata

Connect to the swarm and download torrent metadata to identify files and their structure.

2

Prioritize Pieces

Download the first pieces of the video file at high priority for immediate playback.

3

Start Streaming

Launch HTTP server and begin serving content to VLC as pieces arrive.

4

Adaptive Strategy

As you seek or skip, the strategy shifts to fetch the pieces you need next.

Requirements

What you need to get started

🐍

Python 3.8+

Modern Python installation required

📦

libtorrent

System library for BitTorrent protocol

🎥

VLC Player

For automatic media playback

Platform-specific installation

sudo apt-get install python3-libtorrent vlc
brew install libtorrent-rasterbar vlc

Start streaming today

Watch your torrents without waiting for the full download.