All Projects → gallexis → Pytorrent

gallexis / Pytorrent

Simple and functional BitTorrent client made in Python - Use for learning

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pytorrent

Wt Tracker
High-performance WebTorrent tracker
Stars: ✭ 144 (+6.67%)
Mutual labels:  p2p, torrent, peer-to-peer, bittorrent
Cratetorrent
A BitTorrent V1 engine library for Rust (and currently Linux)
Stars: ✭ 233 (+72.59%)
Mutual labels:  p2p, torrent, peer-to-peer, bittorrent
Snail
基于Java、JavaFX开发的下载工具,支持下载协议:BT(BitTorrent、磁力链接、种子文件)、HLS(M3U8)、FTP、HTTP。人家才不要你的⭐⭐呢,哼
Stars: ✭ 102 (-24.44%)
Mutual labels:  p2p, torrent, bittorrent
Bittorrent Protocol
Simple, robust, BitTorrent peer wire protocol implementation
Stars: ✭ 279 (+106.67%)
Mutual labels:  p2p, torrent, bittorrent
Autodl Trackers
Tracker files for autodl-community fork of autodl-irssi
Stars: ✭ 133 (-1.48%)
Mutual labels:  p2p, torrent, bittorrent
torrent-spider
基于DHT的p2p网络资源爬虫
Stars: ✭ 65 (-51.85%)
Mutual labels:  torrent, bittorrent, p2p
autodl-rutorrent
ruTorrent plugin for autodl-community fork of autodl-irssi
Stars: ✭ 90 (-33.33%)
Mutual labels:  torrent, bittorrent, p2p
Torrentinim
A very low memory-footprint, self hosted API-only torrent search engine. Sonarr + Radarr Compatible, native support for Linux, Mac and Windows.
Stars: ✭ 123 (-8.89%)
Mutual labels:  p2p, torrent, bittorrent
Torrent Discovery
Discover BitTorrent and WebTorrent peers
Stars: ✭ 177 (+31.11%)
Mutual labels:  p2p, torrent, bittorrent
Webtorrent
⚡️ Streaming torrent client for the web
Stars: ✭ 25,554 (+18828.89%)
Mutual labels:  p2p, torrent, bittorrent
Torrent
Full-featured BitTorrent client package and utilities
Stars: ✭ 4,138 (+2965.19%)
Mutual labels:  p2p, torrent, bittorrent
Dfi
Peer-to-peer torrent indexing
Stars: ✭ 118 (-12.59%)
Mutual labels:  torrent, peer-to-peer, bittorrent
Magnetissimo
Web application that indexes all popular torrent sites, and saves it to the local database.
Stars: ✭ 2,551 (+1789.63%)
Mutual labels:  p2p, torrent, bittorrent
Diffy
🎞️💓🍿 Love streaming - It's always best to watch a movie together ! 🤗
Stars: ✭ 37 (-72.59%)
Mutual labels:  torrent, bittorrent, p2p
Transgui
🧲 A feature rich cross platform Transmission BitTorrent client. Faster and has more functionality than the built-in web GUI.
Stars: ✭ 2,488 (+1742.96%)
Mutual labels:  p2p, torrent, bittorrent
Autodl Irssi
A community-driven fork of autodl-irssi
Stars: ✭ 315 (+133.33%)
Mutual labels:  p2p, torrent, bittorrent
Bittorrent Dht
🕸 Simple, robust, BitTorrent DHT implementation
Stars: ✭ 1,004 (+643.7%)
Mutual labels:  p2p, torrent, bittorrent
Bt
BitTorrent library and client with DHT, magnet links, encryption and more
Stars: ✭ 2,011 (+1389.63%)
Mutual labels:  p2p, torrent, bittorrent
Dottorrent Gui
An advanced GUI torrent file creator with batch functionality, powered by PyQt and dottorrent
Stars: ✭ 175 (+29.63%)
Mutual labels:  p2p, torrent, bittorrent
Zeronet
ZeroNet - Decentralized websites using Bitcoin crypto and BitTorrent network
Stars: ✭ 17,227 (+12660.74%)
Mutual labels:  p2p, torrent, bittorrent

PyTorrent - Python BitTorrent

PyTorrent is a CLI tool that downloads files from the BitTorrent network.

I wanted to make my own functional and straightforward program to learn how does BitTorrent protocol work and improve my python skills.

It is almost written from scratch with python 3.7, only the pubsub library was used to create events when a new peer is connected, or when data is received from a peer. You first need to wait for the program to connect to some peers first, then it starts downloading.

This tool needs a lot of improvements, but it does its job, you can :

  • Read a torrent file
  • Scrape udp or http trackers
  • Connect to peers
  • Ask them for the blocks you want
  • Save a block in RAM, and when a piece is completed and checked, write the data into your hard drive
  • Deal with the one-file or multi-files torrents
  • Leech or Seed to other peers

But you can’t :

  • Download more than one torrent at a time
  • Benefit of a good algorithm to ask your peers for blocks (code of rarest piece algo is implemented but not used yet)
  • Pause and resume download

Don't hesitate to ask me questions if you need help, or send me a pull request for new features or improvements.

Installation

You can run the following command to install the dependencies using pip

pip install -r requirements.txt

💥 Because it's using the "select" function, this code will not be able to run on Windows: python-select-on-windows

Running the program

If you want to specify a torrent file, you need to edit it manually in the main.py file:

self.torrent = Torrent.Torrent("path_to_your_torrent") 

Then simply run: python main.py

The files will be downloaded in the same path as your main.py script.

Sources :

I wouldn't have gone that far without the help of Lita, Kristen Widman's & the Bittorrent Unofficial Spec, so thank you.

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].