![](/img/trans.png)
[英]Generate a torrent/magnet link from a single file in a torrent collection
[英]Getting a torrent title from metadata or torrent file
是否可以從從 DHT 加載的元數據或從 TPB 等服務器下載的文件中提取 torrent 標題? 任何 api,lib 任何語言都可以
使用python
您可以使用bencode.py模塊輕松讀取/編輯 torrent 文件
例子:
>>> 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}}
是的,這是可能的。 許多開源 torrent 軟件都使用 libtorrent 庫。 它可用於 C++ 語言
您必須更具體地說明您的實際意思。 如果您的意思是元文件中的“info.name”,那么任何語言的任何 bencode 模塊都會使這變得相當容易。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.