Modern “Replace YouTube's download with uYou's”

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.
This commit is contained in:
aricloverEXTRA 2026-06-29 17:10:23 -05:00 committed by GitHub
parent 79b5a69f33
commit 7120e88d88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;