Giter Club home page Giter Club logo

youtube-downloader-app's People

Contributors

eashish93 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

youtube-downloader-app's Issues

Not Finding /video

Forgive me if i'm missing something obvious here, however i'm having some issues setting this up and not sure if it's something my end or not.

When i submit a video, it's shows Not Found 404 after re-directing to /video.

NotFoundError: Not Found

at app.use.res.locals.message (/youtube/app.js:27:8)
at Layer.handle [as handle_request] (/youtube/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/youtube/node_modules/express/lib/router/index.js:317:13)
at /youtube/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/youtube/node_modules/express/lib/router/index.js:335:12)
at next (/youtube/node_modules/express/lib/router/index.js:275:10)
at /youtube/node_modules/express/lib/router/index.js:635:15
at next (/youtube/node_modules/express/lib/router/index.js:260:14)
at Function.handle (/youtube/node_modules/express/lib/router/index.js:174:3)
at router (/youtube/node_modules/express/lib/router/index.js:47:12)

Here is my Index,js

var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Express' });
});

module.exports = router;

// default endpoint
router.get('/', function(req, res) {
  res.render('index', { title: 'Youtube Downloader'$
// new endpoint
});
router.post('/video', function(req, res, next) {
  res.render('listvideo', {});
})

// ... other code

// utility function to convert bytes to human reada$
function bytesToSize(bytes) {
   var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
   if (bytes == 0) return '0 Byte';
   var i = parseInt(Math.floor(Math.log(bytes) / Ma$
   return Math.round(bytes / Math.pow(1024, i), 2) $
};

var ytdl = require('youtube-dl');
router.post('/video', function(req, res, next) {
    var url = req.body.url,
        formats = [];

    ytdl.getInfo(url, ['--youtube-skip-dash-manifes$
        if(err) return res.render('listvideo', {err$

        // push all video formats for download (ski$
        info.formats.forEach(function(item) {
            if(item.format_note !== 'DASH audio' &&$
                item.filesize = item.filesize ? byt$
                formats.push(item);
            }
        });
        res.render('listvideo', {meta: {id: info.id$
    })

})

Thanks

router.get('/', function(req, res) { ^ ReferenceError: router is not defined

router.get('/', function(req, res) {
^

ReferenceError: router is not defined
at Object. (C:\Users\jacky\Desktop\blue site\youtube\routes\index.js:2:1)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (C:\Users\jacky\Desktop\blue site\youtube\app.js:7:19)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node ./bin/www
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start 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! C:\Users\jacky\AppData\Roaming\npm-cache_logs\2020-10-07T17_52_56_078Z-debug.log

Error after get links button pressed

After pasting the link in textbox and pressing get links encountered an error.

internal/child_process.js:325
throw errnoException(err, 'spawn');
^

Error: spawn UNKNOWN
at _errnoException (util.js:1041:11)
at ChildProcess.spawn (internal/child_process.js:325:11)
at exports.spawn (child_process.js:493:9)
at exports.execFile (child_process.js:208:15)
at call (C:\Users\user\Desktop\ndejs\youtube-downloader-app-master\node_modules\youtube-dl\lib\youtube-dl.js:163:5)
at Function.getInfo (C:\Users\user\Desktop\ndejs\youtube-downloader-app-master\node_modules\youtube-dl\lib\youtube-dl.js:285:5)
at Request._callback (C:\Users\user\Desktop\ndejs\youtube-downloader-app-master\routes\index.js:28:18)
at Request.self.callback (C:\Users\user\Desktop\ndejs\youtube-downloader-app-master\node_modules\request\request.js:186:22)
at emitTwo (events.js:125:13)
at Request.emit (events.js:213:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node ./bin/www
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

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.