Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
youtube-dl partial response from nodejs to PHP #16705
Comments
|
Parse output and send where ever you want. |
|
how to Parse output? |
|
Read doc on your language. This is not a general programming forum. |
Video Down-loader using youtube-dl nodejs and PHP
I am developing Video downloader in which i post data in PHP and then PHP post it using AJAX on node-js endpoint and code of that endpoint is
`routerUser.route("/video").post(function(req,res){
var t='video';
req.body.type=t;
if(req.body.type=='video'){
var urli=req.body.url;
var randnumber = Math.floor((Math.random() * 99000000000) );
console.log('hello Video source is '+urli);
//var urli ="'http://www.facebook.com/video.php?v="+req.body+"'";
//var name = shell.exec("youtube-dl "+urli+" --get-filename",{silent:true,async:false}).stdout;
//shell.exec('youtube-dl -o '+'/var/www/html/ssdfdf.mp4 '+urli, {async: true, silent: false}, function(data){
shell.exec("youtube-dl --get-title "+urli, {async: true, silent: false}, function(data,next){
shell.exec('youtube-dl -o '+'/var/www/html/"'+next+'.mp4" '+urli, {async: true, silent: true}, function(da){
console.log('data coming from the given is '+da);
//sendingdata.pipe(data);
/*
shell.exec('youtube-dl --get-thumbnail '+urli, {async: true, silent: false}, function(img){
});//end of thumbnail
*/
})
res.json({'sucesss':true,'data':next,'link':urli,'random':randnumber});
var generat='http://extendgen.ml/public/'+req.body+'.mp4';
// db("video").create({"name":name,"url":generat,"type":req.body.type,"username":req.body.username}).exec(function(err,data){
// });
//res.json({"status":"success","data":generat});
});`
Now i want to send partial response from nodejs to PHP to show % of video downloaded Help me?