Skip to main content

btstrm - BitTorrent Streaming Program

btstrm is a Python program that allows you to stream torrents directly from the command line. It provides a seamless streaming experience by leveraging the power of BitTorrent and integrating with popular media players.

Features

  • Stream torrents directly without waiting for the entire download to complete
  • Search for torrents using multiple indexers through Jackett integration
  • Fetch movie titles and posters from The Movie Database (TMDB)
  • Interactive selection of torrents and movie titles using fzf
  • Automatic detection and use of available media players (omxplayer, mpv, vlc)
  • Option to keep downloaded files after streaming
  • Integration with impd for condensing videos for language learning
  • Real-time display of download progress and peer information
  • Support for multiple languages and configurable settings
  • Automatically subtitle searching using great osd program

Prerequisites

Before using btstrm, ensure that you have the following dependencies installed:

  • Python 3.x
  • Player of your choice: mpv, vlc or omxplayer (for RPi)
  • btfs (BitTorrent Filesystem)
  • fzf (fuzzy finder)
  • Jackett (optional, but highly recommended for torrent search integration)
  • impd (optional, for language immersion enthusiasts)
  • chafa (for displaying movie posters)
  • osd (optional, for subtitle downloading)
  • Required Python packages: requests, tqdm, colorama, beautifulsoup4, unidecode

At ArchLinux you can find all these programs in repos or AUR.

Installation via PyPi

pipx install btstrm

Manual installation

  1. Clone the repository or download the btstrm.py file.

  2. Install the required Python packages:

    pip install requests tqdm colorama beautifulsoup4 unidecode
    
  3. Install btfs, fzf, and Jackett by following their respective installation instructions.

  4. Configure Jackett and obtain the API key.

  5. Create a configuration file named btstrm.conf in the ~/.config directory with the following content:

    [DEFAULT]
    LANG = es-ES
    JACKETT_API_KEY = your_jackett_api_key
    JACKETT_URL = http://127.0.0.1:9117
    

    Replace your_jackett_api_key with your actual Jackett API key and adjust the JACKETT_URL if necessary.

    You can omit this step because btstrm creates configuration file automatically.

Usage

To use btstrm, run the following command:

python btstrm.py [options] [URI]

Options:

  • -p PLAYER, --player PLAYER: Specify the media player to use for streaming (default: auto-detect)
  • -k, --keep: Keep the downloaded files after streaming (default: delete files)
  • -i, --impd: Add the downloaded files to impd playlist (default: disabled)
  • -s [MOVIE_NAME], --subtitles [MOVIE_NAME]: Search opensubtitles for subs with optional name title
  • -t TITLE, --title TITLE: Search for alternative movie titles and select using fzf

URI:

  • Video/audio content name, magnet link or torrent file

Examples:

python btstrm.py -p mpv -k magnet:?xt=urn:btih:example
python btstrm.py -t "Movie Title"
python btstrm.py "Big Buck Bunny"

Configuration

The btstrm.conf file allows you to customize the following settings:

  • LANG: Set the language code for TMDB searches (default: es-ES)
  • JACKETT_API_KEY: Set your Jackett API key
  • JACKETT_URL: Set the URL of your Jackett server (default: http://127.0.0.1:9117)

Contributing

Contributions to btstrm are welcome! If you find any bugs, have feature requests, or want to contribute improvements, please open an issue or submit a pull request on the GitHub repository.

Acknowledgements

btstrm was inspired by the need for a simple and efficient way to stream torrents from the command line. It wouldn't have been possible without the following projects and some codebase from developers:

Disclaimer

Please note that streaming copyrighted content without permission is illegal in many jurisdictions. The authors of btstrm do not condone or encourage the illegal use of this software. Use it responsibly and respect the rights of content creators.

Release files for btstrm 0.1.7

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

Source distribution (sdist)

Source distribution for btstrm 0.1.7
File Size Uploaded
btstrm-0.1.7.tar.gz 23.8 kB Details

Built distribution (wheel)

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

Total release size:46.2 kB

Release files / btstrm-0.1.7.tar.gz

Download URL btstrm-0.1.7.tar.gz
Size 23.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d8c424cc05b5dbf7d9d29e2d72530b879725b6050d1a409d875e8e7922755ded
BLAKE2b-256 checksum
How to use checksums
a8fb9d3c52794de789d863bb2b1a6f9046339201c7dbcf5604913d3d4250417a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / btstrm-0.1.7-py3-none-any.whl

Download URL btstrm-0.1.7-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0e3803706897f6cf5f8707b18a51c968beb9320890ca5873cac1a6dff929c06
BLAKE2b-256 checksum
How to use checksums
cb42c9b4f5f54b1cb3065941722566e6c8295939d9afb7c055eaa89f522b6dfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.4

2 release files

0.1.0

2 release files

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