Skip to content

Commit

Permalink
Merge pull request BandarHL#274 from haxibami/feature/no-video-on-trend
Browse files Browse the repository at this point in the history
  • Loading branch information
BandarHL authored Oct 22, 2024
2 parents e137e2c + d744d9e commit 46e4436
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions BHTManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
+ (BOOL)hideTopicsToFollow;
+ (BOOL)hideViewCount;
+ (BOOL)hidePremiumOffer;
+ (BOOL)hideTrendVideos;
+ (BOOL)forceTweetFullFrame;
+ (BOOL)stripTrackingParams;
+ (BOOL)alwaysFollowingPage;
Expand Down
3 changes: 3 additions & 0 deletions BHTManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ + (BOOL)hideViewCount {
+ (BOOL)hidePremiumOffer {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hide_premium_offer"];
}
+ (BOOL)hideTrendVideos {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hide_trend_videos"];
}
+ (BOOL)forceTweetFullFrame {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"force_tweet_full_frame"];
}
Expand Down
3 changes: 3 additions & 0 deletions SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ - (NSArray *)specifiers {
PSSpecifier *hideTopicsToFollow = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_TOPICS_TO_FOLLOW_OPTION"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_TOPICS_TO_FOLLOW_OPTION_DETAIL_TITLE"] key:@"hide_topics_to_follow" defaultValue:false changeAction:nil];

PSSpecifier *hidePremiumOffer = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_PREMIUM_OFFER_OPTION"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE"] key:@"hide_premium_offer" defaultValue:false changeAction:nil];

PSSpecifier *hideTrendVideos = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_TREND_VIDEOS_OPTION_TITLE"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE"] key:@"hide_trend_videos" defaultValue:false changeAction:nil];

PSSpecifier *videoLayerCaption = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE"] detailTitle:nil key:@"dis_VODCaptions" defaultValue:false changeAction:nil];

Expand Down Expand Up @@ -239,6 +241,7 @@ - (NSArray *)specifiers {
hideWhoToFollow,
hideTopicsToFollow,
hidePremiumOffer,
hideTrendVideos,
videoLayerCaption,
directSave,
noHistory,
Expand Down
7 changes: 7 additions & 0 deletions Tweak.x
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ static void batchSwizzlingOnClass(Class cls, NSArray<NSString*>*origSelectors, I
[_orig setHidden:true];
}
}
if ([BHTManager hideTrendVideos] && ([class_name isEqualToString:@"TwitterURT.URTModuleHeaderViewModel"] || [class_name isEqualToString:@"TwitterURT.URTModuleFooterViewModel"] || [class_name isEqualToString:@"T1TwitterSwift.URTTimelineCarouselViewModel"])) {
[_orig setHidden:true];
}
}

if ([self.adDisplayLocation isEqualToString:@"TIMELINE_HOME"]) {
Expand Down Expand Up @@ -366,6 +369,10 @@ static void batchSwizzlingOnClass(Class cls, NSArray<NSString*>*origSelectors, I
return 0;
}
}

if ([BHTManager hideTrendVideos] && ([class_name isEqualToString:@"TwitterURT.URTModuleHeaderViewModel"] || [class_name isEqualToString:@"TwitterURT.URTModuleFooterViewModel"] || [class_name isEqualToString:@"T1TwitterSwift.URTTimelineCarouselViewModel"])) {
return 0;
}
}

if ([self.adDisplayLocation isEqualToString:@"TIMELINE_HOME"]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
"HIDE_PREMIUM_OFFER_OPTION" = "إخفاء عرض التسجيل المميز";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "إخفاء زر وثِّق حسابك وترقية في الملف الشخصي وشريط التنقل";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "إخفاء الفيديوهات الرائجة";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "إخفاء الفيديوهات الرائجة في علامة تبويب البحث";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "تعطيل وصف الفيديو";

"VOICE_OPTION_TITLE" = "الملاحظة الصوتية";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
"HIDE_PREMIUM_OFFER_OPTION" = "Hide Premium registration offer";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "Hide Get verified and Upgrade button in the profile and navigation bar";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "Hide trending videos";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "Hide trending videos in the Search tab";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "Disable video layer captions";

"VOICE_OPTION_TITLE" = "Voice feature";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
"HIDE_PREMIUM_OFFER_OPTION" = "Ocultar la oferta de registro Premium";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "Ocultar los botones Obtener verificación y Actualizar a nivel superior en el perfil y en la barra de navegación";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "Ocultar los vídeos que son tendencia";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "Ocultar los vídeos que son tendencia en la pestaña de búsqueda";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "Desactivar subtítulos";

"VOICE_OPTION_TITLE" = "Función de voz";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
"HIDE_PREMIUM_OFFER_OPTION" = "Masquer l'offre d'enregistrement Premium";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "Masquer les boutons Obtenir la certification et Mettre à niveau dans le profil et la barre de navigation";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "Masquer les vidéos tendance";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "Masquer les vidéos tendance dans l'onglet de recherche";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "Désactiver les sous-titres du calque vidéo";

"VOICE_OPTION_TITLE" = "Fonction vocale";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
"HIDE_PREMIUM_OFFER_OPTION" = "Sembunyikan penawaran pendaftaran Premium";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "Sembunyikan tombol Dapatkan verifikasi dan Tingkatkan di profil dan bilah navigasi";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "Sembunyikan video yang sedang tren";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "Sembunyikan video yang sedang tren di tab pencarian";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "nonaktifkan text video";

"VOICE_OPTION_TITLE" = "Fitur Suara";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
"HIDE_PREMIUM_OFFER_OPTION" = "プレミアムの登録オファーを消す";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "プロフィールとナビゲーションバーの「認証される」「アップグレード」ボタンを削除します。";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "トレンドの動画を消す";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "検索タブからトレンドの動画を削除します。";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "動画の字幕を無効にする";

"VOICE_OPTION_TITLE" = "音声機能の有効化";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
"HIDE_PREMIUM_OFFER_OPTION" = "Скрыть предложение премиум-регистрации";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "Скрыть кнопку «Подтвердить подлинность» и «Улучшить подписку» в профиле и на панели навигации";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "Скрыть популярные видео";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "Скрыть популярные видео во вкладке «Поиск»";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "Отключить описания видео";

"VOICE_OPTION_TITLE" = "Голосовые";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
"HIDE_PREMIUM_OFFER_OPTION" = "Premium kayıt teklifini gizle";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "Profil ve gezinti çubuğundaki Onaylanmış hesap sahibi ol ve Yükselt düğmelerini gizleyin";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "Trend olan videoları gizle";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "Arama sekmesinde trend olan videoları gizle";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "Video katmanı altyazılarını devre dışı bırak";

"VOICE_OPTION_TITLE" = "Ses özelliği";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
"HIDE_PREMIUM_OFFER_OPTION" = "隱藏高級註冊優惠";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "在個人檔案和導覽列中隱藏獲得認證和升級按鈕";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "隱藏熱門影片";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "在搜尋標籤中隱藏熱門影片";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "關閉影片字幕";

"VOICE_OPTION_TITLE" = "語音訊息";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
"HIDE_PREMIUM_OFFER_OPTION" = "隐藏高级注册优惠";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "在个人资料和导航栏中隐藏通过验证和升级按钮";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "隐藏热门视频";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "隐藏搜索标签中的热门视频";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "开启视频字幕";

"VOICE_OPTION_TITLE" = "语音功能";
Expand Down

0 comments on commit 46e4436

Please sign in to comment.