Several media players will do that in the background for you, 'mpv' and 'vlc' come to mind. 'mpv' even has a sponsorblock script that will skip the sponsored segments if you so chose.
I occasionally use this for convenience, even though I pay for YT Premium.