SHARE
TWEET
seed.js
a guest
Dec 1st, 2019
91
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- const WebTorrent = require('webtorrent');
- global.WEBTORRENT_ANNOUNCE = [];
- const client = new WebTorrent();
- client.on('error', (err) => {
- console.error(`fatalError ${err.message || err}`);
- process.exit(1);
- });
- client.seed('/mnt/data/share/test.mp4', {
- announce: [
- 'http://192.168.1.44:8000/announce',
- ],
- }, torrent => {
- torrent.on('warning', function (err) {
- console.warn(err);
- });
- torrent.on('error', function (err) {
- console.error(err);
- });
- console.log('client.seed done', {
- magnetURI: torrent.magnetURI,
- ready: torrent.ready,
- paused: torrent.paused,
- done: torrent.done,
- });
- });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
