All Projects → borzunov → Bit Torrent

borzunov / Bit Torrent

Licence: mit
📁 🌎 BitTorrent client built with Python + asyncio

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Bit Torrent

Bittorrent Dht
🕸 Simple, robust, BitTorrent DHT implementation
Stars: ✭ 1,004 (+804.5%)
Mutual labels:  torrent, bittorrent
Antcolony
Nodejs实现的一个磁力链接爬虫 http://findit.keenwon.com (原域名http://findit.so )
Stars: ✭ 1,151 (+936.94%)
Mutual labels:  torrent, bittorrent
Javatorrent
BitTorrent Protocol implementation in Java
Stars: ✭ 43 (-61.26%)
Mutual labels:  torrent, bittorrent
Biglybt
Feature-filled Bittorrent client based on the Azureus open source project
Stars: ✭ 672 (+505.41%)
Mutual labels:  torrent, bittorrent
Aria2.sh
Aria2 一键安装管理脚本 增强版
Stars: ✭ 1,276 (+1049.55%)
Mutual labels:  torrent, bittorrent
Trackerslistcollection
🎈 Updated daily! A list of popular BitTorrent Trackers! / 每天更新!全网热门 BT Tracker 列表!
Stars: ✭ 9,761 (+8693.69%)
Mutual labels:  torrent, bittorrent
Bittorrent Peerid
Map a BitTorrent peer ID to a human-readable client name and version
Stars: ✭ 47 (-57.66%)
Mutual labels:  torrent, bittorrent
Webtorrent Hybrid
WebTorrent (with WebRTC support in Node.js)
Stars: ✭ 422 (+280.18%)
Mutual labels:  torrent, bittorrent
Fragments
Moved to GNOME GitLab -> https://gitlab.gnome.org/haecker-felix/Fragments
Stars: ✭ 80 (-27.93%)
Mutual labels:  torrent, bittorrent
Bittorrent Tracker
🌊 Simple, robust, BitTorrent tracker (client & server) implementation
Stars: ✭ 1,184 (+966.67%)
Mutual labels:  torrent, bittorrent
Rain
🌧 BitTorrent client and library in Go
Stars: ✭ 574 (+417.12%)
Mutual labels:  torrent, bittorrent
Whitewash Torrent
为了对付河蟹,洗白你的种子!
Stars: ✭ 95 (-14.41%)
Mutual labels:  torrent, bittorrent
Radarr
A fork of Sonarr to work with movies à la Couchpotato.
Stars: ✭ 5,707 (+5041.44%)
Mutual labels:  torrent, bittorrent
Monotorrent
The official repository for MonoTorrent, a bittorrent library for .NET
Stars: ✭ 809 (+628.83%)
Mutual labels:  torrent, bittorrent
Webtorrent
⚡️ Streaming torrent client for the web
Stars: ✭ 25,554 (+22921.62%)
Mutual labels:  torrent, bittorrent
Rats Search
BitTorrent P2P multi-platform search engine for Desktop and Web servers with integrated torrent client.
Stars: ✭ 1,037 (+834.23%)
Mutual labels:  torrent, bittorrent
Btpd
⚡ The BitTorrent Protocol Daemon
Stars: ✭ 365 (+228.83%)
Mutual labels:  torrent, bittorrent
Torrent
Full-featured BitTorrent client package and utilities
Stars: ✭ 4,138 (+3627.93%)
Mutual labels:  torrent, bittorrent
Peerflix Server
Streaming torrent client for Node.js with web ui.
Stars: ✭ 1,157 (+942.34%)
Mutual labels:  torrent, bittorrent
Unit3d Community Edition
🚀 A Next Generation Private Torrent Tracker (Community Edition)
Stars: ✭ 1,305 (+1075.68%)
Mutual labels:  torrent, bittorrent

bit-torrent

Simple BitTorrent client built with Python's asyncio

Main window screenshot

Features

  • Downloading torrents and sharing received data
  • Graphical interface (supports Drag'n'Drop and can be assigned to *.torrent files in system "Open with..." dialog)
  • Console interface
  • Pausing torrents, watching progress, download and upload speed, ETA
  • Selecting which files in a torrent you want to download
  • Saving state between program restarts

Implemented specifications:

Architecture

In this project, I tried to avoid threads and use only asynchronous I/O. As a result, all algorithms and network interaction work in one thread running an asyncio event loop, but there are still a few additional threads:

  • Non-blocking disk I/O isn't supported by asyncio. To prevent freezes for up to a second during disk writing, blocking I/O runs in a ThreadPoolExecutor.
  • PyQt GUI runs in the main thread and invokes an asyncio event loop in a separate QThread. Another option is to use a Qt event loop in asyncio with quamash, but this increases UI reaction time, and the Qt event loop may be less efficient than asyncio's default one.

Program sources depend on Python 3.5+ features: they are annotated with type hints (PEP 0484) and use coroutines with async/await syntax (PEP 0492).

Installation

The program requires Python 3.5+ and works on Linux, macOS, and Windows. You also need PyQt 5 to run GUI.

On Ubuntu 16.04 or newer, run:

sudo apt-get install python3-pip python3-pyqt5
git clone https://github.com/borzunov/bit-torrent.git && cd bit-torrent
sudo python3 -m pip install -r requirements.txt

On macOS, run:

python3 -m pip install PyQt5
git clone https://github.com/borzunov/bit-torrent.git && cd bit-torrent
python3 -m pip install -r requirements.txt

Usage

Graphical interface

Run:

python3 torrent_gui.py

If torrent files are provided as command line arguments, corresponding adding dialogs will be opened.

Console interface

  1. Start a daemon:

     python3 torrent_cli.py start &
    
  2. (optional) Look at a list of files in a torrent you want to download:

     python3 torrent_cli.py show ~/Torrents/debian-8.3.0-i386-netinst.iso.torrent
    
  3. Specify a download directory and add the torrent to the daemon:

     python3 torrent_cli.py add ~/Torrents/debian-8.3.0-i386-netinst.iso.torrent -d ~/Downloads
    

    If the torrent contains more than one file, you can select which files you want to download using --include and --exclude options. For more information run:

     python3 torrent_cli.py add --help
    
  4. Watch torrent status:

     watch python3 torrent_cli.py status
    

    Add -v to increase output verbosity.

    You also can add more torrents, pause, resume, and remove them. For more information run:

     python3 torrent_cli.py --help
    
  5. To stop the daemon run:

     python3 torrent_cli.py stop
    

    The daemon will restore its state after restart.

Debug mode

You can enable a verbose debug mode for GUI and CLI daemons by adding --debug flag after the script name.

You may also want to enable asyncio debug mode. This is done as follows:

PYTHONASYNCIODEBUG=1 python3 -Wdefault torrent_gui.py --debug

Author

Copyright © 2016-2017 Alexander Borzunov

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].