{"action":"created","issue":{"url":"https://api.github.com/repos/fent/node-youtube-dl/issues/69","labels_url":"https://api.github.com/repos/fent/node-youtube-dl/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/fent/node-youtube-dl/issues/69/comments","events_url":"https://api.github.com/repos/fent/node-youtube-dl/issues/69/events","html_url":"https://github.com/fent/node-youtube-dl/issues/69","id":62384213,"number":69,"title":"Suggestion : spawn instead of execFile","user":{"login":"jonathanasquier","id":781447,"avatar_url":"https://avatars.githubusercontent.com/u/781447?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathanasquier","html_url":"https://github.com/jonathanasquier","followers_url":"https://api.github.com/users/jonathanasquier/followers","following_url":"https://api.github.com/users/jonathanasquier/following{/other_user}","gists_url":"https://api.github.com/users/jonathanasquier/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathanasquier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathanasquier/subscriptions","organizations_url":"https://api.github.com/users/jonathanasquier/orgs","repos_url":"https://api.github.com/users/jonathanasquier/repos","events_url":"https://api.github.com/users/jonathanasquier/events{/privacy}","received_events_url":"https://api.github.com/users/jonathanasquier/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-17T12:35:18Z","updated_at":"2015-03-24T11:14:08Z","closed_at":null,"body":"I use node-youtube-dl to display videos in an express app. After a few calls callbacks are not executed anymore (read someting about pipes being full).\r\nI made a very simple implementation with spawn that should have the same behaviour as execFile and that does not have the same issue:\r\n```\r\nvar spawn = require('child_process').spawn;\r\n\r\nvar getRessource = function(url, callback) {\r\n    var ytdl = spawn('youtube-dl', [url, '--get-url']),\r\n    error = null,\r\n    info = null;\r\n\tytdl.stdout.on('data', function(data) {\r\n\t\tinfo = data.toString();\r\n\t});\r\n\tytdl.stderr.on('data', function(data) {\r\n\t\terror = data.toString().slice(7);\r\n\t});\r\n\tytdl.on('exit', function(code) {\r\n\t\tcallback(error, info);\r\n\t});\r\n};\r\n```\r\nI believe it's worth giving a shot.\r\n\r\nNice work ;)"},"comment":{"url":"https://api.github.com/repos/fent/node-youtube-dl/issues/comments/85453551","html_url":"https://github.com/fent/node-youtube-dl/issues/69#issuecomment-85453551","issue_url":"https://api.github.com/repos/fent/node-youtube-dl/issues/69","id":85453551,"user":{"login":"jonathanasquier","id":781447,"avatar_url":"https://avatars.githubusercontent.com/u/781447?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathanasquier","html_url":"https://github.com/jonathanasquier","followers_url":"https://api.github.com/users/jonathanasquier/followers","following_url":"https://api.github.com/users/jonathanasquier/following{/other_user}","gists_url":"https://api.github.com/users/jonathanasquier/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathanasquier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathanasquier/subscriptions","organizations_url":"https://api.github.com/users/jonathanasquier/orgs","repos_url":"https://api.github.com/users/jonathanasquier/repos","events_url":"https://api.github.com/users/jonathanasquier/events{/privacy}","received_events_url":"https://api.github.com/users/jonathanasquier/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T11:14:08Z","updated_at":"2015-03-24T11:14:08Z","body":"I did too, with many more videos and it worked its hangs only when called\nin express\nLe 24 mars 2015 08:55, \"Roly Fentanes\" <notifications@github.com> a écrit :\n\n> I attempted to test this\n> https://gist.github.com/fent/49c6ea13304d663e979e\n>\n> but had no issues\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/fent/node-youtube-dl/issues/69#issuecomment-85386347>.\n>\n"}}