Open download-chrome-video in Script Kit

// Name: Download Chrome Video
// Description: Downloads the video of the current Chrome page
// Author: John Lindquist
// Twitter: @johnlindquist
// REQUIRES https://formulae.brew.sh/formula/youtube-dl
import "@johnlindquist/kit"
import Stream from "stream"
let writeableStream = new Stream.Writable()
writeableStream._write = (chunk, encoding, next) => {
console.log(chunk.toString().trim())
next()
}
cd(await path())
let url = await getActiveTab()
setChoices(null)
setDescription(`Downloading ${url}...`)
setInput(``)
setPlaceholder(`Please wait...`)
exec(`/opt/homebrew/bin/youtube-dl ${url}`, {all: true}).all.pipe(writeableStream)