Skip to content

Add native SponsorBlock integration#49

Open
grohit1810 wants to merge 40 commits intoTonwalter888:mainfrom
grohit1810:feature/add-sponsorblock
Open

Add native SponsorBlock integration#49
grohit1810 wants to merge 40 commits intoTonwalter888:mainfrom
grohit1810:feature/add-sponsorblock

Conversation

@grohit1810
Copy link
Copy Markdown

Summary

Adds built-in SponsorBlock support to YouMod, implementing all 9 segment categories with configurable per-category actions. This is a native implementation (not a bundled iSponsorBlock dylib), making it easier to maintain and extending support to include the Highlight (poi_highlight) category that iSponsorBlock lacks.

Resolves #34

Features

  • Full SponsorBlock API integration (sponsor.ajay.app)
  • 9 segment categories: Sponsor, Intro, Endcards, Interaction, Self-promotion, Non-music, Preview, Highlight, Filler
  • Per-category action modes: Disable, Auto-skip, Ask before skipping, Display on seek bar only, Skip-to (for Highlights)
  • Colored seek bar markers showing segment positions on the progress bar
  • Skip notification banner with Unskip button (auto-dismisses after configurable duration)
  • Ask mode with persistent Skip/Dismiss banner for manual-skip categories
  • Highlight support — skip TO the key moment (poi_highlight), not past it
  • Player overlay toggle button (shield icon) to enable/disable SponsorBlock per video
  • Full settings page with per-category controls and 12 color presets
  • Haptic feedback option on skip
  • In-memory segment caching per session (no redundant API calls)

Architecture

File Purpose
Files/SponsorBlock.x Core logic — API requests, segment model, skip engine
Files/SponsorBlockUI.x UI — notification banner, seek bar markers, overlay button
Files/SponsorBlockSettings.x Full settings page with per-category action/color pickers

Implements built-in SponsorBlock with all 9 segment categories,
per-category skip modes, seek bar markers, skip notification
banners, and a full settings page.

- API integration with sponsor.ajay.app
- Categories: sponsor, intro, outro, interaction, selfpromo,
  music_offtopic, preview, poi_highlight (highlight), filler
- Per-category actions: disable, auto-skip, ask, display, skip-to
- Colored seek bar markers on the progress bar
- Skip notification banner with unskip button
- Player overlay toggle button (shield icon)
- Full settings page with color presets per category
- Backward compatible across YouTube 16.x-21.x
- No external dependencies

Resolves Tonwalter888#34
@Tonwalter888
Copy link
Copy Markdown
Owner

Can you send me a screenshot about the skip banner? I want to see what it looks like.

@grohit1810
Copy link
Copy Markdown
Author

Here are screenshots and a screen capture video. Let me know if it looks good
image (2)
image (1)
image

ScreenRecording_05-02-2026.04-46-50_1.mp4

@Tonwalter888
Copy link
Copy Markdown
Owner

Tonwalter888 commented May 2, 2026

Can you trigger a skip dialog and send a screenshot here?
EDIT: The dialog that are asking you to skip or not.

@grohit1810
Copy link
Copy Markdown
Author

grohit1810 commented May 2, 2026

Note: This is a v1 implementation focused on getting all the core functionality working. Known limitations that I plan to address later(in a follow up PR):

  • Seek bar markers are currently rendered as a separate overlay above the progress bar. The next version will render them inline on the progress bar track itself (matching how YTLite does it).
  • Color picker currently uses 12 preset colors. A follow-up will add a full color picker with custom hex input.
  • Channel whitelisting (disable SponsorBlock for specific creators) is not yet implemented.

All core SponsorBlock functionality is complete and working — skipping, notifications, per-category settings, overlay toggle, and highlight support.

@grohit1810
Copy link
Copy Markdown
Author

Here is screenshot of skip dialog
image (3)

Settings Page:
image (4)

@Tonwalter888
Copy link
Copy Markdown
Owner

One more thing, can you do a long press on the miniplayer to see what happens?

@grohit1810
Copy link
Copy Markdown
Author

One more thing, can you do a long press on the miniplayer to see what happens?

Nothing happens on long press of the miniplayer. Video continues to play normally

@Tonwalter888
Copy link
Copy Markdown
Owner

@grohit1810 Nevermind, I tested it. The dialog is too small compares to YTLite. But a lot of things need to implement here.

  • Adds a skip dialog for highlight
  • Use built-in ColorPicker for segments colors
  • Make the segments height = YouTube's seekbar (Maybe you can use some codes from iSponsorBlock)

grohit1810 added 2 commits May 2, 2026 14:45
- Add skip dialog for highlight segments (jump-to-highlight banner)
- Use built-in UIColorPickerViewController for segment colors
- Match segment marker height to YouTube's seekbar (iSponsorBlock approach)
- Redesign settings page with UIMenu action pickers, duration sliders,
  and rainbow color circles matching YTLite's UI
