Code Monkey home page Code Monkey logo

node-youtube's People

Contributors

javascipt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-youtube's Issues

Probably bug

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.

Useful trick

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.