fix "error: no such option"

This commit is contained in:
Lamp 2023-01-23 14:48:37 -06:00
parent cbf7dd0d83
commit 7eed0d6eb7
2 changed files with 3 additions and 3 deletions

4
web.js

@ -6,8 +6,8 @@ var fs = require("fs");
var app = express();
var server = http.createServer(app);
try { fs.unlinkSync("web.sock") } catch (e) {}
server.listen("web.sock");
//try { fs.unlinkSync("web.sock") } catch (e) {}
server.listen(8024, "127.0.0.1");
app.use(morgan(`:date[iso] :req[cf-connecting-ip] :method :url ":req[user-agent]" :referrer`));
app.use(express.static('.'), serveIndex('.', {'icons': true}));

2
wss.js

@ -18,7 +18,7 @@ wss.on("connection", function(ws, req) {
if (!ytid) { ws.send(color("red", "youtube url not valid")); ws.close(); return }
ws.send(color("green", "spawning yt-dlp..."));
var cp = child_process.spawn("yt-dlp", ["--format=mp4", "--max-filesize=1G", `--match-filter=duration<7200`, "--no-mtime", ytid], {cwd: "v", shell: false});
var cp = child_process.spawn("yt-dlp", ["--format=mp4", "--max-filesize=1G", `--match-filter=duration<7200`, "--no-mtime", `https://www.youtube.com/watch?v=${ytid}`], {cwd: "v", shell: false});
cp.on("error", error => {
log(error.message, true);