Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kietcse/torrent-app
https://github.com/kietcse/torrent-app
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kietcse/torrent-app
- Owner: KietCSE
- Created: 2024-10-22T02:29:01.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-11-07T16:17:26.000Z (2 months ago)
- Last Synced: 2024-11-07T17:27:11.464Z (2 months ago)
- Language: Python
- Size: 39.9 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Torrent-app
Build a simple CLI torrent-app for P2P file sharing
## Available Commands:
-------------------------
- add : Publish your documents into network
- delete: Delete your published documents
- ls : List all your published documents
- seed: Start sharing your documents
- get: Start downloading documents
- peers: List all peers you are connecting
- scrape: Check currrent infomation of torrent network
- help : Display available commands
- clear : Clear the screen
- logout : Log out your account
- exit : Exit the program## Virtual environment setup and run project
Create venv
```sh
python -m venv venv
```
Active venv for window
```sh
venv\Scripts\activate
```
Active for Linux/MacOS
```sh
source venv/bin/activate
```
Install dependencies
```sh
pip install -r requirements.txt
```
Run project
```sh
python main.py
```
**Notice**: you need create a `.env` file with all variable in `.env.example` but with actual value, you also need a tracker server for everything go well## Project structure
```py
📦src
┣ 📄 .env.example # all environment variables in program
┣ 📄 add_delete_ls.py # add + delete + ls command
┣ 📄 auth.py # login + register command
┣ 📄 config.py # Load environment variable
┣ 📄 fetch_api.py # fetch + post + delete API function
┣ 📄 get_seed_peers.py # get + seed + peers commands
┣ 📄 scrape.py # scrape command
┣ 📄 show.py # show command
┣ 📄 upload.py # Upload algorithm
┣ 📄 download.py # download handler
┣ 📄 split.py # split, merge, get piece, save piece
┣ 📄 makeChoice.py # rarest first
┣ 📄 state.py # current state of peer
┣ 📄 requirement.txt # all libraries and version for this program
┗ 📜 main.py # main file to run program
```