Skip to content

Add native SponsorBlock integration - #49

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

Add native SponsorBlock integration#49
grohit1810 wants to merge 841 commits into
Tonwalter888:mainfrom
grohit1810:feature/add-sponsorblock

Conversation

@grohit1810

Copy link
Copy Markdown
Collaborator

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
Collaborator 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
Collaborator 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
Collaborator 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
Collaborator 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
Collaborator 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
Collaborator 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
Collaborator 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
Collaborator 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
Collaborator 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
Collaborator 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
Collaborator 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

@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 Hey, have you started working on the search fix?

@NeonKokoro

Copy link
Copy Markdown

image

And would you look at that, YouMod now has its own official logo.

@Tonwalter888
Tonwalter888 force-pushed the feature/add-sponsorblock branch from e1e9cbd to 4a8798a Compare August 1, 2026 18:30
@grohit1810

Copy link
Copy Markdown
Collaborator Author

@grohit1810 Hey, have you started working on the search fix?

Yes I have

@Tonwalter888
Tonwalter888 force-pushed the feature/add-sponsorblock branch from 1cf9759 to edfdb05 Compare August 2, 2026 06:29
@NeonKokoro

Copy link
Copy Markdown

crashed when tapping on YouMod Settings

-[UISearchController setCustomViewSize:]: unrecognized selector sent to instance 0x12a871e00
Call stack: (
0 CoreFoundation 0x00000001841befac 7CDBA4FD-E90E-3EF2-8AE3-9071648E4673 + 622508
1 YouTube 0x0000000115ef39c8 YouTube + 37370312
2 YouTube 0x0000000115ef2fa8 YouTube + 37367720
3 libobjc.A.dylib 0x0000000183f3c298 objc_exception_throw + 88
4 CoreFoundation 0x00000001842be478 7CDBA4FD-E90E-3EF2-8AE3-9071648E4673 + 1668216
5 UIKitCore 0x00000001895e1e20 8AC5E0AF-75BA-3416-AB91-BCD844AB4213 + 19488288
6 CoreFoundation 0x000000018417a784 7CDBA4FD-E90E-3EF2-8AE3-9071648E4673 + 341892
7 CoreFoundation 0x000000018417aa40 7CDBA4FD-E90E-3EF2-8AE3-9071648E4673 + 342592
8 YouTube 0x0000000113e8a134 YouTube + 3383604
9 YouTube 0x000000011777cf08 YouTube + 63098632
10 YouMod.dylib 0x0000000104ead7a8 sbSearchRows + 70440
11 UIKitCore 0x00000001883a42e8 8AC5E0AF-75BA-3416-AB91-BCD844AB4213 + 361192
12 UIKitCore 0x00000001883728e4 8AC5E0AF-75BA-3416-AB91-BCD844AB4213 + 157924
13 UIKitCore 0x0000000188b1f3a4 8AC5E0AF-75BA-3416-AB91-BCD844AB4213 + 8205220
14 UIKitCore 0x0000000188b1eafc 8AC5E0AF-75BA-3416-AB91-BCD844AB4213 + 8203004
15 UIKitCore 0x00000001885d19dc 8AC5E0AF-75BA-3416-AB91-BCD844AB4213 + 2644444
16 UIKitCore 0x000000018860f494 8AC5E0AF-75BA-3416-AB91-BCD844AB4213 + 2897044
17 UIKitCore 0x0000000188b1e850 8AC5E0AF-75BA-3416-AB91-BCD844AB4213 + 8202320
18 UIKitCore 0x0000000188357664 8AC5E0AF-75BA-3416-AB91-BCD844AB4213 + 46692
19 UIKitCore 0x0000000188356e98 _UIShouldLogTrackedState + 108
20 UIKitCore 0x00000001883557a8 8AC5E0AF-75BA-3416-AB91-BCD844AB4213 + 38824
21 QuartzCore 0x0000000187eed5b8 B46D97D1-9296-3D11-BD8E-FDFDE3A2469D + 62904
22 QuartzCore 0x0000000187eecbd4 B46D97D1-9296-3D11-BD8E-FDFDE3A2469D + 60372
23 QuartzCore 0x0000000187eec78c B46D97D1-9296-3D11-BD8E-FDFDE3A2469D + 59276
24 QuartzCore 0x0000000187effd00 B46D97D1-9296-3D11-BD8E-FDFDE3A2469D + 138496
25 QuartzCore 0x0000000187efc22c B46D97D1-9296-3D11-BD8E-FDFDE3A2469D + 123436
26 QuartzCore 0x0000000187efb624 B46D97D1-9296-3D11-BD8E-FDFDE3A2469D + 120356
27 QuartzCore 0x0000000187efbe7c B46D97D1-9296-3D11-BD8E-FDFDE3A2469D + 122492
28 QuartzCore 0x0000000187efb424 B46D97D1-9296-3D11-BD8E-FDFDE3A2469D + 119844
29 UIKitCore 0x00000001883ae8bc 8AC5E0AF-75BA-3416-AB91-BCD844AB4213 + 403644
30 UIKitCore 0x00000001883ae108 8AC5E0AF-75BA-3416-AB91-BCD844AB4213 + 401672
31 UIKitCore 0x00000001883b4a9c 8AC5E0AF-75BA-3416-AB91-BCD844AB4213 + 428700
32 UIKitCore 0x00000001883b483c 8AC5E0AF-75BA-3416-AB91-BCD844AB4213 + 428092
33 UpdateCycle 0x00000002b5a5dbc0 F0C9D3F7-87C3-340A-9E6F-EDDF5BDBA505 + 3008
34 CoreFoundation 0x0000000184180ab0 7CDBA4FD-E90E-3EF2-8AE3-9071648E4673 + 367280
35 CoreFoundation 0x0000000184180a24 7CDBA4FD-E90E-3EF2-8AE3-9071648E4673 + 367140
36 CoreFoundation 0x0000000184162174 7CDBA4FD-E90E-3EF2-8AE3-9071648E4673 + 242036
37 CoreFoundation 0x0000000184161290 7CDBA4FD-E90E-3EF2-8AE3-9071648E4673 + 238224
38 CoreFoundation 0x0000000184162700 7CDBA4FD-E90E-3EF2-8AE3-9071648E4673 + 243456
39 GraphicsServices 0x000000022e79ff24 GSEventRunModal + 120
40 UIKitCore 0x0000000188404860 UIApplicationMain + 336
41 YouTube 0x0000000113c40414 YouTube + 984084
42 LiveContainerShared 0x000000010416bc9c invokeAppMain + 6528
43 LiveContainerShared 0x0000000104169aa8 LiveContainerMain + 2348
44 dyld 0x0000000183fb3630 5FD0ED6B-D314-3392-AA82-91C9FC014422 + 22064
)

@Tonwalter888

Copy link
Copy Markdown
Owner

Reverted it. I think I have to find more proper ways to test new things

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