diff --git a/index.js b/index.js index 7fdbf84..75eb45c 100644 --- a/index.js +++ b/index.js @@ -17,7 +17,7 @@ function searchYoutube(q, limit, response) { q = escape(`ytsearch${limit}:${q}`); const command = `set -o pipefail; ${cmd} -j ${q} | jq "{id,title}" | jq -s .`; - require("child_process").exec(command, {shell:"/bin/bash"}, (error, stdout, stderr) => { + require("child_process").exec(command, {shell:"bash"}, (error, stdout, stderr) => { if (error) { console.log("error", error); response.writeHead(500); @@ -36,6 +36,7 @@ function downloadYoutube(id, response) { let args = [ "-f", "bestaudio", "-o", `${__dirname}/_youtube/%(title)s-%(id)s.%(ext)s`, + "--", id ] let child = require("child_process").spawn(cmd, args);