Skip to content

acorbe/torrentparse

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What

Parse a torrent file (bdecode) in Python without any 3rd party libraries and provide methods to access the following attributes

  • tracker url,
  • creation date,
  • name of the client that created the torrent, and
  • for each file in the torrent ** name, length and checksum of the file (getting checksum is not implemented yet)

Why

I was asked to write this as part of an interview process.

How

Resources that I used to understand Torrent file structure:

Example

The following stream of characters in the torrent file "d8:announce33:http://jip.cs.vu.nl:6969/announce13:creation datei1147934820e4:infod6:lengthi445866736e4:name24:Elephants_Dream_1024.avi12:piece lengthi262144e6:pieces34020:"

is transformed into {'creation date': 1147934820, 'announce': 'http://jip.cs.vu.nl:6969/announce', 'info': {'length': 44 5866736, 'piece length': 262144, 'name': 'Elephants_Dream_1024.avi', 'pieces':

Existing implementations

About

An exercise in parsing bittorrent files (bdecode) in Python that I did for an interview

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%