从元数据或torrent文件获取torrent标题

时间:2011-07-06 01:32:53

标签: metadata bittorrent dht info-hash

是否可以从DHT加载的元数据或从某些服务器(如TPB)下载的文件中提取torrent标题?任何语言都可以使用api,lib

3 个答案:

答案 0 :(得分:2)

使用python,您可以使用bencode.py模块

轻松阅读/编辑种子文件

示例:

>>> import bencode
>>> rawdata = open('foo.torrent').read()
>>> bencode.bdecode(rawdata)
{'announce': 'http://cbbatracker.appspot.com/announce',
 'comment': 'HOTD for testing purposes',
 'created by': 'Transmission/2.04 (11151)',
 'creation date': 1292094068,
 'encoding': 'UTF-8',
 'info': {'length': 262212441,
          'name': '[SnF] Highschool of the Dead 02 [285FB2DA].mp4',
          'piece length': 131072,
          'pieces': '...lot of binary data...',
          'private': 0}}

答案 1 :(得分:0)

是的,这是可能的。很多开源的torrent软件都使用libtorrent库。 它以C ++语言提供

libtorrent

答案 2 :(得分:0)

您必须更具体地了解实际的含义。如果你从图元文件中找到“info.name”,那么任何语言的任何bencode模块都会让它变得相当简单。

相关问题