Hacker News new | ask | show | jobs
by WD-42 1315 days ago
That's why we have SponsorBlock: https://sponsor.ajay.app/ It even has an API that youtube-dlp uses to automatically trim out sponsored sections from downloaded videos!
1 comments

It's definitely useful - especially for yt-dlp - but I eventually had to turn it off due to the clipping being a bit wayward[1]. Often got videos where it'd clip 15-20s before the sponsor and 30s after which leads to horrible glitchy cuts. Or sometimes it would only cut out the middle 2m of a sponsor segment leading to, again, horrible glitchy cuts but with sponsorship. etc.etc.

[1] This may be because I was downloading things reasonably quickly after they went up - waiting a day or two might have got better results?

It probably is only cutting on the keyframes.

There's a flag to tell it to reencode up to and after the cuts, which would probably help a lot.

Yep - https://github.com/yt-dlp/yt-dlp/wiki/FAQ

>Video files cannot be cut at exact timestamps without re-encoding. yt-dlp does not re-encode the video by default, even when cutting is required. You can use --force-keyframes-at-cuts to force re-encoding; however, this process is slow - there is no way around this.

I'd probably rather just tell it to mark the sponsor segments as chapters and then skip them manually. I think it marks them by default.

Excellent, I shall try this out, thanks