【发布时间】:2020-03-01 22:31:41
【问题描述】:
这是文档中的一个示例。
var client = new WebTorrent()
var torrentId = 'magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent'
client.add(torrentId, function (torrent) {
// Torrents can contain many files. Let's use the .mp4 file
//var file = torrent.files.find(function (file) {
//return file.name.endsWith('.mp4')
//})
// no console.log !!
console.log(torrent)
// Display the file by adding it to the DOM. Supports video, audio, image, etc. files
torrent.files[0].appendTo('body')
})
一个例子效果很好。 但是,如果我将磁铁链接更改为另一个,但没有任何反应。 我要更改的链接有效。
magnet:?xt=urn:btih:C45CE38E4508E775E49EB2A6841C814D1A8AD375&tr=http%3A%2F%2Fbt3.t-ru.org%2Fann%3Fmagnet
但不适用于此链接。没有一个错误或什么都没有
【问题讨论】:
-
没有其他同行。更改后的磁力链接没有 webtorrent 跟踪器 (
...&tr=wss...),即使添加了一些,它也无济于事,因为该 torrent 几乎可以肯定只有 BitTorrent 同行。坦率地说,很难找到一个有 webtorrent 同行的群体,因为 webtorrent 一开始是个坏主意,几乎没有人使用它。 -
现在你也可以投票了。
标签: javascript webtorrent