From c397afd2f780f8e6532838ebccec1d9ecfbf80b2 Mon Sep 17 00:00:00 2001 From: aricloverEXALT <157071384+aricloverEXALT@users.noreply.github.com> Date: Tue, 7 Jan 2025 01:05:40 -0600 Subject: [PATCH] Update YouTubeNativeShare from 0.2.4 to 0.2.6 --- Sources/uYouPlusPatches.xm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Sources/uYouPlusPatches.xm b/Sources/uYouPlusPatches.xm index 51c8112..8ebd7c9 100644 --- a/Sources/uYouPlusPatches.xm +++ b/Sources/uYouPlusPatches.xm @@ -99,7 +99,8 @@ typedef NS_ENUM(NSInteger, ShareEntityType) { ShareEntityFieldPlaylist = 2, ShareEntityFieldChannel = 3, ShareEntityFieldPost = 6, - ShareEntityFieldClip = 8 + ShareEntityFieldClip = 8, + ShareEntityFieldShortFlag = 10 }; static inline NSString* extractIdWithFormat(GPBUnknownFields *fields, NSInteger fieldNumber, NSString *format) { @@ -137,8 +138,12 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *source } } - if (!shareUrl) - shareUrl = extractIdWithFormat(fields, ShareEntityFieldVideo, @"https://youtube.com/watch?v=%@"); + if (!shareUrl) { + NSString *format = @"https://youtube.com/watch?v=%@"; + if ([fields fields:ShareEntityFieldShortFlag]) + format = @"https://youtube.com/shorts/%@"; + shareUrl = extractIdWithFormat(fields, ShareEntityFieldVideo, format); + } if (!shareUrl) shareUrl = extractIdWithFormat(fields, ShareEntityFieldPost, @"https://youtube.com/post/%@");