项目作者: gromnitsky

项目描述 :
View .torrent files; JSON export/import
高级语言: Ruby
项目地址: git://github.com/gromnitsky/bencview.git
创建时间: 2010-12-31T13:34:13Z
项目社区:https://github.com/gromnitsky/bencview

开源协议:

下载


bencview

bencview - a .torrent files viewer for terminal pagers.\
json2bencode - a converter from JSON to the torrent files format.

(Bencode is a data serialization format used by the BitTorrent network.)

Installation

(Ruby 2.3.0+)

  1. $ gem install bencview

Add to your lesspipe.sh:

  1. case "$1" in
  2. ...
  3. *.torrent) bencview "$1" ;;
  4. ...
  5. esac

Optionally:

  1. $ npm -g i json

Usage

View a torrent file:

  1. $ bencview gimp.torrent
  2. *info-hash: a85b7e7f035c55f684238d0e252b273fe2a1ccf5
  3. *uri: magnet:?xt=urn:btih:a85b7e7f035c55f684238d0e252b273fe2a1ccf5&dn=gimp-2.8.14-setup-1.exe
  4. announce: udp://tracker.publicbt.com:80
  5. announce-list: 2
  6. udp://tracker.publicbt.com:80
  7. udp://tracker.openbittorrent.com:80
  8. comment: GIMP 2.8.14 Installer for Microsoft Windows - updated
  9. created by: mktorrent 1.0
  10. creation date: Tue, 2 Sep 2014 22:05:50 +0000
  11. url-list: 34
  12. http://gimper.net/downloads/pub/gimp/v2.8/windows
  13. http://gimp.afri.cc/pub/gimp/v2.8/windows
  14. [...]
  15. info/name: gimp-2.8.14-setup-1.exe
  16. info/pieces: 351 x 262,144
  17. info/files: 1
  18. 91,931,728 gimp-2.8.14-setup-1.exe
  19. info/*files size: 91,931,728

Properties prefixed w/ ‘*’ don’t exist in the torrent file.

Remove all trackers from it:

  1. $ bencview -j gimp.torrent | json -e 'delete this.announce; delete this["announce-list"]' | json2bencode > file.torrent
  2. $ file file.torrent
  3. file.torrent: BitTorrent file
  4. $ bencview file.torrent
  5. *info-hash: a85b7e7f035c55f684238d0e252b273fe2a1ccf5
  6. *uri: magnet:?xt=urn:btih:a85b7e7f035c55f684238d0e252b273fe2a1ccf5&dn=gimp-2.8.14-setup-1.exe
  7. comment: GIMP 2.8.14 Installer for Microsoft Windows - updated
  8. created by: mktorrent 1.0
  9. creation date: Tue, 2 Sep 2014 22:05:50 +0000
  10. url-list: 34
  11. http://gimper.net/downloads/pub/gimp/v2.8/windows
  12. http://gimp.afri.cc/pub/gimp/v2.8/windows
  13. [...]
  14. info/name: gimp-2.8.14-setup-1.exe
  15. info/pieces: 351 x 262,144
  16. info/files: 1
  17. 91,931,728 gimp-2.8.14-setup-1.exe
  18. info/*files size: 91,931,728

Note that the infohash hasn’t changed.

History

This is a complete rewrite of the original
bencview-0.0.x. bencview_clean util is gone, for bencview can
export torrent files into JSON.

1.0.0 version is also ~2 times smaller.

Bugs

  • Both utils assume the UTF8 locale.

License

MIT.