diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4df64a9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 YTLitePlus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Source/Settings.xm b/Source/Settings.xm index 8a8aaeb..c25f262 100644 --- a/Source/Settings.xm +++ b/Source/Settings.xm @@ -41,6 +41,8 @@ static int appVersionSpoofer() { @interface YTSettingsSectionItemManager (YTLitePlus) - (void)updateYTLitePlusSectionWithEntry:(id)entry; +- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray *)urls; +- (void)documentPickerWasCancelled:(UIDocumentPickerViewController *)controller; @end extern NSBundle *YTLitePlusBundle(); @@ -192,6 +194,29 @@ static const NSInteger YTLiteSection = 789; ]; [sectionItems addObject:pasteSettings]; + YTSettingsSectionItem *videoPlayer = [%c(YTSettingsSectionItem) + itemWithTitle:LOC(@"VIDEO_PLAYER") + titleDescription:LOC(@"VIDEO_PLAYER_DESC") + accessibilityIdentifier:nil + detailTextBlock:nil + selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { + // Access the current view controller + UIViewController *settingsViewController = [self valueForKey:@"_settingsViewControllerDelegate"]; + if (settingsViewController) { + // Present the video picker + UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[(NSString *)kUTTypeMovie, (NSString *)kUTTypeVideo] inMode:UIDocumentPickerModeImport]; + documentPicker.delegate = (id)self; + documentPicker.allowsMultipleSelection = NO; + [settingsViewController presentViewController:documentPicker animated:YES completion:nil]; + } else { + NSLog(@"settingsViewController is nil"); + } + + return YES; // Return YES to indicate that the action was handled + } + ]; + [sectionItems addObject:videoPlayer]; + /* YTSettingsSectionItem *appIcon = [%c(YTSettingsSectionItem) itemWithTitle:LOC(@"CHANGE_APP_ICON") @@ -647,4 +672,31 @@ static const NSInteger YTLiteSection = 789; } %orig; } + +// Implement the delegate method for document picker +%new +- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray *)urls { + NSURL *pickedURL = [urls firstObject]; + + if (pickedURL) { + // Use AVPlayerViewController to play the video + AVPlayer *player = [AVPlayer playerWithURL:pickedURL]; + AVPlayerViewController *playerViewController = [[AVPlayerViewController alloc] init]; + playerViewController.player = player; + + UIViewController *settingsViewController = [self valueForKey:@"_settingsViewControllerDelegate"]; + if (settingsViewController) { + [settingsViewController presentViewController:playerViewController animated:YES completion:^{ + [player play]; + }]; + } + } +} + +%new +- (void)documentPickerWasCancelled:(UIDocumentPickerViewController *)controller { + // Handle cancellation if needed + NSLog(@"Document picker was cancelled"); +} + %end diff --git a/Tweaks/Return-YouTube-Dislikes b/Tweaks/Return-YouTube-Dislikes index 0f4c6b7..8578263 160000 --- a/Tweaks/Return-YouTube-Dislikes +++ b/Tweaks/Return-YouTube-Dislikes @@ -1 +1 @@ -Subproject commit 0f4c6b7f5960308161c870d9aab30905fe8145cc +Subproject commit 8578263c9f7caf7a22bd9364648e218974ee543c diff --git a/Tweaks/YTUHD b/Tweaks/YTUHD index 17c2035..02a5c91 160000 --- a/Tweaks/YTUHD +++ b/Tweaks/YTUHD @@ -1 +1 @@ -Subproject commit 17c2035ea9c8334f2d9154f114b6590928e93521 +Subproject commit 02a5c915a7f4183307812a94759d73f25e7fdba6 diff --git a/Tweaks/YouTubeHeader b/Tweaks/YouTubeHeader index 171f681..850e939 160000 --- a/Tweaks/YouTubeHeader +++ b/Tweaks/YouTubeHeader @@ -1 +1 @@ -Subproject commit 171f681e235a1f7176cde31a95e6454fc00418c3 +Subproject commit 850e939ce7053f593ed477e83ec914c98669be46 diff --git a/Tweaks/protobuf b/Tweaks/protobuf index b2a38a7..57ba428 160000 --- a/Tweaks/protobuf +++ b/Tweaks/protobuf @@ -1 +1 @@ -Subproject commit b2a38a7b9764a0b55887ea1fa3cd958df9d6a111 +Subproject commit 57ba42815efe292b3c9c99e8afadf13bbb13fff1 diff --git a/YTLitePlus.h b/YTLitePlus.h index 07f416f..8a41583 100644 --- a/YTLitePlus.h +++ b/YTLitePlus.h @@ -8,6 +8,8 @@ #import #import #import +#import // For AVPlayer and AVPlayerViewController +#import // For kUTTypeMovie and kUTTypeVideo #import "Tweaks/FLEX/FLEX.h" #import "Tweaks/YouTubeHeader/YTAppDelegate.h" diff --git a/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings index 2820e92..a577d98 100644 --- a/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings @@ -13,6 +13,9 @@ "REPLACE_COPY_AND_PASTE_BUTTONS" = "Replace 'Copy Settings' & 'Paste Settings' Buttons"; "REPLACE_COPY_AND_PASTE_BUTTONS_DESC" = "Replaces the Buttons to 'Export Settings' and 'Import Settings'"; +"VIDEO_PLAYER" = "Video Player (Beta)"; +"VIDEO_PLAYER_DESC" = "Open a downloaded video in the Apple player"; + // Player Gestures "PLAYER_GESTURES_TOGGLE" = "Enable Player Gestures"; "VOLUME" = "Volume"; diff --git a/lang/YTLitePlus.bundle/bg.lproj/Localizable.strings b/lang/YTLitePlus.bundle/bg.lproj/Localizable.strings index 5d2c48a..4689437 100644 --- a/lang/YTLitePlus.bundle/bg.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/bg.lproj/Localizable.strings @@ -13,6 +13,9 @@ "REPLACE_COPY_AND_PASTE_BUTTONS" = "Заменете бутоните 'Копиране на настройки' и 'Поставяне на настройки'"; "REPLACE_COPY_AND_PASTE_BUTTONS_DESC" = "Заменете бутоните с 'Експортиране на настройки' и 'Импортиране на настройки'"; +"VIDEO_PLAYER" = "Video Player (Beta)"; +"VIDEO_PLAYER_DESC" = "Open a downloaded video in the Apple player"; + // Player Gestures "PLAYER_GESTURES_TOGGLE" = "Enable Player Gestures"; "VOLUME" = "Volume"; diff --git a/lang/YTLitePlus.bundle/de.lproj/Localizable.strings b/lang/YTLitePlus.bundle/de.lproj/Localizable.strings index 3671c43..76a63fe 100644 --- a/lang/YTLitePlus.bundle/de.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/de.lproj/Localizable.strings @@ -13,6 +13,9 @@ "REPLACE_COPY_AND_PASTE_BUTTONS" = "Replace 'Copy Settings' & 'Paste Settings' Buttons"; "REPLACE_COPY_AND_PASTE_BUTTONS_DESC" = "Replaces the Buttons to 'Export Settings' and 'Import Settings'"; +"VIDEO_PLAYER" = "Video Player (Beta)"; +"VIDEO_PLAYER_DESC" = "Open a downloaded video in the Apple player"; + // Player Gestures "PLAYER_GESTURES_TOGGLE" = "Enable Player Gestures"; "VOLUME" = "Volume"; diff --git a/lang/YTLitePlus.bundle/en.lproj/Localizable.strings b/lang/YTLitePlus.bundle/en.lproj/Localizable.strings index 80781ce..9801761 100644 --- a/lang/YTLitePlus.bundle/en.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/en.lproj/Localizable.strings @@ -13,6 +13,9 @@ "REPLACE_COPY_AND_PASTE_BUTTONS" = "Replace 'Copy Settings' & 'Paste Settings' Buttons"; "REPLACE_COPY_AND_PASTE_BUTTONS_DESC" = "Replaces the Buttons to 'Export Settings' and 'Import Settings'"; +"VIDEO_PLAYER" = "Video Player (Beta)"; +"VIDEO_PLAYER_DESC" = "Open a downloaded video in the Apple player"; + // Player Gestures "PLAYER_GESTURES_TOGGLE" = "Enable Player Gestures"; "VOLUME" = "Volume"; diff --git a/lang/YTLitePlus.bundle/es.lproj/Localizable.strings b/lang/YTLitePlus.bundle/es.lproj/Localizable.strings index 8a7817b..1cf7433 100644 --- a/lang/YTLitePlus.bundle/es.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/es.lproj/Localizable.strings @@ -13,6 +13,9 @@ "REPLACE_COPY_AND_PASTE_BUTTONS" = "Replace 'Copy Settings' & 'Paste Settings' Buttons"; "REPLACE_COPY_AND_PASTE_BUTTONS_DESC" = "Replaces the Buttons to 'Export Settings' and 'Import Settings'"; +"VIDEO_PLAYER" = "Video Player (Beta)"; +"VIDEO_PLAYER_DESC" = "Open a downloaded video in the Apple player"; + // Player Gestures "PLAYER_GESTURES_TOGGLE" = "Enable Player Gestures"; "VOLUME" = "Volume"; diff --git a/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings b/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings index 284a08e..e788b97 100644 --- a/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings @@ -13,6 +13,9 @@ "REPLACE_COPY_AND_PASTE_BUTTONS" = "Replace 'Copy Settings' & 'Paste Settings' Buttons"; "REPLACE_COPY_AND_PASTE_BUTTONS_DESC" = "Replaces the Buttons to 'Export Settings' and 'Import Settings'"; +"VIDEO_PLAYER" = "Video Player (Beta)"; +"VIDEO_PLAYER_DESC" = "Open a downloaded video in the Apple player"; + // Player Gestures "PLAYER_GESTURES_TOGGLE" = "Enable Player Gestures"; "VOLUME" = "Volume"; diff --git a/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings index 931e0bf..2749ff2 100644 --- a/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings @@ -13,6 +13,9 @@ "REPLACE_COPY_AND_PASTE_BUTTONS" = "Replace 'Copy Settings' & 'Paste Settings' Buttons"; "REPLACE_COPY_AND_PASTE_BUTTONS_DESC" = "Replaces the Buttons to 'Export Settings' and 'Import Settings'"; +"VIDEO_PLAYER" = "Video Player (Beta)"; +"VIDEO_PLAYER_DESC" = "Open a downloaded video in the Apple player"; + // Player Gestures "PLAYER_GESTURES_TOGGLE" = "Enable Player Gestures"; "VOLUME" = "Volume"; diff --git a/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings b/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings index ff49e3a..df987ed 100644 --- a/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings @@ -13,6 +13,9 @@ "REPLACE_COPY_AND_PASTE_BUTTONS" = "Substituir os Botões 'Copiar Configurações' e 'Colar Configurações'"; "REPLACE_COPY_AND_PASTE_BUTTONS_DESC" = "Substitui os Botões 'Exportar Configurações' e 'Importar Configurações'"; +"VIDEO_PLAYER" = "Video Player (Beta)"; +"VIDEO_PLAYER_DESC" = "Open a downloaded video in the Apple player"; + // Player Gestures "PLAYER_GESTURES_TOGGLE" = "Enable Player Gestures"; "VOLUME" = "Volume"; diff --git a/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings index c11bba9..343c226 100644 --- a/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings @@ -13,6 +13,9 @@ "REPLACE_COPY_AND_PASTE_BUTTONS" = "Replace 'Copy Settings' & 'Paste Settings' Buttons"; "REPLACE_COPY_AND_PASTE_BUTTONS_DESC" = "Replaces the Buttons to 'Export Settings' and 'Import Settings'"; +"VIDEO_PLAYER" = "Video Player (Beta)"; +"VIDEO_PLAYER_DESC" = "Open a downloaded video in the Apple player"; + // Player Gestures "PLAYER_GESTURES_TOGGLE" = "Enable Player Gestures"; "VOLUME" = "Volume"; diff --git a/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings index ce1184e..5e6bb59 100644 --- a/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings @@ -13,6 +13,9 @@ "REPLACE_COPY_AND_PASTE_BUTTONS" = "Replace 'Copy Settings' & 'Paste Settings' Buttons"; "REPLACE_COPY_AND_PASTE_BUTTONS_DESC" = "Replaces the Buttons to 'Export Settings' and 'Import Settings'"; +"VIDEO_PLAYER" = "Video Player (Beta)"; +"VIDEO_PLAYER_DESC" = "Open a downloaded video in the Apple player"; + // Player Gestures "PLAYER_GESTURES_TOGGLE" = "Enable Player Gestures"; "VOLUME" = "Volume"; diff --git a/lang/YTLitePlus.bundle/template.lproj/Localizable.strings b/lang/YTLitePlus.bundle/template.lproj/Localizable.strings index 1b60f3e..413a20a 100644 --- a/lang/YTLitePlus.bundle/template.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/template.lproj/Localizable.strings @@ -28,6 +28,9 @@ https://github.com/PoomSmart/Return-YouTube-Dislikes/tree/main/layout/Library/Ap "REPLACE_COPY_AND_PASTE_BUTTONS" = "Replace 'Copy Settings' & 'Paste Settings' Buttons"; "REPLACE_COPY_AND_PASTE_BUTTONS_DESC" = "Replaces the Buttons to 'Export Settings' and 'Import Settings'"; +"VIDEO_PLAYER" = "Video Player (Beta)"; +"VIDEO_PLAYER_DESC" = "Open a downloaded video in the Apple player"; + // Player Gestures "PLAYER_GESTURES_TOGGLE" = "Enable Player Gestures"; "VOLUME" = "Volume"; diff --git a/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings b/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings index f7c8b9f..a9b0ea3 100644 --- a/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings @@ -13,6 +13,9 @@ "REPLACE_COPY_AND_PASTE_BUTTONS" = "'Ayarları Kopyala' ve 'Ayarları Yapıştır' Düğmelerini Değiştir"; "REPLACE_COPY_AND_PASTE_BUTTONS_DESC" = "Düğmeleri 'Ayarları Dışa Aktar' ve 'Ayarları İçe Aktar' ile değiştirir"; +"VIDEO_PLAYER" = "Video Player (Beta)"; +"VIDEO_PLAYER_DESC" = "Open a downloaded video in the Apple player"; + // Player Gestures "PLAYER_GESTURES_TOGGLE" = "Enable Player Gestures"; "VOLUME" = "Volume"; diff --git a/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings b/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings index 5094da9..dd3fdb0 100644 --- a/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings @@ -13,6 +13,9 @@ "REPLACE_COPY_AND_PASTE_BUTTONS" = "Replace 'Copy Settings' & 'Paste Settings' Buttons"; "REPLACE_COPY_AND_PASTE_BUTTONS_DESC" = "Replaces the Buttons to 'Export Settings' and 'Import Settings'"; +"VIDEO_PLAYER" = "Video Player (Beta)"; +"VIDEO_PLAYER_DESC" = "Open a downloaded video in the Apple player"; + // Player Gestures "PLAYER_GESTURES_TOGGLE" = "Enable Player Gestures"; "VOLUME" = "Volume"; diff --git a/lang/YTLitePlus.bundle/zh_TW.lproj/Localizable.strings b/lang/YTLitePlus.bundle/zh_TW.lproj/Localizable.strings index 08796a9..aef5cf3 100644 --- a/lang/YTLitePlus.bundle/zh_TW.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/zh_TW.lproj/Localizable.strings @@ -14,6 +14,9 @@ "REPLACE_COPY_AND_PASTE_BUTTONS" = "Replace 'Copy Settings' & 'Paste Settings' Buttons"; "REPLACE_COPY_AND_PASTE_BUTTONS_DESC" = "Replaces the Buttons to 'Export Settings' and 'Import Settings'"; +"VIDEO_PLAYER" = "Video Player (Beta)"; +"VIDEO_PLAYER_DESC" = "Open a downloaded video in the Apple player"; + // Player Gestures "PLAYER_GESTURES_TOGGLE" = "Enable Player Gestures"; "VOLUME" = "Volume";