aboutsummaryrefslogtreecommitdiff
path: root/scripts/ytdlp_flatten.ts
blob: 6a3eb5e6cea170e55f7f2acc73acc82e0b0d01af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const ws = new WebSocket(Deno.args[0])

ws.onerror = () => console.error("ws error")
ws.onclose = () => console.error("ws closed")
ws.onopen = () => {
    console.log("ws open");
    ws.send(JSON.stringify({ t: "register", name: "yt-dlp playlist flattener", sources: ["ytdlp-flatten"] }))
    ws.send(JSON.stringify({ t: "accept" }))
}
ws.onmessage = ev => {
    console.log(ev.data);
}