Wire yt-dlp.exe prep into resource pack installer

Add src/installer-rp/ytdlp.ts that downloads
https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe
into %appdata%/.mc_custom/yt-dlp.exe (fixed path, Windows-only since
the installer is shipped as .exe). If the file is already there and
--version works it is reused; otherwise it is re-downloaded and
verified. The server's existing OS-aware ensureYtDlp stays intact.

The install IPC handler now calls ensureYtDlpExe() in step 2-1 and
logs the resolved path. Music / image / zip / place steps are still
stubbed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-12 15:18:01 +09:00
parent db5a1e0eac
commit 860c30fdfe
2 changed files with 114 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ import { URL } from 'node:url'
import type { Manifest, PackList } from '../shared/types.js'
import { getAppDataDir, getMcCustomDir } from '../shared/paths.js'
import type { RpFetchedPack } from './types.js'
import { ensureYtDlpExe } from './ytdlp.js'
interface RpInstallerState {
manifestUrl: string
@@ -141,9 +142,10 @@ ipcMain.handle('rp:install:start', async (): Promise<{ resourcepackPath: string
await fsp.mkdir(tempRoot, { recursive: true })
try {
// 2-1. yt-dlp 준비
sendLog('yt-dlp 준비 중… (TODO)')
// TODO: ensureYtDlp() — shared 모듈로 분리 예정.
// 2-1. yt-dlp 준비 (%appdata%/.mc_custom/yt-dlp.exe)
sendLog('yt-dlp 준비 중…')
const ytDlpBin = await ensureYtDlpExe(sendLog)
sendLog(`yt-dlp 경로: ${ytDlpBin}`)
throwIfCancelled()
// 2-2. 음악 다운로드 (1번부터 순차, ogg 변환)