Skip to content

Commit

Permalink
Merge pull request #1288 from therealFoxster/main
Browse files Browse the repository at this point in the history
Add option to hide iSponsorBlock button & attempt to properly prevent uYou's playback from colliding with YouTube's
  • Loading branch information
therealFoxster authored Jan 29, 2024
2 parents 9f05b40 + a893229 commit 2c3fe9b
Show file tree
Hide file tree
Showing 27 changed files with 96 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/ar.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 خيارات متنوعة";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "التأكيد قبل البث (أداة YTCastConfirm)";
"CAST_CONFIRM_DESC" = "إظهار تنبيه للتأكيد قبل البث، من أجل منع البث للتلفاز عن طريق الخطأ.";
"CASTING" = "البث";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/cz.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Miscellaneous";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "Zobrazit potvrzení před začátkem sdílení obrazu (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "Zobrazí potvrzení aby se zamezilo nechtěnému sdílení do televize.";
"CASTING" = "Sdílení obrazu";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Sonstiges";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "Warnung vor TV-Übertragungen (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "Zeigt eine Warnung an, um eine ausversehene TV-Übertragung zu verhindern.";
"CASTING" = "TV-Übertragung";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/el.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Miscellaneous";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock";

"CAST_CONFIRM" = "Επιβεβαιωτικό μήνυμα πριν γίνει Cast(YTCastConfirm)";
"CAST_CONFIRM_DESC" = "Να φανεί ένα επιβεβαιωτικό μήνυμα πριν γίνει cast για να αποτρεπτεί η καταλάθως σύνδεση στην τηλεόραση.";
"CASTING" = "Μετάδοση";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Miscellaneous";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "YTCastConfirm";
"CAST_CONFIRM_DESC" = "Shows a confirmation alert before casting";
"CASTING" = "Casting";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Varios";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "Alerta de confirmación antes de Enviar contenido (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "Mostrar una alerta de confirmación antes de Enviar contenido para prevenir el secuestro accidental del TV.";
"CASTING" = "Enviar contenido";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/fr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Divers";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "Confirmer l'alerte avant le casting (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "Afficher une alerte de confirmation avant de lancer le casting afin d'éviter de déclencher accidentellement la télévision";
"CASTING" = "Cast";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/he.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Miscellaneous";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "התראת אישור לפני שידור לטלוויזיה (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "הצג התראת אישור לפני שידור לטלוויזיה כדי למנוע לחיצה בטעות.";
"CASTING" = "משדר";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/hu.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Miscellaneous";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "Megerősítés átküldés előtt (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "Az átküldés előtt mutasson megerősítő figyelmeztetést, hogy megakadályozza a TV véletlen eltérítését.";
"CASTING" = "Casting";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/it.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Varie";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "Avviso di conferma prima della condivisione su TV (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "Mostra un avviso di conferma prima della condivisione per evitar e di irrompere accidentalmente sulla TV.";
"CASTING" = "Condivisione su TV";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/ja.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 その他";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "YTCastConfirm";
"CAST_CONFIRM_DESC" = "キャスト前に確認の警告を表示します。";
"CASTING" = "キャスト";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/ko.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 기타 설정";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "TV 전송 알림 (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "의도치 않게 TV로 영상을 전송하지 않도록 보내기 전에 확인 메시지를 표시합니다.";
"CASTING" = "TV로 전송";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/nl.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Miscellaneous";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "Bevestig casten (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "Toon een melding na het drukken op de cast knop om te voorkomen dat je per ongeluk cast.";
"CASTING" = "Castings";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/pl.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Miscellaneous";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "Alert przed przesyłaniem (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "Pokaż alert przed przesyłaniem aby nie łączyć się przez przypadek z telewizorem.";
"CASTING" = "Przesyłania";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/pt.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Diversos";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "Alerta de confirmação antes de transmitir (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "Mostra um alerta de confirmação antes da transmissão para evitar o sequestro acidental da TV.";
"CASTING" = "Transmissão";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/ro.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Miscellaneous";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "Alertă de confirmare înainte de proiectare (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "Afișează o alertă de confirmare înainte de a proiecta, pentru a preveni deturnarea accidentală a TV-ului.";
"CASTING" = "Proiectare";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/ru.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Другое";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "Подтверждение «Трансляции» (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "Спрашивать подтверждение перед началом трансляции во избежание случайных подключений к ТВ.";
"CASTING" = "Трансляция";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ https://github.com/PoomSmart/Return-YouTube-Dislikes/tree/main/layout/Library/Ap
// Miscellaneous
"MISCELLANEOUS" = "🔎 Miscellaneous";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "YTCastConfirm";
"CAST_CONFIRM_DESC" = "Shows a confirmation alert before casting";
"CASTING" = "Casting";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/tr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Diğer";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "Yayınlamadan önce uyarıyı onayla (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "TV'nin yanlışlıkla ele geçirilmesini önlemek için yayınlamadan önce bir onay uyarısı gösterir.";
"CASTING" = "Yayınlar";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/vi.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 Cài đặt khác";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "Xác nhận trước khi cast video (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "Hiện hộp thoại xác nhận trước khi cast video sang TV để tránh vô tình chiếm quyền điều khiển TV.";
"CASTING" = "Truyền video";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/zh_cn.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 其它选项";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "投屏前确认 (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "在投屏前显示确认对话框以防意外劫屏。";
"CASTING" = "准备投屏";
Expand Down
3 changes: 3 additions & 0 deletions Localizations/uYouPlus.bundle/zh_tw.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
// Miscellaneous
"MISCELLANEOUS" = "🔎 雜項";

"HIDE_UYOU" = "Hide uYou tab";
"HIDE_ISPONSORBLOCK" = "Hide iSponsorBlock button";

"CAST_CONFIRM" = "投放前確認 (YTCastConfirm)";
"CAST_CONFIRM_DESC" = "在投放前顯示確認訊息,以防止家人幹樵。";
"CASTING" = "投放中";
Expand Down
5 changes: 5 additions & 0 deletions Sources/uYouPlus.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
- (void)confirmAlertDidPressConfirm;
@end

// Hide iSponsorBlock
@interface YTRightNavigationButtons : UIView
@property (nonatomic, readwrite, strong) UIView *sponsorBlockButton;
@end

// Hide YouTube annoying banner in Home page? - @MiRO92 - YTNoShorts: https://github.com/MiRO92/YTNoShorts
@interface _ASCollectionViewCell : UICollectionViewCell
- (id)node;
Expand Down
9 changes: 9 additions & 0 deletions Sources/uYouPlus.xm
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ NSBundle *tweakBundle = uYouPlusBundle();

# pragma mark - Miscellaneous

// Hide iSponsorBlock
%hook YTRightNavigationButtons
- (void)didMoveToWindow {
%orig;
if (IS_ENABLED(@"hideiSponsorBlockButton_enabled"))
self.sponsorBlockButton.hidden = YES;
}
%end

// YTCastConfirm
// See YTCastConfirm.xm

Expand Down
6 changes: 5 additions & 1 deletion Sources/uYouPlusPatches.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
-(YTSingleVideoController *)activeVideo;
@end

// Prevent uYou player bar from showing when not playing downloaded media
@interface PlayerManager : NSObject
// Prevent uYou player bar from showing when not playing downloaded media
- (float)progress;
// Prevent uYou's playback from colliding with YouTube's
- (void)setSource:(id)source;
- (void)pause;
+ (id)sharedInstance;
@end

// iOS 16 uYou crash fix - @level3tjg: https://github.com/qnblackcat/uYouPlus/pull/224
Expand Down
15 changes: 9 additions & 6 deletions Sources/uYouPlusPatches.xm
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,17 @@ static void refreshUYouAppearance() {
%end

// Prevent uYou's playback from colliding with YouTube's
BOOL isYTPlaybackActive = NO;
%hook HAMPlayerInternal
- (void)play { %orig; isYTPlaybackActive = YES; }
- (void)terminate { %orig; isYTPlaybackActive = NO; }
%hook PlayerVC
- (void)close {
%orig;
[[%c(PlayerManager) sharedInstance] setSource:nil];
}
%end
%hook PlayerManager
%hook HAMPlayerInternal
- (void)play {
if (isYTPlaybackActive) return;
dispatch_async(dispatch_get_main_queue(), ^{
[[%c(PlayerManager) sharedInstance] pause];
});
%orig;
}
%end
Expand Down
2 changes: 2 additions & 0 deletions Sources/uYouPlusSettings.xm
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ extern NSBundle *uYouPlusBundle();
# pragma mark - Miscellaneous
SECTION_HEADER(LOC(@"MISCELLANEOUS"));

// SWITCH_ITEM2(LOC(@"HIDE_UYOU"), nil, @"hideUYouTab_enabled"); // We stay on 19.02.1 until MiRO92 update uYou?
SWITCH_ITEM2(LOC(@"HIDE_ISPONSORBLOCK"), nil, @"hideiSponsorBlockButton_enabled");
SWITCH_ITEM(LOC(@"CAST_CONFIRM"), LOC(@"CAST_CONFIRM_DESC"), @"castConfirm_enabled");
SWITCH_ITEM(LOC(@"DISABLE_HINTS"), LOC(@"DISABLE_HINTS_DESC"), @"disableHints_enabled");
SWITCH_ITEM(LOC(@"ENABLE_YT_STARTUP_ANIMATION"), LOC(@"ENABLE_YT_STARTUP_ANIMATION_DESC"), @"ytStartupAnimation_enabled");
Expand Down

0 comments on commit 2c3fe9b

Please sign in to comment.