Skip to content

Add native SponsorBlock integration#49

Draft
grohit1810 wants to merge 377 commits into
Tonwalter888:mainfrom
grohit1810:feature/add-sponsorblock
Draft

Add native SponsorBlock integration#49
grohit1810 wants to merge 377 commits into
Tonwalter888: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

@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

Tonwalter888 commented May 2, 2026

Copy link
Copy Markdown
Owner

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

@grohit1810

grohit1810 commented May 2, 2026

Copy link
Copy Markdown
Author

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

grohit1810 commented May 2, 2026

Copy link
Copy Markdown
Author

@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

grohit1810 commented May 6, 2026

Copy link
Copy Markdown
Author

@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

@grohit1810 Okey then.

@grohit1810

Copy link
Copy Markdown
Author

@Tonwalter888 Found the issue with full screen. I will fix this as well in my next commit

@Tonwalter888

Copy link
Copy Markdown
Owner

@Tonwalter888 Found the issue with full screen. I will fix this as well in my next commit

Alright, I will add more features after you pushed your fix.

@Tonwalter888

Copy link
Copy Markdown
Owner

@grohit1810 The back button stays black in dark mode.
IMG_3606
IMG_3607

@grohit1810

Copy link
Copy Markdown
Author

@Tonwalter888 Fixed all three issues
image (1)
image

I will fix the back button stays not visible in dark mode in the next commit.
It's the OLED theme overriding nav bar tint color, should be a quick fix. I'll do it tomorrow

@Tonwalter888

Tonwalter888 commented May 7, 2026

Copy link
Copy Markdown
Owner

@grohit1810 Lastly, can you use the dialog for downloading? Replace the HUD toast with our dialog. (Replace the skip icon to a check and a cross (x) for errors)

@Tonwalter888

Tonwalter888 commented May 7, 2026

Copy link
Copy Markdown
Owner

@grohit1810
I think you should filp this icon to go back.
IMG_3613
And it looks like the skip dialog doesn’t apply the waiting time from the settings.
IMG_3614

@grohit1810

Copy link
Copy Markdown
Author

@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

@NeonKokoro

Copy link
Copy Markdown

Known issue I discovered: The Shorts download button does not pull up the download manager.

@Tonwalter888

Copy link
Copy Markdown
Owner

Known issue I discovered: The Shorts download button does not pull up the download manager.

Yep, I know.

@Tonwalter888

Copy link
Copy Markdown
Owner

Known issue I discovered: The Shorts download button does not pull up the download manager.

Fixed.

@NeonKokoro

Copy link
Copy Markdown

But we're not done yet with 2.0.0. We still have to move the download manager button and bug fixes, just to name a few.

@Tonwalter888

Copy link
Copy Markdown
Owner

But we're not done yet with 2.0.0. We still have to move the download manager button and bug fixes, just to name a few.

The download button is moved to the player overlay.

@NeonKokoro

Copy link
Copy Markdown

However one thing that bothers me about the SponsorBlock is the skip delay/cooldown after a segment has been skipped.

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

5 participants