Код: Выделить всё
'webtorrent.min.js:16 Invalid asm.js: Unexpected tokenКод: Выделить всё
var videoURL = '';
console.log("1", videoURL);
var client = new WebTorrent();
console.log("2", videoURL);
var magnetURI = "magnet:?xt=urn:btih:645ff84f4020018984a5fe8b71b839a008502d1a";
console.log("3", videoURL);
client.on('error', function (err) {
console.log('client error:', err);
});
client.on('warning', function (err) {
console.log('warning:', err);
});
client.add(magnetURI, function (torrent) {
console.log("4", videoURL);
console.log("torrent add:", torrent.name);
var file = torrent.files.find(function (file) {
return file.name.endsWith('.mp4') || file.name.endsWith('.webm');
});
if (file) {
console.log("Find video:", file.name);
file.getBlobURL(function (err, url) {
if (err) {
console.error('error URL:', err);
return;
}
videoURL = url;
console.log("videoURL:", videoURL);
});
} else {
console.warn('File dont here.');
}
});
< /code>
Я попытался изменить версию Webtor, открыл локальные серверы с кодом прямо из доков Webtor, но ничего не работает. Я принимаю форму ссылки DLE дополнительные поля, используя анализатор, вся ссылка с магнитом выглядит так, как это
magnet:?xt=urn:btih:645ff84f4020018984a5fe8b71b839a008502d1a&dn=solncestoyanie_midsommar-2019-bdrip&tr=http://tracker.dler.org:6969/announce&tr=udp://tracker.opentrackr.org:1337 Подробнее здесь: https://stackoverflow.com/questions/795 ... hen-client