fork download
  1. dragDrop('.drag-torrent', (files) => {
  2.  
  3. this.errors = [];
  4. files.forEach(function(file){
  5. client.add(file, { path : "/files/"});
  6. });
  7.  
  8. client.on('error', function(err) {
  9. console.log(err);
  10. this.errors.push("Cannot add duplicate torrent");
  11. })
  12. });
  13. client.on("torrent", function(torrent){
  14. console.log(torrent);
  15.  
  16. torrent.on("done", function(){ //не работает тк сделали add а не seed
  17. console.log('torrent finished downloading')
  18. torrent.files.forEach(function(file){
  19. // console.log(file);
  20. })
  21. })
  22. torrent.files.forEach(function(file){
  23.  
  24. client.seed(torrent.path + file.path);
  25.  
  26. })
  27.  
  28.  
  29. })
  30.  
Runtime error #stdin #stdout #stderr 0s 171392KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.js:1:6 ReferenceError: dragDrop is not defined