- Fix unskip re-skip bug and notification timing
Keep both upstream's new additions (YTSingleVideoController, gesture
defines, ambient removal) and our SponsorBlock declarations.
@grohit1810
Copy link
Copy Markdown
Author

grohit1810 commented May 2, 2026

@Tonwalter888 Updated the PR with all the requested changes

  • Skip dialog for highlight — shows a "Jump to highlight" banner when a highlight segment is available
  • Built-in ColorPicker — uses native iOS UIColorPicker for segment colors
  • Segment markers match YouTube's seekbar height — uses iSponsorBlock's approach with reference decoration views
  • Redesigned settings page — matches the UI of SponsorBlock settings page with YTLite SponsorBlock settings page

@Tonwalter888
Copy link
Copy Markdown
Owner

@grohit1810 Can you make the skip dialog like in YTLite?
IMG_3568

@Tonwalter888
Copy link
Copy Markdown
Owner

@grohit1810 Actually, can you use system UI settings (like this Sponsorblock) for all settings? YouTube’s settings are unstable and glichy.

@grohit1810
Copy link
Copy Markdown
Author

@Tonwalter888 For the system UI settings rewrite do you want that in this same PR, or should I open a separate one? It's a bigger change that touches the entire settings flow, so wanted to check.

Also just a heads up: I am writing and understanding the code myself (not fully AI generated), so my turnaround will be slower

@Tonwalter888
Copy link
Copy Markdown
Owner

@Tonwalter888 For the system UI settings rewrite do you want that in this same PR, or should I open a separate one? It's a bigger change that touches the entire settings flow, so wanted to check.

Also just a heads up: I am writing and understanding the code myself (not fully AI generated), so my turnaround will be slower

You can do on this PR. Just rewrite like the SponsorBlock you wrote, that's all I wanted. (Inside the sections)

@grohit1810
Copy link
Copy Markdown
Author

@Tonwalter888 Update the PR with both the changes

  • Skip dialog redesigned to match YTLite Style - Pill shaped pop up with progress depletion and fully interactable
  • Settings rewritten with system UIKit - same layout and sections as before.

@Tonwalter888
Copy link
Copy Markdown
Owner

@Tonwalter888 Update the PR with both the changes

  • Skip dialog redesigned to match YTLite Style - Pill shaped pop up with progress depletion and fully interactable

  • Settings rewritten with system UIKit - same layout and sections as before.

Will test this, thanks for implementing them.

@Tonwalter888
Copy link
Copy Markdown
Owner

@grohit1810 I think there are some missing SponsorBlock segments.
And the dialog is hidden in fullscreen, I think you should move the dialog on top of the screen.
IMG_3591
IMG_3592
Also, can you use a slider for default tab bar? I implemented it before.
a512d99

@Tonwalter888
Copy link
Copy Markdown
Owner

Also adds a skip dialog for hightlight

@Tonwalter888
Copy link
Copy Markdown
Owner

@grohit1810 Also makes the button hidden with the overlay.
IMG_3599

@Tonwalter888
Copy link
Copy Markdown
Owner

@grohit1810 I will add the new features in v1.4.0 in here.

@grohit1810
Copy link
Copy Markdown
Author

grohit1810 commented May 6, 2026

@Tonwalter888 I am not sure why you are not able to see the new pill shaped button in fullscreen mode?
I am able to see skip dialog to highlight and also in fullscreen.

I have the fix other two issues - Slider bar and hide sponsorblock button overlay
I will test it and push it

@Tonwalter888
Copy link
Copy Markdown
Owner

@Tonwalter888 I will fix all three issues - back button, not adhering to the wait times and the black back button

I will also add my dialog to the downloading toast

Thanks!

@Tonwalter888
Copy link
Copy Markdown
Owner

@grohit1810 Can you make the background dialog less transparent (or fully no transparent like the YTLite's dialog) ?

@Tonwalter888
Copy link
Copy Markdown
Owner

I noticed one thing, the highlight dialog gets override if other segments are before that. Can you make the highlight dialog always shows on top unless you are changing the video?

@grohit1810
Copy link
Copy Markdown
Author

I noticed one thing, the highlight dialog gets override if other segments are before that. Can you make the highlight dialog always shows on top unless you are changing the video?

@grohit1810 Can you make the background dialog less transparent (or fully no transparent like the YTLite's dialog) ?

I'll take a look

@Tonwalter888 Tonwalter888 force-pushed the feature/add-sponsorblock branch from f1af423 to b15697d Compare May 8, 2026 17:12
@Tonwalter888 Tonwalter888 mentioned this pull request May 8, 2026
4 tasks
@grohit1810
Copy link
Copy Markdown
Author

@Tonwalter888 For the highlight dialog override issue, just to clarify: you want the "Highlight available. Jump to the point?" pill to never be dismissed by other SponsorBlock segment notifications (sponsor skip, intro skip, etc.)? So if a sponsor segment auto-skips while the highlight pill is showing, the highlight pill stays and the sponsor notification suppressed?

@Tonwalter888
Copy link
Copy Markdown
Owner

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add iSponsorBlock as optional build setting

2 participants