mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
20 lines
548 B
JavaScript
20 lines
548 B
JavaScript
import fs from "node:fs"
|
|
import os from "node:os"
|
|
import axios from "axios"
|
|
|
|
export default async (outputDir) => {
|
|
const arch = os.arch()
|
|
|
|
console.log(`Downloading ffmpeg for ${arch}...`)
|
|
const baseURL = `https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-${arch}-static.tar.xz`
|
|
|
|
|
|
const response = await axios.get(baseURL, {
|
|
responseType: "stream"
|
|
})
|
|
|
|
const ffmpegPath = path.join(outputDir, `ffmpeg-${arch}.tar.xz`)
|
|
const ffmpegFile = fs.createWriteStream(ffmpegPath)
|
|
|
|
response.data.pipe(ffmpegFile)
|
|
} |