简体   繁体   English

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

[英]Getting a torrent title from metadata or torrent file

Is it possible to extract the torrent title from the meta data loaded from DHT or the file downloaded from some server like TPB?是否可以从从 DHT 加载的元数据或从 TPB 等服务器下载的文件中提取 torrent 标题? any api,lib any language would do任何 api,lib 任何语言都可以

Using python you can easily read/edit a torrent file using bencode.py module使用python您可以使用bencode.py模块轻松读取/编辑 torrent 文件

Example:例子:

>>> 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}}

yes it's possible.是的,这是可能的。 Lot of open source torrent softwares use the libtorrent library.许多开源 torrent 软件都使用 libtorrent 库。 It's available in C++ langage它可用于 C++ 语言

libtorrent libtorrent

You have to be more specific what you actually mean.您必须更具体地说明您的实际意思。 If you meant "info.name" from the metafile, then any bencode module for any language makes that rather easy.如果您的意思是元文件中的“info.name”,那么任何语言的任何 bencode 模块都会使这变得相当容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM