M5 DONE — SponsorBlock auto-skip wired + verified on the TV

SponsorBlockMonitor (xbmc.Monitor subclass) attaches after setResolvedUrl:
- fetches segments from sidecar via the existing sponsorblock op
  (SHA-256 prefix lookup, defaults to sponsor + selfpromo + interaction
  categories)
- waits up to 30s for playback to actually start, then polls
  Player.getTime() every 0.5s
- when position enters a skip segment, calls seekTime(end) and shows
  a 'SponsorBlock — Skipped <category> (<duration>s)' toast
- UUIDs are remembered so a manual rewind into a previously-skipped
  segment doesn't trigger again
- exits cleanly on playback stop or Kodi shutdown

Live-verified on the LibreELEC Pi with LTT 2T8x5antlnc ('Trump Phone'),
which has two locked sponsor segments. Sought to 1:45, the monitor
fired at 108.3s and seeked to 128.4s — log line:

  [torttube] sponsorblock skip: sponsor 108.3-128.4 (20s)

addon.xml v0.0.1 → v0.0.2.

Deferred for v0.0.3+: settings.xml category toggles + a skip-counter,
support for non-skip action types (mute, full, poi).
This commit is contained in:
Sulkta 2026-05-23 10:23:07 -07:00
parent 2020035373
commit 6d07ed16fa
3 changed files with 102 additions and 6 deletions

View file

@ -41,12 +41,16 @@
- [ ] playlist browse → `{"op":"playlist","id":"…"}`
- [ ] result thumbnails + duration + uploader
## M5 — SponsorBlock skipping
## M5 — SponsorBlock skipping [DONE]
- [ ] background thread on `Player()` polls position
- [ ] when position enters a skip segment → `xbmc.Player().seekTime(end)`
- [ ] toast on skip + skip-counter in settings
- [ ] category toggles in `settings.xml`
- [x] `SponsorBlockMonitor` (xbmc.Monitor subclass) polls `Player().getTime()`
every 0.5s after playback starts; seeks past each segment exactly
once (UUID dedup); exits cleanly on abort or playback stop
- [x] toast on skip (`SponsorBlock — Skipped <category> (<duration>s)`)
- [x] only segments with `actionType: skip` are honored (mute/etc. ignored
for now — adding those is a multi-pass M5+ pass)
- [ ] category toggles + skip-counter in settings.xml (deferred — defaults
currently: sponsor, selfpromo, interaction skipped automatically)
## M6 — install + cross-compile [DONE]