Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

youtube-dl partial response from nodejs to PHP #16705

Closed
Muzaffar-Munir opened this issue Jun 12, 2018 · 3 comments
Closed

youtube-dl partial response from nodejs to PHP #16705

Muzaffar-Munir opened this issue Jun 12, 2018 · 3 comments

Comments

@Muzaffar-Munir
Copy link

@Muzaffar-Munir Muzaffar-Munir commented Jun 12, 2018

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){

	console.log('response sent from '+next+'image'+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?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 12, 2018

Parse output and send where ever you want.

@dstftw dstftw closed this Jun 12, 2018
@Muzaffar-Munir
Copy link
Author

@Muzaffar-Munir Muzaffar-Munir commented Jun 12, 2018

how to Parse output?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 12, 2018

Read doc on your language. This is not a general programming forum.

@ytdl-org ytdl-org locked as off topic and limited conversation to collaborators Jun 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.