I guess if you get the length with yt-dlp, and then compare with the downloaded file, and the length is within a one second tolerance, it should be fine. At least I would think the length that yt-dlp extracts would not include the baked in ad, but of course youtube could make it so.
Btw I haven’t heard about this thing since it first came out. Is it really happening?