Monday 21 November 2016

Trying to execute an exe file (youtube-dl.exe) through code, but I keep getting the same error. What am I doing wrong?

I'm trying to use youtube-dl through nodejs. I successfully used it through the command line on windows with the following command:youtube-dl [link to soundcloud song]But when doing it through nodejs, I first had to set its read/write permissionsfs.chmodSync('youtube-dl.exe', 0777);From there, I've tried bothrequire('child_process').execandrequire('child_process').execFileand for both I get the following errorError: Command failed: /app/youtube-dl.exe http://ift.tt/2fkOEWp: 1: /app/youtube-dl.exe: MZ����@���: not found/app/youtube-dl.exe: 2: /app/youtube-dl.exe: $��}ŶHŶHŶH�+�HǶH�+�HĶH�+�HǶH�΀H¶HŶH��H�+�H߶H�+�HĶH�+�HĶH�+�HĶHRichŶHPELOzFT�: not found/app/youtube-dl.exe: 3: /app/youtube-dl.exe: Syntax error: ")" unexpectedDoes anyone recognize this error?Thanks!

Submitted November 21, 2016 at 07:08PM by Pandassaurus

No comments:

Post a Comment