nichobi / sponsorblockcast

A shell script that skips sponsored YouTube content on all local Chromecasts
GNU General Public License v3.0
348 stars 15 forks source link

Skip Youtube ads when skip button appears #24

Closed joelspiers15 closed 2 years ago

joelspiers15 commented 2 years ago

When a skippable Youtube ad is playing the Chromecast's supportedMediaCommand field will indicate that the skip ad button is available. Google's docs aren't very helpful here but through trial and error I found the second bit being 0 indicates the skip button is up.

So you do a bitwise & with 0x2 (10) since the second bit is what we care about. If the result of that is a 0 the second bit was a 0 and you can skip the ad.

nichobi commented 2 years ago

Wow, I had no idea this was possible! Thank you very much for this great feature!