Commit Graph

2 Commits

Author SHA1 Message Date
25a809546e fix(setup): tolerate yt-dlp execve ENOENT on slim docker bases
문제: alpine/distroless 처럼 glibc 가 없는 도커 베이스 이미지에서는 PyInstaller
로 빌드된 yt-dlp_linux 의 동적 링커가 없어 execve 가 ENOENT 를 반환. 이전에는
npm run setup 이 통째로 실패해서 Docker 빌드를 차단했음.

수정:
- 다운로드는 됐지만 --version 검증이 실패하면 throw 하지 않고 안내만 출력 후
  계속 진행. 못 쓰는 바이너리는 unlink 해서 혼동 방지.
- SKIP_YT_DLP=1 환경변수로 다운로드 자체를 건너뛸 수 있게 추가.
- 도커/PATH 설치 가이드를 warn 으로 같이 노출 (apt/apk/pip 명령).
- README 외부 의존 섹션에도 slim base / SKIP_YT_DLP 안내 추가.

src/youtube.ts 의 PATH fallback 은 그대로라 시스템에 yt-dlp 가 설치돼 있으면
런타임에 자동으로 그것을 사용합니다.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 19:00:43 +09:00
cb9406d88e feat: npm run setup (yt-dlp + deps + build); lift upload size limit
scripts/setup.mjs runs `npm install`, downloads the platform-specific
yt-dlp binary from GitHub releases to ./bin/yt-dlp (which src/youtube.ts
already prefers), checks for ffmpeg and prints install hints, then runs
`tsc`. One command replaces three for fresh checkouts.

While verifying setup, hit `MulterError: File too large` (LIMIT_FILE_SIZE)
on a 10 GB mkv upload, and ETXTBSY on freshly downloaded yt-dlp.

- ETXTBSY: the redirect path in downloadFile opened a writestream to the
  destination before following the redirect, so the (unused) outer stream
  still held the file open when the post-download spawnSync ran. Split
  redirect-following from file writing so only the final 200 response
  opens the destination file.
- LIMIT_FILE_SIZE: removed the hard-coded 4 GB cap. Upload limit now
  defaults to Infinity and is configurable via UPLOAD_MAX_BYTES.
  Wrapped multer's middleware so its errors (LIMIT_FILE_SIZE etc.) come
  back as a clean 413 JSON instead of a stack trace from the global
  error handler.
- Also disabled Node's default 5 minute requestTimeout so 10 GB uploads
  over slow links don't get cut mid-stream. Configurable via
  HTTP_REQUEST_TIMEOUT_MS.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 17:13:47 +09:00