diff --git a/README.md b/README.md index 567bef2..37dc587 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,6 @@ I also made a [pure Javascript youtube downloading module](https://github.com/fe If you're only interested in downloading only from youtube, you should consider using the other module. -NO LONGER ACTIVELY SUPPORTED BY ME. - -I don't want to support this anymore, as I have to keep track with the latest youtube-dl, its changes, its workings with other extractors. It's hard to debug, I'd rather not do it. If you like this project and would like to maintain it, feel free to open an issue asking. - # Usage ## Downloading videos @@ -79,6 +75,12 @@ video.on('info', function(info) { video.pipe(fs.createWriteStream('myvideo.mp4', { flags: 'a' })); +// Will be called if download was already completed and there is nothing more to download. +video.on('complete', function complete(info) { + 'use strict'; + console.log('filename: ' + info._filename + ' already downloaded.'); +}); + video.on('end', function() { console.log('finished downloading!'); }); @@ -97,7 +99,7 @@ size: 5109213 ``` ``` -[jay@macpro ~/nodejs/node-youtube-dl/example]$ node resume.js +[jay@macpro ~/nodejs/node-youtube-dl/example]$ node resume.js Download started filename: 1 1 1-179MiZSibco.mp4 size: 5109213 diff --git a/example/extractors.js b/example/extractors.js index 914f8e7..c8d97cd 100644 --- a/example/extractors.js +++ b/example/extractors.js @@ -1,7 +1,7 @@ var ytdl = require('..'); ytdl.getExtractors(true, function getExtractors(err, list) { - 'use strict'; + 'use strict'; console.log('Found ' + list.length + ' extractors'); var show = 4; diff --git a/example/resume.js b/example/resume.js index deb20bd..c1c34b3 100644 --- a/example/resume.js +++ b/example/resume.js @@ -35,6 +35,12 @@ video.on('info', function(info) { video.pipe(fs.createWriteStream('myvideo.mp4', {flags: 'a'})); +// Will be called if download was already completed and there is nothing more to download. +video.on('complete', function complete(info) { + 'use strict'; + console.log('filename: ' + info._filename + ' already downloaded.'); +}); + video.on('end', function end() { 'use strict'; console.log('finished downloading!');