server-youtube: strip Zone.Identifier ADS on Windows after download

NTFS marks files downloaded over HTTP with a Zone.Identifier alternate
data stream, which SmartScreen/Attachment Manager can use to block
execution of yt-dlp.exe. Remove the ADS best-effort after each
download to reduce one likely cause of "execution verification failed"
in the user-reported failure.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 16:29:27 +09:00
parent b769f453a3
commit 8c9dc88e8b

View File

@@ -91,6 +91,10 @@ async function prepareYtDlp(target: string): Promise<string> {
await downloadToFile(url, target)
if (process.platform !== 'win32') {
await fs.chmod(target, 0o755)
} else {
// Windows: 인터넷에서 받은 파일에는 NTFS ADS 'Zone.Identifier' 가 붙어
// SmartScreen/Attachment Manager 가 실행을 막을 수 있다. 베스트에포트로 제거.
try { await fs.unlink(`${target}:Zone.Identifier`) } catch { /* noop */ }
}
const probe = await probeVersion(target)
if (probe.ok) return target