如何使用java从磁力链接创建torrent文件? [英] How to create torrent file from magnet link using java?
问题描述
所以我想开发一个新的Java项目,将磁体URI转换成.torrent文件,但是我找不到办法,基本上我把磁铁URI分成几块:
So I wanted to work on a new Java project that converts magnet URIs into .torrent files, however I can't find a way to do that, basically I broke a magnet URI into pieces :
使用的URI:
magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36&dn=Leaves+of+Grass+by+Walt+Whitman.epub&tr=udp%3A%2F%2Ftracker.example4.com%3A80&tr=udp%3A%2F%2Ftracker.example5.com%3A80&tr=udp%3A%2F%2Ftracker.example3.com%3A6969&tr=udp%3A%2F%2Ftracker.example2.com%3A80&tr=udp%3A%2F%2Ftracker.example1.com%3A1337
分解:
磁铁:?
magnet:?
xt = urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36
xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36
dn = + + + + + + + + Walt + Whitman .epub
dn=Leaves+of+Grass+by+Walt+Whitman.epub
tr = udp%3A%2F%2Ftracker.example4.com%3A80
tr=udp%3A%2F%2Ftracker.example4.com%3A80
tr = udp %3A%2F%2Ftracker.example5.com%3A80
tr=udp%3A%2F%2Ftracker.example5.com%3A80
tr = udp%3A%2F%2Ftracker.example3.com%3A6969
tr=udp%3A%2F%2Ftracker.example3.com%3A6969
tr = udp%3A%2F%2Ftracker.example2.com%3A80
tr=udp%3A%2F%2Ftracker.example2.com%3A80
tr = udp%3A %2F%2Ftracker.example1.com%3A1337
tr=udp%3A%2F%2Ftracker.example1.com%3A1337
来自我收集的此链接,torrent文件包含所需文件的文件,长度和路径,但我似乎无法从磁体URI获取。
from what I gathered using this link, The torrent file contains the files , lengths and paths of the required files but I can't seem to get that from the magnet URI.
提前致谢。
推荐答案
重建不可能仅来自磁铁链接的.torrent文件。
It's impossible to recreate the .torrent file from the magnet link alone.
torrent客户从磁力链接获取.torrent文件的方式是:
The way torrent clients gets the .torrent file from a magnet link is:
- 从跟踪器和/或DHT获取对等列表。
- 使用
BEP9 - 对等方发送元数据文件的扩展。
- Get a peer list from the tracker(s) and/or from the DHT.
- Connect to peers and download the .torrent metadata using
BEP9 - Extension for Peers to Send Metadata Files.
这篇关于如何使用java从磁力链接创建torrent文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!