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/%@");