From 565061e648bf16d42fe52a1d2bbc2155b6fca846 Mon Sep 17 00:00:00 2001 From: Balackburn Date: Wed, 29 Nov 2023 13:08:39 +0100 Subject: [PATCH] added YTUnShorts https://github.com/PoomSmart/YTUnShorts --- Source/Settings.xm | 10 ++++++++++ YTLitePlus.xm | 18 ++++++++++++++++++ .../ar.lproj/Localizable.strings | 3 +++ .../en.lproj/Localizable.strings | 3 +++ .../es.lproj/Localizable.strings | 3 +++ .../fr.lproj/Localizable.strings | 3 +++ .../ja.lproj/Localizable.strings | 3 +++ .../pt.lproj/Localizable.strings | 3 +++ .../ro.lproj/Localizable.strings | 3 +++ .../ru.lproj/Localizable.strings | 3 +++ .../template.lproj/Localizable.strings | 3 +++ .../tr.lproj/Localizable.strings | 3 +++ .../vi.lproj/Localizable.strings | 3 +++ 13 files changed, 61 insertions(+) diff --git a/Source/Settings.xm b/Source/Settings.xm index 02a2e94..aafa4b0 100644 --- a/Source/Settings.xm +++ b/Source/Settings.xm @@ -468,6 +468,16 @@ extern NSBundle *YTLitePlusBundle(); } settingItemId:0], + [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"UN_SHORTS") + titleDescription:LOC(@"UN_SHORTS_DESC") + accessibilityIdentifier:nil + switchOn:IsEnabled(@"UnShorts_enabled") + switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { + [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"UnShorts_enabled"]; + return YES ; + } + settingItemId:0], + [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_CAST_BUTTON") titleDescription:LOC(@"HIDE_CAST_BUTTON_DESC") accessibilityIdentifier:nil diff --git a/YTLitePlus.xm b/YTLitePlus.xm index 0a7d346..3ca3a30 100644 --- a/YTLitePlus.xm +++ b/YTLitePlus.xm @@ -316,6 +316,24 @@ static BOOL IsEnabled(NSString *key) { - (BOOL)isPromptForLocalNetworkPermissionsEnabled { return NO; } %end +// YTUnShorts - https://github.com/PoomSmart/YTUnShorts +%hook YTIElementRenderer +- (NSData *)elementData { + NSString *description = [self description]; + if (IsEnabled(@"UnShorts_enabled")) { + if ([description containsString:@"shorts_shelf.eml"] || + [description containsString:@"#shorts"] || + [description containsString:@"shorts_video_cell.eml"] || + [description containsString:@"6Shorts"]) { + if (![description containsString:@"history*"]) { + return nil; + } + } + } + return %orig; +} +%end + // BigYTMiniPlayer: https://github.com/Galactic-Dev/BigYTMiniPlayer %group Main %hook YTWatchMiniBarView diff --git a/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings index 5475241..048bfa8 100644 --- a/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings @@ -95,6 +95,9 @@ "ENABLE_FLEX" = "تمكين FLEX"; "ENABLE_FLEX_DESC" = "تمكين FLEX للتصحيح (غير مستحسن). اترك هذا إلا إذا كنت تعرف ما تفعله"; +"UN_SHORTS" = "Hide Shorts (YTUnShorts)" +"UN_SHORTS_DESC" = "Remove Shorts from YouTube feed." + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Enable App Version Spoofer (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Enable this to use the Version Spoofer (Lite) and select your perferred version below. App restart is required."; diff --git a/lang/YTLitePlus.bundle/en.lproj/Localizable.strings b/lang/YTLitePlus.bundle/en.lproj/Localizable.strings index 4040f99..1e23c27 100644 --- a/lang/YTLitePlus.bundle/en.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/en.lproj/Localizable.strings @@ -95,6 +95,9 @@ "ENABLE_FLEX" = "Enable FLEX"; "ENABLE_FLEX_DESC" = "Enable FLEX for debugging (not recommended). Leave this off unless you know what you are doing."; +"UN_SHORTS" = "Hide Shorts (YTUnShorts)" +"UN_SHORTS_DESC" = "Remove Shorts from YouTube feed." + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Enable App Version Spoofer (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Enable this to use the Version Spoofer (Lite) and select your perferred version below. App restart is required."; diff --git a/lang/YTLitePlus.bundle/es.lproj/Localizable.strings b/lang/YTLitePlus.bundle/es.lproj/Localizable.strings index 442845d..655e249 100644 --- a/lang/YTLitePlus.bundle/es.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/es.lproj/Localizable.strings @@ -95,6 +95,9 @@ "ENABLE_FLEX" = "Habilitar FLEX"; "ENABLE_FLEX_DESC" = "Habilitar FLEX para depuración (no recomendado). Déjelo desactivado a menos que sepa lo que está haciendo"; +"UN_SHORTS" = "Hide Shorts (YTUnShorts)" +"UN_SHORTS_DESC" = "Remove Shorts from YouTube feed." + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Activar App Version Spoofer (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Active esta opción para utilizar Version Spoofer (Lite) y seleccione su versión preferida a continuación. Es necesario reiniciar la aplicación."; diff --git a/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings b/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings index 0b8cc74..f0755ca 100644 --- a/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings @@ -98,6 +98,9 @@ "ENABLE_FLEX" = "Activer FLEX"; "ENABLE_FLEX_DESC" = "Activez FLEX pour le débogage (non recommandé). Laissez cette option désactivée, sauf si vous savez ce que vous faites."; +"UN_SHORTS" = "Hide Shorts (YTUnShorts)" +"UN_SHORTS_DESC" = "Remove Shorts from YouTube feed." + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Activer le Spoofer de Version de l'Application (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Activez cette option pour utiliser le Spoofer de Version de l'Application (Lite) et sélectionnez votre version préférée ci-dessous. Un redémarrage de l'application est requis."; diff --git a/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings index 821cf54..8c2029e 100644 --- a/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings @@ -98,6 +98,9 @@ "ENABLE_FLEX" = "FLEXを有効化"; "ENABLE_FLEX_DESC" = "デバッグ用のFLEXを有効化します(推奨しません) \n何をやっているのか分からない場合はオフにしてください"; +"UN_SHORTS" = "Hide Shorts (YTUnShorts)" +"UN_SHORTS_DESC" = "Remove Shorts from YouTube feed." + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "アプリのバージョン偽装(Lite)を有効にする"; "APP_VERSION_SPOOFER_LITE_DESC" = "バージョン偽装(Lite)を使用するにはこれを有効にし、以下からお好みのバージョンを選択してください。アプリの再起動が必要です。"; diff --git a/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings b/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings index 1931163..cbb30e7 100644 --- a/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings @@ -95,6 +95,9 @@ "ENABLE_FLEX" = "Enable FLEX"; "ENABLE_FLEX_DESC" = "Enable FLEX for debugging (not recommended). Leave this off unless you know what you are doing."; +"UN_SHORTS" = "Hide Shorts (YTUnShorts)" +"UN_SHORTS_DESC" = "Remove Shorts from YouTube feed." + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Enable App Version Spoofer (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Enable this to use the Version Spoofer (Lite) and select your perferred version below. App restart is required."; diff --git a/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings index 8f6cb7b..fd1240d 100644 --- a/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings @@ -95,6 +95,9 @@ "ENABLE_FLEX" = "Activare FLEX"; "ENABLE_FLEX_DESC" = "Activați FLEX pentru depanare (nerecomandat). Lăsați această opțiune dezactivată dacă nu știți ce faceți."; +"UN_SHORTS" = "Hide Shorts (YTUnShorts)" +"UN_SHORTS_DESC" = "Remove Shorts from YouTube feed." + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Activare Spoofer Versiune Aplicație (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Activați pentru a utiliza Version Spoofer (Lite) și alegeți versiunea preferată. Este necesară repornirea aplicației."; diff --git a/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings index 5a4c3dd..e670e10 100644 --- a/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings @@ -95,6 +95,9 @@ "ENABLE_FLEX" = "Enable FLEX"; "ENABLE_FLEX_DESC" = "Enable FLEX for debugging (not recommended). Leave this off unless you know what you are doing."; +"UN_SHORTS" = "Hide Shorts (YTUnShorts)" +"UN_SHORTS_DESC" = "Remove Shorts from YouTube feed." + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Enable App Version Spoofer (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Enable this to use the Version Spoofer (Lite) and select your perferred version below. App restart is required."; diff --git a/lang/YTLitePlus.bundle/template.lproj/Localizable.strings b/lang/YTLitePlus.bundle/template.lproj/Localizable.strings index 7d79018..abf53dc 100644 --- a/lang/YTLitePlus.bundle/template.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/template.lproj/Localizable.strings @@ -110,6 +110,9 @@ https://github.com/PoomSmart/Return-YouTube-Dislikes/tree/main/layout/Library/Ap "ENABLE_FLEX" = "Enable FLEX"; "ENABLE_FLEX_DESC" = "Enable FLEX for debugging (not recommended). Leave this off unless you know what you are doing."; +"UN_SHORTS" = "Hide Shorts (YTUnShorts)" +"UN_SHORTS_DESC" = "Remove Shorts from YouTube feed." + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Enable App Version Spoofer (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Enable this to use the Version Spoofer (Lite) and select your perferred version below. App restart is required."; diff --git a/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings b/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings index 4490690..c185716 100644 --- a/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings @@ -95,6 +95,9 @@ "ENABLE_FLEX" = "Enable FLEX"; "ENABLE_FLEX_DESC" = "Enable FLEX for debugging (not recommended). Leave this off unless you know what you are doing."; +"UN_SHORTS" = "Hide Shorts (YTUnShorts)" +"UN_SHORTS_DESC" = "Remove Shorts from YouTube feed." + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Enable App Version Spoofer (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Enable this to use the Version Spoofer (Lite) and select your perferred version below. App restart is required."; diff --git a/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings b/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings index 3fea7f8..5719b18 100644 --- a/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings @@ -130,6 +130,9 @@ "ENABLE_FLEX" = "Kích hoạt FLEX"; "ENABLE_FLEX_DESC" = "Bật FLEX để gỡ lỗi (không khuyến nghị). Bỏ qua điều này trừ khi bạn biết những gì bạn đang làm."; +"UN_SHORTS" = "Hide Shorts (YTUnShorts)" +"UN_SHORTS_DESC" = "Remove Shorts from YouTube feed." + "FIX_GOOGLE_SIGNIN" = "Sửa lỗi Đăng nhập bằng Google (chỉ dành cho người dùng TrollStore)"; "FIX_GOOGLE_SIGNIN_DESC" = "Chỉ bật tùy chọn này khi bạn không thể đăng nhập bằng tài khoản Google của mình và ứng dụng đã được cài đặt qua TrollStore. Nếu bạn có thể đăng nhập bình thường, hãy tắt nó đi. Khởi động lại ứng dụng là bắt buộc.";