GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - hollowness-inside/bencode-python: Library used for encoding and decoding .torrent files

BranchesTags
Open more actions menu

Latest commit

 

History

17 Commits
17 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
bencode.py
bencode.py
 
 
example.torrent
example.torrent
 
 
example_decoding.py
example_decoding.py
 
 
example_encoding.py
example_encoding.py
 
 

Repository files navigation

bencode-python

Library used Encoding and Decoding .torrent files

Encoding

Running encoding over

["This is a string", 1923, b'What else could be done?', {'perfect': 'world', 'sun': 'passion', 'a': 0, 'animals': ['cat', 'dog'], b'raw': 'meat'}]

as a result, will give

l16:This is a stringi1923e24:What else could be done?d7:perfect5:world3:sun7:passion1:ai0e7:animalsl3:cat3:doge3:raw4:meatee

Decoding

Decoding a torrent file returns

OrderedDict([(b'announce', b'udp://tracker.leechers-paradise.org:6969'),
             (b'announce-list',
              [[b'udp://tracker.leechers-paradise.org:6969'],
               [b'udp://tracker.coppersurfer.tk:6969'],
               [b'udp://tracker.opentrackr.org:1337'],
               [b'udp://explodie.org:6969'],
               [b'udp://tracker.empire-js.us:1337'],
               [b'wss://tracker.btorrent.xyz'],
               [b'wss://tracker.openwebtorrent.com'],
               [b'wss://tracker.fastcast.nz']]),
             (b'comment', b'WebTorrent <https://webtorrent.io>'),
             (b'created by', b'WebTorrent <https://webtorrent.io>'),
             (b'creation date', 1490916601),
             (b'encoding', b'UTF-8'),
             (b'info',
              OrderedDict([(b'files',
                            [OrderedDict([(b'length', 140),
                                          (b'path',
                                           [b'Big Buck Bunny.en.srt'])]),
                             OrderedDict([(b'length', 276134947),
                                          (b'path', [b'Big Buck Bunny.mp4'])]),
                             OrderedDict([(b'length', 310380),
                                          (b'path', [b'poster.jpg'])])]),
                           (b'name', b'Big Buck Bunny'),
                           (b'piece length', 262144),
                           (b'pieces', b'Replaced for demonstration purposes')])),
             (b'url-list', [b'https://webtorrent.io/torrents/'])])

About

Library used for encoding and decoding .torrent files

Topics

bencodebencode-encoderbencode-parserbencodingpythonpython-3python3torrenttorrent-files

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.