From 7120e88d8831141fe0ce7b6463fc485b23da9948 Mon Sep 17 00:00:00 2001 From: aricloverEXTRA <157071384+aricloverEXTRA@users.noreply.github.com> Date: Mon, 29 Jun 2026 17:10:23 -0500 Subject: [PATCH] =?UTF-8?q?Modern=20=E2=80=9CReplace=20YouTube's=20downloa?= =?UTF-8?q?d=20with=20uYou's=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Should still work with versions 19.30.2+ but backwards compatibility has been stripped entirely. And also structure has been modernized with new calls. So it should work as intended on much more modern versions of YouTube too. --- Sources/uYouPlus.xm | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 2c5fa70..7e63470 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -306,7 +306,7 @@ static void hideButtonsInActionBarIfNeeded(id collectionView) { } %end -// Replace YouTube's download with uYou's +// Replace YouTube's download with uYou's - 19.30.2+ YTMainAppControlsOverlayView *controlsOverlayView; %hook YTMainAppControlsOverlayView - (id)initWithDelegate:(id)arg1 { @@ -319,11 +319,18 @@ YTMainAppControlsOverlayView *controlsOverlayView; if (IS_ENABLED(kReplaceYTDownloadWithuYou) && [arg2 isKindOfClass:%c(ELMPBShowActionSheetCommand)]) { ELMPBShowActionSheetCommand *showCommand = (ELMPBShowActionSheetCommand *)arg2; NSArray *listOptions = [showCommand listOptionArray]; + for (ELMPBElement *element in listOptions) { ELMPBProperties *properties = [element properties]; - ELMPBIdentifierProperties *identifierProperties = [properties firstSubmessage]; - // 19.30.2 - if ([identifierProperties respondsToSelector:@selector(identifier)]) { + + ELMPBIdentifierProperties *identifierProperties = nil; + if ([properties respondsToSelector:@selector(firstSubmessage)]) { + identifierProperties = [properties firstSubmessage]; + } else if ([properties respondsToSelector:@selector(submessageAtIndex:)]) { + identifierProperties = [properties submessageAtIndex:0]; + } + + if (identifierProperties && [identifierProperties respondsToSelector:@selector(identifier)]) { NSString *identifier = [identifierProperties identifier]; if ([identifier containsString:@"offline_upsell_dialog"]) { if ([controlsOverlayView respondsToSelector:@selector(uYou)]) { @@ -332,14 +339,6 @@ YTMainAppControlsOverlayView *controlsOverlayView; return; } } - // 19.20.2 - NSString *description = [identifierProperties description]; - if ([description containsString:@"offline_upsell_dialog"]) { - if ([controlsOverlayView respondsToSelector:@selector(uYou)]) { - [controlsOverlayView uYou]; - } - return; - } } } %orig;