SHARE
TWEET

download.js

a guest Dec 1st, 2019 25 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const WebTorrent = require('webtorrent');
  2.  
  3. global.WEBTORRENT_ANNOUNCE = [];
  4.  
  5. const client = new WebTorrent();
  6.  
  7. client.on('error', (err) => {
  8.     console.error(`fatalError ${err.message || err}`);
  9.     process.exit(1);
  10. });
  11.  
  12. client.add(process.argv[2], {
  13.     path: './',
  14. }, torrent => {
  15.     torrent.on('warning', function (err) {
  16.         console.warn(err);
  17.     });
  18.     torrent.on('error', function (err) {
  19.         console.error(err);
  20.     });
  21.  
  22.     console.log('client.seed done', {
  23.         magnetURI: torrent.magnetURI,
  24.         ready: torrent.ready,
  25.         paused: torrent.paused,
  26.         done: torrent.done,
  27.     });
  28. });
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. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top