The Host-header check plus Sec-Fetch-Site/Origin filtering is a solid combination for a localhost API. One thing worth considering is that Sec-Fetch-Site is only sent by newer browsers, so for older ones the Origin check carries the load; requiring a per-launch random token (passed to the page at load and sent in a custom header) would also force a CORS preflight and cover the case where headers are missing. Also, since the app downloads and executes yt-dlp updates, it may be worth asking whether updates get the same pinned-hash or signature verification as the first-run bootstrap, because yt-dlp releases change constantly and a static hash won't fit. Checking the release's published SHA2-256SUMS (ideally verifying its signature) before swapping the binary would keep the update path as strict as setup. How are you handling rollback if a new yt-dlp version breaks extraction?