You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
626 B
HTML

<script src="/webtorrent.js"></script>
<div id="wtmedia">
</div>
<script>
const client = new WebTorrent(tracker=false,dht=true,webSeeds=true);
const magnetURI = '{{.Get 0}}';
client.add(magnetURI, function (torrent) {
// Got torrent metadata!
console.log('Client is downloading:', torrent.infoHash)
torrent.files.forEach(function (file) {
// Display the file by appending it to the DOM. Supports video, audio, images, and
// more. Specify a container element (CSS selector or reference to DOM node).
file.appendTo('#wtmedia')
})
})
</script>