feat: bundle yt-dlp and ffmpeg Linux binaries in bin/
Adds precompiled Linux x86_64 binaries for yt-dlp and ffmpeg under bin/. The processor resolves yt-dlp from bin/ when present, falling back to PATH. ffmpeg is passed via --ffmpeg-location so yt-dlp uses the bundled binary on o2switch. BIN_DIR is configurable via env var. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { existsSync } from 'fs'
|
||||
import path from 'path'
|
||||
import { config } from '../../config/app.config'
|
||||
|
||||
@@ -16,6 +17,11 @@ export function buildYtdlpArgs(params: YtdlpParams): string[] {
|
||||
|
||||
const args: string[] = ['--no-playlist', '-o', outputTemplate]
|
||||
|
||||
const ffmpegBin = path.join(config.BIN_DIR, 'ffmpeg')
|
||||
if (existsSync(ffmpegBin)) {
|
||||
args.push('--ffmpeg-location', ffmpegBin)
|
||||
}
|
||||
|
||||
if (quality !== 'best') {
|
||||
const height = quality.replace('p', '')
|
||||
args.push('-f', `${format}[height<=?${height}]+bestaudio/best[height<=?${height}]`)
|
||||
|
||||
Reference in New Issue
Block a user