npm.io
1.0.2 • Published 6 years ago

saveytbvideo

Licence
ISC
Version
1.0.2
Deps
5
Size
8 kB
Vulns
0
Weekly
0

exports.download = async (req, res, next) => {

try {
    let id = '2MoGxae-zyo'; //id of youtube video
    let saveYtbVideo = new SaveYtbVideo(id);
    saveYtbVideo.path = './public';  //path to store video
    // saveYtbVideo.saveVideo()
    const [error, result] = await to(saveYtbVideo.saveVideo({
        splits: [
            {startTime: 37, duration: 806}
        ]
    }));

} catch (err) {
    next(err);
}

}