javascipt / node-youtube Goto Github PK
View Code? Open in Web Editor NEW:movie_camera: Youtube to snapshots and GIFs.
License: MIT License
:movie_camera: Youtube to snapshots and GIFs.
License: MIT License
Running this:
const Youtube = require('youtube.com');
var youtube = Youtube("https://www.youtube.com/watch?v=_W8ZGOKr1Po");
youtube.crop('0:05', '0:25', './file.mp4')
.then(function() {
console.log("Done");
}).catch(function(err) {
console.log("err : ", err)
});
Prompt me this:
[user@host twinbible] $ npm run-script build
> [email protected] build /home/user/Documentos/projects/dev/twinbible
> node ./bin/create-gifs
err : { Error: ENOENT: no such file or directory, open '/home/user/Documentos/projects/dev/twinbible/node_modules/youtube.com/tmp/crop-1511546819850.mp4'
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/home/user/Documentos/projects/dev/twinbible/node_modules/youtube.com/tmp/crop-1511546819850.mp4' }
(node:27611) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
(node:27611) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
(node:27611) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
fs.js:113
throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs
^
Error: ENOENT: no such file or directory, unlink '/home/user/Documentos/projects/dev/twinbible/node_modules/youtube.com/tmp/crop-1511546819850.mp4'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `node ./bin/create-gifs`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2017-11-24T18_07_03_215Z-debug.log
Node version: v8.4.0
I see that the module creates a file in the tmp, download the video, but after that he removes and prompt me the error.
Hello Khalid, thanks for this project. Im doing a similar software and i have a trick to share. You can use ffmpeg to download only the portion of the video that you need. Consider this example
const ytdl = require('youtube-dl')
const ffmpeg = require('fluent-ffmpeg')
let options = ['-f 18', '--get-url'];
let url = 'https://www.youtube.com/watch?v=zJ7hUvU-d2Q' // 6 hours long video
ytdl.getInfo(url, options, function(err, info) {
if (err) {
return
}
ffmpeg(info.url)
.seekInput('0:20:30') //work best with this format
.duration(20) //seconds
.save('outfile.mp4')
})
This helps to save a lot of time and bandwidth in large videos.
I hope this helps
PS: Sorry for my bad english
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.