simplyahmazing / battorrent Goto Github PK
View Code? Open in Web Editor NEWA Bittorrent Client written using Python Asyncio
A Bittorrent Client written using Python Asyncio
I am trying to make a similar client but i just realized this client is only going to work for single file torrents.
The whole torrent, regardless of the number of files, is divided into pieces.
Now in the case of a single file torrent, the number of pieces can be calculated by taking the size of the metaData[b'info'][b'length'] key and divide it by piece length and then take the ceil of it for the last, smaller piece.
But in case of the multiple files, the pieces are still dividing the whole torrent regardless of the number of files.
But correct me if i am wrong, wouldn't you calculate the number of pieces for each file and not the whole torrent. Current implementation would write multiple files to a single file where some blocks would have some data from previous and other data from the next file.
Am i missing something here ?
Also, if i was to implement this, should i consider the files in the order that is given in the metadata[b'info'][b'files'] to calculate pieces for each file ?
@SimplyAhmazing Great work by the way.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.