Skip to content

downloadYtDlpVerified throws on cached older binaries — checksum fetched from latest release #73

Description

@chirag127

Problem

downloadYtDlpVerified() fails with "Checksum mismatch" for legitimate cached binaries after any new yt-dlp release.

Steps

  1. await downloadYtDlp() — caches yt-dlp v1 in bin/.
  2. yt-dlp publishes v2 upstream (happens ~weekly).
  3. await downloadYtDlpVerified() — throws.

Expected

Either re-download when checksum mismatches, or fetch checksum for the cached binary's actual version.

Actual

Error: Checksum mismatch for yt-dlp.exe. Expected <v2-hash>, got <v1-hash>

Root cause

src/utils/ytdlp.ts:47-49downloadYtDlp() returns early if file exists (no version check). src/utils/ytdlp.ts:96downloadYtDlpVerified() then fetches SHA from releases/latest/download/SHA2-256SUMS, so the compare is v1-local vs v2-latest.

Environment

ytdlp-nodejs 3.4.2, Node >=16 per package.json engines.

Thanks for maintaining iqbal-rashed/ytdlp-nodejs!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions