Comments (5)
There is no easy way to do this as of now. The only way you can do it is as follows -
var mtd = require('mt-downloader');
var url = 'https://upload.wikimedia.org/wikipedia/commons/4/47/Gadget_the_pug_expressive_eyes.jpg';
var file = './Gadget_the_pug_expressive_eyes.jpg';
var downloader = new mtd(file, url, {
onStart: function (data) {
data.threads.each(function(i){
i.destroy();
});
}
});
downloader.start();
I hope this helps. I would be glad to merge a pull request which would make it easier.
from multi-threaded-downloader.
It seems quite easy, just what I needed.
Thanks !
from multi-threaded-downloader.
Is it safe to just destroy the threads? I implemented your proposal and sometimes I get a corrupted mtd file, which cannot be resumed.
from multi-threaded-downloader.
I think you should send a destroy event to the thread
Sent from Mail.Ru app for iOS
Thursday 14 January 2016 18:24 +0300 from [email protected] [email protected]:
Is it safe to just destroy the threads? I implemented your proposal and sometimes I get a corrupted mtd file, which cannot be resumed.
—
Reply to this email directly or view it on GitHub .
from multi-threaded-downloader.
Yes, that's what I do. But my question is if it is safe do to so? Because sometimes I get corrupted mtd file, which can not be resumed...
from multi-threaded-downloader.
Related Issues (20)
- Download Fails
- Support chunked downloads (Failure Error: File size could not be determined) HOT 8
- Error on CLI HOT 1
- simple example on how to download/pause/resume a chunked download HOT 3
- Error: The .mtd file is corrupt. Start a new download?? HOT 3
- Calling DownloadFromMTDFile on a file already complete results in error HOT 1
- basic auth in options? HOT 6
- How can I do to get the file fast HOT 3
- Action required: Greenkeeper could not be activated 🚨
- Resume does not work in Windows HOT 1
- Problem With Files Downloaded In Windows HOT 2
- download m4a file has issue in windows HOT 2
- Implementing ProgressBar with progress update HOT 1
- Complete and exit long after
- Save downloaded file in HTML5 Filesystem HOT 1
- Example Usage on ReadMe.md HOT 5
- createDownload is not a function.....
- Can't stop the download
- Switch from npm/request to something supported (node-fetch?) HOT 1
- Live Version Here
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multi-threaded-downloader.