A module for interfacing with a YouTube accounts latest upload. Either use globally through your command line or use at the module level. Available via npm.
Prerequisites: Node v4.0.0
$ npm install -g latestvid
Usage: latestvid [OPTIONS]
Open/download the most recent video from any YouTube account.
Options:
-h --help Display this help dialog
-v --version Display current version
-d --download Download latest video instead of opening
-u --user YouTube username
Example:
$ latestvid -u marquesbrownlee # open latest MKBHD video
$ latestvid -u marquesbrownlee -d # download latest MKBHD video
see ./examples for example implementation
$ npm install -S latestvid
const latestvid = require('latestvid');
// to open video
latestvid.getLatest('marquesbrownlee')
.then(url => {
console.log(url);
return latestvid.openUrl(url);
})
.catch(e => {
return console.error(e.message);
});
// to download video
latestvid.getLatest('marquesbrownlee')
.then(url => {
console.log(url);
return latestvid.downloadVideo(url);
})
.catch(e => {
return console.error(e.message);
});Feel free to open an issue or make a pull request!
Idea inspired by last-last-week.
