Giter Club home page Giter Club logo

torrentclient_py's Introduction

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contact
  5. References

About The Project

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

I wanted to make a straightforward program to learn how does BitTorrent protocol works.

It is written with python 3.8, 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.

With this torrent client, 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
  • Will add Wireshark debugging soon.

    Built With

    Python

    Getting Started

    Prerequisites

    1. Python
    2. Knowledge of TCP/UDP protocols
    3. Asynchronous programming
    4. Peer to Peer networks

    Installation

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

    pip3 install -r requirements.txt
    Note:This is not applicable on Windows

    Usage

    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: python3 main.py

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

    Contributing

    Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

    1. Fork the Project
    2. Create your Feature Branch (git checkout -b feature/Torrent-Client)
    3. Commit your Changes (git commit -m 'Add some features')
    4. Push to the Branch (git push origin feature/Torrent-Client)
    5. Open a Pull Request

    References

    1.http://allenkim67.github.io/programming/2016/05/04/how-to-make-your-own-bittorrent-client.html
    2.http://www.kristenwidman.com/blog/33/how-to-write-a-bittorrent-client-part-1/
    3.https://github.com/lita/bittorrent
    4.https://wiki.theory.org/BitTorrentSpecification

    torrentclient_py's People

    Contributors

    naman027 avatar

    Watchers

     avatar  avatar

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google โค๏ธ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.