YouDash brings native YouTube to Apple CarPlay with YouMod ad blocking, responsive layouts, and an on-screen keyboard. Open-source iOS integration. Formerly YouTube Car.
Python ad-blockeradblockapple-carplaycarplaycarplay-appcarplay-videoiosnative-youtubeobjective-cswiftuikityoudashyoumodyoutubeyoutube-caryoutube-carplayyoutube-carplay-iosyoutube-on-carplay
Release standalone native YouTube CarPlay integration and build guide
sa4hnd3f5205f0611e
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.ymlnew file mode 100644index 0000000..df71d60--- /dev/null+++ b/.github/ISSUE_TEMPLATE/bug_report.yml@@ -0,0 +1,31 @@+name: Bug report+description: Report a native YouTube CarPlay integration issue+title: "[Bug] "+body:+ - type: markdown+ attributes:+ value: "Redact screenshots and logs. Never attach profiles, keys, device IDs, or account data."+ - type: input+ id: actual+ attributes:+ label: Actual YouTube version+ validations:+ required: true+ - type: input+ id: reported+ attributes:+ label: Reported version / compatibility override+ - type: input+ id: environment+ attributes:+ label: iOS version and display dimensions+ - type: textarea+ id: steps+ attributes:+ label: Reproduction steps and expected behavior+ validations:+ required: true+ - type: textarea+ id: evidence+ attributes:+ label: Redacted observationsdiff --git a/.gitignore b/.gitignorenew file mode 100644index 0000000..eeb5399--- /dev/null+++ b/.gitignore@@ -0,0 +1,28 @@+# Local inputs, signing material, generated apps and diagnostics+.local/+.venv/+venv/+build/+dist/+release/+__pycache__/+*.pyc+.DS_Store+.env+.env.*+*.ipa+*.app/+*.dylib+*.mobileprovision+*.provisionprofile+*.p12+*.pfx+*.pem+*.key+*.cer+*.certSigningRequest+*.log+*.ips+*.crash+*.xcuserstate+xcuserdata/diff --git a/CHANGELOG.md b/CHANGELOG.mdnew file mode 100644index 0000000..c667f74--- /dev/null+++ b/CHANGELOG.md@@ -0,0 +1,13 @@+# Changelog++## 0.1.0 — Native CarPlay preview++- Native controller handoff between phone and CarPlay.+- Responsive Home grid and small-screen density scaling.+- Split video/details and recommendation/queue layouts on landscape displays.+- English/Arabic on-screen keyboard with native field integration.+- Header safe-area, scroll-collapse, search viewport, and mini-player adjustments.+- Reversible reported-version compatibility override with actual-version metadata preserved.+- Standalone source distribution, credited YouMod snapshot, unsigned packaging, and privacy auditing.++Experimental preview. Compatibility limitations are documented rather than implied to be solved universally.diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdnew file mode 100644index 0000000..be9c36a--- /dev/null+++ b/CONTRIBUTING.md@@ -0,0 +1,9 @@+# Contributing++Keep changes focused on native YouTube CarPlay integration. Preserve the native phone lifecycle and the distinction between actual and reported app versions. Prefer positive, scoped feature detection over blanket changes to unknown native views.++Before proposing a change, read `docs/ARCHITECTURE.md` and `docs/COMPATIBILITY.md`. Describe the user-visible problem, resulting behavior, relevant version/display constraints, and validation actually performed. Do not claim a simulator harness proves behavior on physical head units.++Never commit IPAs, application bundles, provisioning profiles, certificates/private keys, account data, device IDs, raw logs, or personal paths. Use placeholders in examples. Report sensitive findings privately as described in `SECURITY.md`.++Use GPL-compatible contributions with proper attribution. Update notices when adding third-party source. Do not claim ownership of Google's or upstream contributors' code.diff --git a/CarPlay/README.md b/CarPlay/README.mdnew file mode 100644index 0000000..3ead803--- /dev/null+++ b/CarPlay/README.md@@ -0,0 +1,3 @@+# Native integration source++See [architecture](../docs/ARCHITECTURE.md), [build instructions](../docs/BUILD.md), and [compatibility](../docs/COMPATIBILITY.md). All files in this directory are self-contained parts of YouTube Car.diff --git a/CarPlay/YCPBrowseLayout.m b/CarPlay/YCPBrowseLayout.mnew file mode 100644index 0000000..f01d0f8--- /dev/null+++ b/CarPlay/YCPBrowseLayout.m@@ -0,0 +1,57 @@+#import "YCPNative.h"+#import <objc/message.h>++static id YCPBrowseProperty(id object, NSString *name) {+ SEL getter = NSSelectorFromString(name);+ return [object respondsToSelector:getter] ? ((id (*)(id, SEL))objc_msgSend)(object, getter) : nil;+}++static BOOL YCPExcludedGridContext(id object) {+ NSString *name = NSStringFromClass([object class]);+ for (NSString *word in @[@"Search", @"Watch", @"Playlist", @"Queue", @"Engagement", @"Player", @"Panel", @"Comment", @"Metadata", @"Metapanel"])+ if ([name containsString:word]) return YES;+ return NO;+}++static BOOL YCPRecognizedBrowseContext(id object) {+ NSString *name = NSStringFromClass([object class]);+ for (NSString *word in @[@"Home", @"Browse", @"Subscriptions", @"Trending"])+ if ([name containsString:word]) return YES;+ id browseID = YCPBrowseProperty(object, @"browseID");+ return [browseID isKindOfClass:NSString.class] && [browseID hasPrefix:@"FE"];+}++BOOL YCPShouldOverrideBrowseGrid(id candidate, UIWindow *car) {+ if (!candidate || !car) return NO;+ // Do not guess that an unidentifiable section is a Home card. Search+ // results use horizontal rows; watch metadata contains unrelated columns.+ NSMutableArray *pending = [NSMutableArray arrayWithObject:candidate];+ NSHashTable *seen = [NSHashTable hashTableWithOptions:NSPointerFunctionsObjectPointerPersonality];+ BOOL recognized = NO, belongsToCar = NO;+ NSUInteger inspected = 0;+ while (pending.count && inspected++ < 64) {+ id object = pending.lastObject; [pending removeLastObject];+ if ([seen containsObject:object]) continue;+ [seen addObject:object];+ if (YCPExcludedGridContext(object)) return NO;+ recognized |= YCPRecognizedBrowseContext(object);+ if ([object isKindOfClass:UIView.class]) {+ UIView *view = object;+ if (view.window && view.window != car) return NO;+ belongsToCar |= view.window == car;+ if (view.nextResponder) [pending addObject:view.nextResponder];+ } else if ([object isKindOfClass:UIViewController.class]) {+ UIViewController *controller = object;+ if (controller.viewIfLoaded) [pending addObject:controller.viewIfLoaded];+ if (controller.parentViewController) [pending addObject:controller.parentViewController];+ } else if ([object isKindOfClass:UICollectionViewLayout.class]) {+ UICollectionView *collection = ((UICollectionViewLayout *)object).collectionView;+ if (collection) [pending addObject:collection];+ }+ for (NSString *property in @[@"model", @"feedController", @"viewController", @"collectionViewController", @"parentResponder"]) {+ id value = YCPBrowseProperty(object, property);+ if (value && value != object) [pending addObject:value];+ }+ }+ return recognized && belongsToCar;+}diff --git a/CarPlay/YCPHeaderLayout.m b/CarPlay/YCPHeaderLayout.mnew file mode 100644index 0000000..c8979a0--- /dev/null+++ b/CarPlay/YCPHeaderLayout.m@@ -0,0 +1,164 @@+#import "YCPNative.h"+#import <objc/runtime.h>+#import <objc/message.h>++static IMP YCPHeaderOriginalMove, YCPHeaderOriginalScroll, YCPHeaderOriginalSticky;+static IMP YCPHeaderOriginalBackground, YCPHeaderOriginalTint, YCPHeaderSuperTint;+static const void *YCPHeaderDesiredScroll = &YCPHeaderDesiredScroll;+static const void *YCPHeaderDesiredSticky = &YCPHeaderDesiredSticky;++static BOOL YCPScrollingHeaderInCar(UIView *header) {+ UIWindow *car = YCPSurface.shared.activeWindow;+ if (!car || header.window != car) return NO;+ for (UIResponder *responder = header; responder; responder = responder.nextResponder) {+ NSString *name = NSStringFromClass(responder.class);+ for (NSString *excluded in @[@"Search", @"Watch", @"Player", @"Engagement"])+ if ([name containsString:excluded]) return NO;+ }+ return YES;+}++static const void *YCPHeaderApplyingColorKey = &YCPHeaderApplyingColorKey;+static void YCPApplyHeaderColor(UIView *header) {+ if (!YCPScrollingHeaderInCar(header) || !YCPHeaderSuperTint || objc_getAssociatedObject(header, YCPHeaderApplyingColorKey)) return;+ objc_setAssociatedObject(header, YCPHeaderApplyingColorKey, @YES, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ UIColor *color = [UIColor colorWithWhite:15.0 / 255.0 alpha:1];+ // YouTube's override can clear the tint for translucent styles. Use the+ // navigation bar's own setter after that override, without recoloring icons.+ ((void (*)(id, SEL, id))YCPHeaderSuperTint)(header, NSSelectorFromString(@"setBarTintColor:"), color);+ header.backgroundColor = color;+ objc_setAssociatedObject(header, YCPHeaderApplyingColorKey, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+}+static void YCPHeaderBackground(UIView *header, SEL selector) {+ ((void (*)(id, SEL))YCPHeaderOriginalBackground)(header, selector);+ YCPApplyHeaderColor(header);+}+static void YCPHeaderTint(UIView *header, SEL selector, UIColor *color) {+ ((void (*)(id, SEL, id))YCPHeaderOriginalTint)(header, selector, color);+ YCPApplyHeaderColor(header);+}++static NSHashTable<UIView *> *YCPObservedHeaders;+static const void *YCPHeaderObservationKey = &YCPHeaderObservationKey;+static void *YCPHeaderOffsetContext = &YCPHeaderOffsetContext;++@interface YCPHeaderScrollObservation : NSObject+@property(nonatomic, weak) UIView *header;+@property(nonatomic, weak) UIScrollView *scroll;+@property(nonatomic) BOOL updating;+@end+@implementation YCPHeaderScrollObservation+- (void)dealloc {+ if (self.scroll) [self.scroll removeObserver:self forKeyPath:@"contentOffset" context:YCPHeaderOffsetContext];+}+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {+ if (context != YCPHeaderOffsetContext) {+ [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];+ return;+ }+ UIView *header = self.header;+ UIScrollView *scroll = self.scroll;+ if (self.updating || !YCPScrollingHeaderInCar(header) || scroll.window != header.window) return;+ CGFloat top = -scroll.adjustedContentInset.top;+ CGFloat bottom = MAX(top, scroll.contentSize.height - scroll.bounds.size.height + scroll.adjustedContentInset.bottom);+ CGPoint old = [change[NSKeyValueChangeOldKey] CGPointValue];+ CGPoint current = [change[NSKeyValueChangeNewKey] CGPointValue];+ CGFloat delta = MIN(bottom, MAX(top, current.y)) - MIN(bottom, MAX(top, old.y));+ if (current.y <= top + 1) delta = -1000; // Always reveal at the top, including scroll-to-top.+ if (fabs(delta) < 0.25 || !isfinite(delta)) return;+ SEL move = NSSelectorFromString(@"scrollNavHeaderViewWithOffset:");+ if (![header respondsToSelector:move]) return;+ self.updating = YES;+ ((void (*)(id, SEL, CGFloat))objc_msgSend)(header, move, delta);+ [header.superview setNeedsLayout];+ self.updating = NO;+}+@end++static UIView *YCPHeaderComboContainer(UIView *header) {+ for (UIView *parent = header.superview; parent; parent = parent.superview)+ if ([NSStringFromClass(parent.class) containsString:@"HeaderContentComboView"]) return parent;+ return header.superview;+}++void YCPRefreshHeaderScrollObservers(void) {+ for (UIView *header in YCPObservedHeaders.allObjects) {+ if (!YCPScrollingHeaderInCar(header)) {+ objc_setAssociatedObject(header, YCPHeaderObservationKey, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ continue;+ }+ UIView *container = YCPHeaderComboContainer(header);+ YCPHeaderScrollObservation *existing = objc_getAssociatedObject(header, YCPHeaderObservationKey);+ if (existing.scroll.window == header.window && [existing.scroll isDescendantOfView:container]) continue;+ UIScrollView *best = nil;+ CGFloat largest = 0;+ NSMutableArray *pending = [NSMutableArray arrayWithArray:container.subviews ?: @[]];+ while (pending.count) {+ UIView *view = pending.lastObject; [pending removeLastObject];+ if (view == header) continue;+ if ([view isKindOfClass:UIScrollView.class]) {+ UIScrollView *scroll = (id)view;+ BOOL vertical = scroll.alwaysBounceVertical || scroll.contentSize.height > scroll.bounds.size.height + 1;+ CGFloat area = scroll.bounds.size.width * scroll.bounds.size.height;+ if (vertical && scroll.bounds.size.height >= 120 && scroll.bounds.size.width >= container.bounds.size.width * 0.65 && area > largest) {+ best = scroll; largest = area;+ }+ }+ [pending addObjectsFromArray:view.subviews];+ }+ if (!best) continue;+ YCPHeaderScrollObservation *observer = [YCPHeaderScrollObservation new];+ observer.header = header; observer.scroll = best;+ [best addObserver:observer forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:YCPHeaderOffsetContext];+ objc_setAssociatedObject(header, YCPHeaderObservationKey, observer, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ }+}++static void YCPHeaderScrollEnabled(UIView *header, SEL selector, BOOL enabled) {+ objc_setAssociatedObject(header, YCPHeaderDesiredScroll, @(enabled), OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ ((void (*)(id, SEL, BOOL))YCPHeaderOriginalScroll)(header, selector, YCPScrollingHeaderInCar(header) ? YES : enabled);+}+static void YCPHeaderStickyEnabled(UIView *header, SEL selector, BOOL enabled) {+ objc_setAssociatedObject(header, YCPHeaderDesiredSticky, @(enabled), OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ ((void (*)(id, SEL, BOOL))YCPHeaderOriginalSticky)(header, selector, YCPScrollingHeaderInCar(header) ? NO : enabled);+}+static void YCPHeaderMovedToWindow(UIView *header, SEL selector) {+ ((void (*)(id, SEL))YCPHeaderOriginalMove)(header, selector);+ BOOL car = YCPScrollingHeaderInCar(header);+ NSNumber *scroll = objc_getAssociatedObject(header, YCPHeaderDesiredScroll);+ NSNumber *sticky = objc_getAssociatedObject(header, YCPHeaderDesiredSticky);+ // Keep native controls, geometry and resize animations; retain the app's scroll delegate.+ if (car || scroll) ((void (*)(id, SEL, BOOL))YCPHeaderOriginalScroll)(header, NSSelectorFromString(@"setHeaderScrollEnabled:"), car ? YES : scroll.boolValue);+ if (car || sticky) ((void (*)(id, SEL, BOOL))YCPHeaderOriginalSticky)(header, NSSelectorFromString(@"setStickyNavHeaderEnabled:"), car ? NO : sticky.boolValue);+ if (!YCPObservedHeaders) YCPObservedHeaders = [NSHashTable weakObjectsHashTable];+ [YCPObservedHeaders addObject:header];+ SEL reset = NSSelectorFromString(@"resetHeaderParamsForStatusBarUpdate");+ if ([header respondsToSelector:reset]) ((void (*)(id, SEL))objc_msgSend)(header, reset);+ SEL background = NSSelectorFromString(@"updateBackgroundColor");+ if ([header respondsToSelector:background]) ((void (*)(id, SEL))objc_msgSend)(header, background);+ YCPRefreshHeaderScrollObservers();+}+static IMP YCPHeaderReplace(Class cls, SEL selector, IMP replacement) {+ Method method = class_getInstanceMethod(cls, selector);+ if (!method) return NULL;+ IMP original = method_getImplementation(method);+ if (!class_addMethod(cls, selector, replacement, method_getTypeEncoding(method)))+ class_replaceMethod(cls, selector, replacement, method_getTypeEncoding(method));+ return original;+}+void YCPInstallHeaderLayoutHooks(void) {+ if (YCPHeaderOriginalMove) return;+ Class header = NSClassFromString(@"YTHeaderView");+ if (!header || !class_getInstanceMethod(header, NSSelectorFromString(@"setHeaderScrollEnabled:"))+ || !class_getInstanceMethod(header, NSSelectorFromString(@"setStickyNavHeaderEnabled:"))) return;+ SEL tint = NSSelectorFromString(@"setBarTintColor:");+ Method superTint = class_getInstanceMethod(class_getSuperclass(header), tint);+ if (superTint && class_getInstanceMethod(header, NSSelectorFromString(@"updateBackgroundColor"))) {+ YCPHeaderSuperTint = method_getImplementation(superTint);+ YCPHeaderOriginalTint = YCPHeaderReplace(header, tint, (IMP)YCPHeaderTint);+ YCPHeaderOriginalBackground = YCPHeaderReplace(header, NSSelectorFromString(@"updateBackgroundColor"), (IMP)YCPHeaderBackground);+ }+ YCPHeaderOriginalScroll = YCPHeaderReplace(header, NSSelectorFromString(@"setHeaderScrollEnabled:"), (IMP)YCPHeaderScrollEnabled);+ YCPHeaderOriginalSticky = YCPHeaderReplace(header, NSSelectorFromString(@"setStickyNavHeaderEnabled:"), (IMP)YCPHeaderStickyEnabled);+ YCPHeaderOriginalMove = YCPHeaderReplace(header, @selector(didMoveToWindow), (IMP)YCPHeaderMovedToWindow);+}diff --git a/CarPlay/YCPHooks.m b/CarPlay/YCPHooks.mnew file mode 100644index 0000000..c070873--- /dev/null+++ b/CarPlay/YCPHooks.m@@ -0,0 +1,325 @@+#import "YCPNative.h"+#import "YCPResponsiveLayout.h"+#import <objc/runtime.h>+#import <objc/message.h>++// Hooks stay within the YouTube process. No SpringBoard or CarPlay service injection.+// App-local native YouTube integration; no system-service injection.+static const void *YCPConfigurationIMPKey = &YCPConfigurationIMPKey;+static IMP YCPOriginalSetDelegate;+static IMP YCPOriginalSetRoot;+static IMP YCPOriginalBecomeFirstResponder;+static IMP YCPOriginalTextFieldInput;+static IMP YCPOriginalTextViewInput;+static IMP YCPOriginalSetWindowScene;+static IMP YCPOriginalViewDidLayout;++static IMP YCPOriginalPlaybackError;+static void YCPRecordPlaybackError(NSError *error, NSUInteger depth) {+ if (![error isKindOfClass:NSError.class] || depth > 5) return;+ // Record diagnostic identifiers only. Never dump URLs, request headers,+ // account details, response bodies, or arbitrary error userInfo values.+ NSMutableDictionary *status = [NSMutableDictionary new];+ for (NSString *key in @[@"statusCode", @"HTTPStatusCode", @"httpStatusCode", @"reasonCode", @"errorCode", @"NSURLErrorFailingURLPeerTrustErrorKey"])+ if ([error.userInfo[key] isKindOfClass:NSNumber.class]) status[key] = error.userInfo[key];+ YCPLog(@"Playback failure depth=%lu domain=%@ code=%ld status=%@", (unsigned long)depth, error.domain, (long)error.code, status);+ YCPRecordPlaybackError(error.userInfo[NSUnderlyingErrorKey], depth + 1);+ id multiple = error.userInfo[@"NSMultipleUnderlyingErrors"];+ if ([multiple isKindOfClass:NSArray.class])+ for (id nested in multiple) YCPRecordPlaybackError(nested, depth + 1);+}+static void YCPPlaybackError(id controller, SEL selector, NSError *error) {+ YCPRecordPlaybackError(error, 0);+ ((void (*)(id, SEL, id))YCPOriginalPlaybackError)(controller, selector, error);+}++static BOOL YCPAllowNativeCarStartup(id config, SEL selector) { return NO; }++void YCPBootstrapNativeScene(UIWindowScene *scene, UISceneSession *session, UISceneConnectionOptions *options) {+ id delegate = UIApplication.sharedApplication.delegate;+ Ivar mainWindowIvar = class_getInstanceVariable([delegate class], "_mainWindow");+ UIWindow *existing = mainWindowIvar ? object_getIvar(delegate, mainWindowIvar) : nil;+ if (existing.rootViewController) return;+ // Google's 21.42.4 scene router deliberately ignores non-phone roles. Run its+ // own startup against the car's real UIWindowScene, with only that app-local+ // feature check disabled for the duration of this call. No phone activation.+ Ivar configIvar = class_getInstanceVariable([delegate class], "_hotConfig");+ id config = configIvar ? object_getIvar(delegate, configIvar) : nil;+ Class configClass = [config class];+ SEL flag = NSSelectorFromString(@"mainAppCoreClientIos27SceneDelegateIgnoreNonRoleApplicationWindows");+ Method flagMethod = configClass && [config respondsToSelector:flag] ? class_getInstanceMethod(configClass, flag) : NULL;+ IMP original = flagMethod ? method_getImplementation(flagMethod) : NULL;+ if (original) {+ const char *types = method_getTypeEncoding(flagMethod);+ if (!class_addMethod(configClass, flag, (IMP)YCPAllowNativeCarStartup, types))+ class_replaceMethod(configClass, flag, (IMP)YCPAllowNativeCarStartup, types);+ }+ @try {+ SEL connect = @selector(scene:willConnectToSession:options:);+ if ([delegate respondsToSelector:connect]) {+ YCPLog(@"Cold CarPlay launch: starting Google's native scene lifecycle");+ ((void (*)(id, SEL, id, id, id))objc_msgSend)(delegate, connect, scene, session, options);+ }+ UIWindow *initializedWindow = mainWindowIvar ? object_getIvar(delegate, mainWindowIvar) : nil;+ if (!initializedWindow && mainWindowIvar) {+ UIWindow *bootstrapWindow = [[UIWindow alloc] initWithWindowScene:scene];+ [delegate setValue:bootstrapWindow forKey:@"mainWindow"];+ YCPLog(@"Created native startup window on CarPlay");+ }+ SEL foreground = @selector(sceneWillEnterForeground:);+ if ([delegate respondsToSelector:foreground]) ((void (*)(id, SEL, id))objc_msgSend)(delegate, foreground, scene);+ SEL active = @selector(sceneDidBecomeActive:);+ if ([delegate respondsToSelector:active]) ((void (*)(id, SEL, id))objc_msgSend)(delegate, active, scene);+ } @finally {+ if (original) class_replaceMethod(configClass, flag, original, method_getTypeEncoding(flagMethod));+ }+}++static void YCPInspectNativeRoot(UIViewController *root) {+ static BOOL inspected = NO;+ if (inspected || ![NSStringFromClass(root.class) isEqualToString:@"YTAppViewControllerImpl"]) return;+ inspected = YES;+ for (NSString *property in @[@"services", @"navigationProtocol", @"appEventHandler", @"parentResponder", @"eventGroupHandlers"]) {+ SEL getter = NSSelectorFromString(property);+ if (![root respondsToSelector:getter]) continue;+ id value = [root valueForKey:property];+ NSArray *objects = [value isKindOfClass:NSArray.class] ? value : (value ? @[value] : @[]);+ YCPLog(@"Startup dependency %@ class=%@ count=%lu", property, NSStringFromClass([value class]), (unsigned long)objects.count);+ for (id object in objects) {+ NSMutableArray *selectors = [NSMutableArray new];+ unsigned int count = 0;+ Method *methods = class_copyMethodList([object class], &count);+ for (unsigned int index = 0; index < count; index++) {+ NSString *name = NSStringFromSelector(method_getName(methods[index]));+ if ([name hasPrefix:@"init"] || [name hasPrefix:@"set"] || [name containsString:@"ViewController"])+ [selectors addObject:name];+ }+ free(methods);+ YCPLog(@"Startup component %@: %@", NSStringFromClass([object class]), [selectors componentsJoinedByString:@", "]);+ }+ }+}++static UISceneConfiguration *YCPSceneConfiguration(id object, SEL selector, UIApplication *application,+ UISceneSession *session, UISceneConnectionOptions *options) {+ if (YCPIsCarRole(session.role)) {+ UISceneConfiguration *configuration = [[UISceneConfiguration alloc] initWithName:@"YouTube CarPlay" sessionRole:session.role];+ BOOL isTemplate = [session.role isEqualToString:CPTemplateApplicationSceneSessionRoleApplication];+ configuration.sceneClass = isTemplate ? CPTemplateApplicationScene.class : UIWindowScene.class;+ configuration.delegateClass = isTemplate ? YCPTemplateDelegate.class : YCPWindowDelegate.class;+ YCPLog(@"Route scene: %@ delegate=%@", session.role, NSStringFromClass(configuration.delegateClass));+ return configuration;+ }+ // Each delegate class owns its original implementation. A new delegate cannot+ // accidentally overwrite the original for another class.+ IMP original = NULL;+ for (Class cls = object_getClass(object); cls && !original; cls = class_getSuperclass(cls))+ original = [objc_getAssociatedObject(cls, YCPConfigurationIMPKey) pointerValue];+ if (original) return ((id (*)(id, SEL, id, id, id))original)(object, selector, application, session, options);+ // YouTube 21.42.4's original scene manifest is kept intact when packaging.+ NSArray *configurations = NSBundle.mainBundle.infoDictionary[@"UIApplicationSceneManifest"][@"UISceneConfigurations"][session.role];+ NSDictionary *entry = configurations.firstObject;+ UISceneConfiguration *configuration = [[UISceneConfiguration alloc] initWithName:entry[@"UISceneConfigurationName"] sessionRole:session.role];+ configuration.sceneClass = NSClassFromString(entry[@"UISceneClassName"] ?: @"UIWindowScene");+ configuration.delegateClass = NSClassFromString(entry[@"UISceneDelegateClassName"] ?: @"YTSceneDelegate");+ return configuration;+}++static void YCPSetDelegate(UIApplication *application, SEL selector, id delegate) {+ if (delegate) {+ Class cls = object_getClass(delegate);+ SEL route = @selector(application:configurationForConnectingSceneSession:options:);+ Method method = class_getInstanceMethod(cls, route);+ IMP current = method ? method_getImplementation(method) : NULL;+ if (current != (IMP)YCPSceneConfiguration) {+ if (current) objc_setAssociatedObject(cls, YCPConfigurationIMPKey, [NSValue valueWithPointer:current], OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ const char *types = method ? method_getTypeEncoding(method) : "@@:@@@";+ if (!class_addMethod(cls, route, (IMP)YCPSceneConfiguration, types))+ class_replaceMethod(cls, route, (IMP)YCPSceneConfiguration, types);+ YCPLog(@"Installed scene routing on %@", NSStringFromClass(cls));+ }+ }+ ((void (*)(id, SEL, id))YCPOriginalSetDelegate)(application, selector, delegate);+}++static void YCPSetRoot(UIWindow *window, SEL selector, UIViewController *controller) {+ if ([YCPSurface.shared ownsNativeController:controller] && window != YCPSurface.shared.activeWindow) {+ // Google's -load can target its global phone window. The car controller+ // is already hosted in its own window; never replace the phone interface.+ YCPLog(@"Kept car controller out of Google's phone window");+ return;+ }+ ((void (*)(id, SEL, id))YCPOriginalSetRoot)(window, selector, controller);+ // YouTube constructs its root asynchronously. Observe completion rather than+ // assuming a root exists at CarPlay connection time.+ if (controller && [controller isKindOfClass:NSClassFromString(@"YTAppViewControllerImpl")]) {+ dispatch_async(dispatch_get_main_queue(), ^{ [YCPSurface.shared reconcile]; });+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC), dispatch_get_main_queue(), ^{ YCPInspectNativeRoot(controller); });+ }+}++static void YCPSetWindowScene(UIWindow *window, SEL selector, UIWindowScene *scene) {+ ((void (*)(id, SEL, id))YCPOriginalSetWindowScene)(window, selector, scene);+ if ([scene.session.role isEqualToString:UIWindowSceneSessionRoleApplication]) {+ [YCPSurface.shared sourceWindowMovedToPhone:window];+ }+}++static void YCPViewDidLayout(UIViewController *controller, SEL selector) {+ ((void (*)(id, SEL))YCPOriginalViewDidLayout)(controller, selector);+ UIWindow *car = YCPSurface.shared.activeWindow;+ if (!car || controller.viewIfLoaded.window != car) return;+ YCPRefreshHeaderScrollObservers();+ if (!controller.presentingViewController) return;+ // YouTube's search header uses frame-based positions and ignores extra+ // safe-area insets. Move the presented viewport, not just its safe area.+ UIView *presentedView = controller.viewIfLoaded;+ BOOL search = [NSStringFromClass(controller.class) containsString:@"Search"];+ for (UIViewController *child in controller.childViewControllers)+ if ([NSStringFromClass(child.class) containsString:@"Search"]) search = YES;+ // Playback presentations own their geometry. Applying search's viewport+ // correction to them fights the native player's layout on every update.+ if (search && !controller.parentViewController && presentedView.superview) {+ CGFloat left = car.safeAreaInsets.left + 8;+ CGRect viewport = UIEdgeInsetsInsetRect(car.bounds, UIEdgeInsetsMake(0, left, 0, MAX(8, car.safeAreaInsets.right)));+ CGRect frame = [car convertRect:viewport toView:presentedView.superview];+ CGFloat scale = YCPContentScaleForSize(viewport.size);+ CGRect bounds = CGRectMake(0, 0, frame.size.width / scale, frame.size.height / scale);+ CGPoint center = CGPointMake(CGRectGetMidX(frame), CGRectGetMidY(frame));+ CGAffineTransform transform = CGAffineTransformMakeScale(scale, scale);+ if (!CGRectEqualToRect(presentedView.bounds, bounds) || !CGAffineTransformEqualToTransform(presentedView.transform, transform) || !CGPointEqualToPoint(presentedView.center, center)) {+ presentedView.bounds = bounds;+ presentedView.center = center;+ presentedView.transform = transform;+ [presentedView setNeedsLayout];+ }+ UIEdgeInsets extra = controller.additionalSafeAreaInsets;+ if (extra.left != 0) { extra.left = 0; controller.additionalSafeAreaInsets = extra; }+ }+ // Input activation is handled by becomeFirstResponder below; avoid walking+ // the entire playback hierarchy on every controller layout update.+}++static BOOL YCPBecomeFirstResponder(UIResponder *responder, SEL selector) {+ BOOL accepted = ((BOOL (*)(id, SEL))YCPOriginalBecomeFirstResponder)(responder, selector);+ if (accepted && [responder isKindOfClass:UIView.class]) {+ dispatch_async(dispatch_get_main_queue(), ^{ [YCPSurface.shared textInputBecameActive:(UIView *)responder]; });+ }+ return accepted;+}++static UIView *YCPInputView(id object, SEL selector, IMP original) {+ UIWindow *car = YCPSurface.shared.activeWindow;+ if (car && ((UIView *)object).window == car) {+ static UIView *empty;+ static dispatch_once_t once;+ dispatch_once(&once, ^{ empty = [[UIView alloc] initWithFrame:CGRectZero]; });+ return empty;+ }+ return ((id (*)(id, SEL))original)(object, selector);+}+static UIView *YCPTextFieldInput(id object, SEL selector) { return YCPInputView(object, selector, YCPOriginalTextFieldInput); }+static UIView *YCPTextViewInput(id object, SEL selector) { return YCPInputView(object, selector, YCPOriginalTextViewInput); }++static IMP YCPReplace(Class cls, SEL selector, IMP replacement) {+ Method method = class_getInstanceMethod(cls, selector);+ IMP original = method_getImplementation(method);+ // Never mutate a superclass's method when the target merely inherits it.+ if (!class_addMethod(cls, selector, replacement, method_getTypeEncoding(method)))+ class_replaceMethod(cls, selector, replacement, method_getTypeEncoding(method));+ return original;+}++// The feed's actual grid controls; trait changes alone leave phone responses+// at one column. Keep each ABI from YouTube 21.42.4's property declarations.+static IMP YCPOriginalFeedColumns, YCPOriginalGridOverride, YCPOriginalGridPrepare;+static IMP YCPOriginalSectionColumns, YCPOriginalLayoutColumns, YCPOriginalLayoutEnabled;+static BOOL YCPBrowseGrid(id object) {+ return YCPShouldOverrideBrowseGrid(object, YCPSurface.shared.activeWindow);+}+static NSUInteger YCPCarColumnCount(void) {+ CGFloat width = YCPSurface.shared.contentBounds.size.width;+ return width >= 780 ? 3 : width >= 500 ? 2 : 1;+}+static double YCPFeedColumns(id object, SEL selector) {+ if (YCPBrowseGrid(object)) return (double)YCPCarColumnCount();+ return ((double (*)(id, SEL))YCPOriginalFeedColumns)(object, selector);+}+static NSUInteger YCPGridOverride(id object, SEL selector) {+ if (YCPBrowseGrid(object)) return YCPCarColumnCount();+ return ((NSUInteger (*)(id, SEL))YCPOriginalGridOverride)(object, selector);+}+static NSUInteger YCPSectionColumns(id object, SEL selector) {+ if (YCPBrowseGrid(object)) return YCPCarColumnCount();+ return ((NSUInteger (*)(id, SEL))YCPOriginalSectionColumns)(object, selector);+}+static NSUInteger YCPLayoutColumns(UICollectionViewLayout *layout, SEL selector) {+ if (YCPBrowseGrid(layout) && layout.collectionView.window == YCPSurface.shared.activeWindow) return YCPCarColumnCount();+ return ((NSUInteger (*)(id, SEL))YCPOriginalLayoutColumns)(layout, selector);+}+static BOOL YCPLayoutEnabled(UICollectionViewLayout *layout, SEL selector) {+ if (YCPBrowseGrid(layout) && layout.collectionView.window == YCPSurface.shared.activeWindow) return YES;+ return ((BOOL (*)(id, SEL))YCPOriginalLayoutEnabled)(layout, selector);+}+static void YCPGridPrepare(UICollectionViewLayout *layout, SEL selector) {+ if (YCPBrowseGrid(layout) && layout.collectionView.window == YCPSurface.shared.activeWindow) {+ SEL enabled = NSSelectorFromString(@"setEnableGridLayout:");+ SEL columns = NSSelectorFromString(@"setNumberOfColumns:");+ if ([layout respondsToSelector:enabled]) ((void (*)(id, SEL, BOOL))objc_msgSend)(layout, enabled, YES);+ if ([layout respondsToSelector:columns]) ((void (*)(id, SEL, NSUInteger))objc_msgSend)(layout, columns, YCPCarColumnCount());+ }+ ((void (*)(id, SEL))YCPOriginalGridPrepare)(layout, selector);+}+static void YCPInstallFeedGrid(void) {+ YCPInstallWatchLayoutHooks();+ YCPInstallHeaderLayoutHooks();+ Class feed = NSClassFromString(@"YTFeedSectionController");+ Class section = NSClassFromString(@"YTSectionController");+ Class layout = NSClassFromString(@"YTGridCollectionViewFlowLayout");+ SEL count = NSSelectorFromString(@"numberOfColumns");+ SEL override = NSSelectorFromString(@"numberOfColumnsOverrideForGrid");+ if (feed && class_getInstanceMethod(feed, count)) YCPOriginalFeedColumns = YCPReplace(feed, count, (IMP)YCPFeedColumns);+ if (section && class_getInstanceMethod(section, count)) YCPOriginalSectionColumns = YCPReplace(section, count, (IMP)YCPSectionColumns);+ if (layout && class_getInstanceMethod(layout, count)) YCPOriginalLayoutColumns = YCPReplace(layout, count, (IMP)YCPLayoutColumns);+ SEL enabled = NSSelectorFromString(@"enableGridLayout");+ if (layout && class_getInstanceMethod(layout, enabled)) YCPOriginalLayoutEnabled = YCPReplace(layout, enabled, (IMP)YCPLayoutEnabled);+ if (section && class_getInstanceMethod(section, override)) YCPOriginalGridOverride = YCPReplace(section, override, (IMP)YCPGridOverride);+ if (layout && class_getInstanceMethod(layout, @selector(prepareLayout))) YCPOriginalGridPrepare = YCPReplace(layout, @selector(prepareLayout), (IMP)YCPGridPrepare);+}++@interface YCPBootstrap : NSObject @end+@implementation YCPBootstrap++ (void)load {+ // Use YouMod's supported iPad mode before Google's first feed request. A+ // trait override after startup cannot replace a phone-rendered response.+ [NSUserDefaults.standardUserDefaults setInteger:1 forKey:@"YouModDeviceUIIndex"];+ NSUserDefaults *defaults = NSUserDefaults.standardUserDefaults;+ if (![defaults boolForKey:@"YCPCarNativePlaybackMigration1"]) {+ // This option retries error 14 indefinitely; it does not repair the+ // failing TV-spoofed request. Restore native playback without the loop.+ [defaults setBool:NO forKey:@"YouModFixPlaybackIssues"];+ [defaults setBool:YES forKey:@"YCPCarNativePlaybackMigration1"];+ }+ YCPOriginalViewDidLayout = YCPReplace(UIViewController.class, @selector(viewDidLayoutSubviews), (IMP)YCPViewDidLayout);+ YCPOriginalSetDelegate = YCPReplace(UIApplication.class, @selector(setDelegate:), (IMP)YCPSetDelegate);+ YCPOriginalSetRoot = YCPReplace(UIWindow.class, @selector(setRootViewController:), (IMP)YCPSetRoot);+ YCPOriginalSetWindowScene = YCPReplace(UIWindow.class, @selector(setWindowScene:), (IMP)YCPSetWindowScene);+ YCPOriginalBecomeFirstResponder = YCPReplace(UIResponder.class, @selector(becomeFirstResponder), (IMP)YCPBecomeFirstResponder);+ YCPOriginalTextFieldInput = YCPReplace(UITextField.class, @selector(inputView), (IMP)YCPTextFieldInput);+ YCPOriginalTextViewInput = YCPReplace(UITextView.class, @selector(inputView), (IMP)YCPTextViewInput);+ [NSNotificationCenter.defaultCenter addObserverForName:UIApplicationDidFinishLaunchingNotification object:nil queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification *note) {+ YCPInstallFeedGrid();+ Class overlay = NSClassFromString(@"YTMainAppVideoPlayerOverlayViewController");+ SEL errorSelector = NSSelectorFromString(@"handleError:");+ if (overlay && class_getInstanceMethod(overlay, errorSelector) && !YCPOriginalPlaybackError)+ YCPOriginalPlaybackError = YCPReplace(overlay, errorSelector, (IMP)YCPPlaybackError);+ YCPLog(@"Native integration loaded; YouTube=%@ OS=%@", NSBundle.mainBundle.infoDictionary[@"CFBundleShortVersionString"], UIDevice.currentDevice.systemVersion);+ [YCPSurface.shared reconcile];+ }];+ for (NSNotificationName name in @[UITextFieldTextDidBeginEditingNotification, UITextViewTextDidBeginEditingNotification]) {+ [NSNotificationCenter.defaultCenter addObserverForName:name object:nil queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification *note) {+ if ([note.object isKindOfClass:UIView.class]) [YCPSurface.shared textInputBecameActive:note.object];+ }];+ }+}+@enddiff --git a/CarPlay/YCPKeyboard.swift b/CarPlay/YCPKeyboard.swiftnew file mode 100644index 0000000..102bccb--- /dev/null+++ b/CarPlay/YCPKeyboard.swift@@ -0,0 +1,256 @@+import SwiftUI+import UIKit+import AudioToolbox+import Observation++/// Touch keyboard sized to the visible car screen, with immediate key feedback.+struct YCPCarKeyboard: View {+ @Binding var text: String+ let placeholder: String+ var secure = false+ let onGo: () -> Void+ let onDone: () -> Void+ @State private var symbols = false+ @State private var shifted = false+ @AppStorage("browser.keyboard.arabic") private var arabic = false++ private var rows: [[String]] {+ if symbols {+ return [Array(arabic ? "١٢٣٤٥٦٧٨٩٠" : "1234567890").map(String.init), Array("@#$/&*()-_").map(String.init), Array(arabic ? "،.؟!\":;+=" : ".,?!'\":;+=" ).map(String.init)]+ }+ if arabic {+ return [Array("ضصثقفغعهخحجد").map(String.init), Array("شسيبلاتنمكط").map(String.init),+ ["ئ", "ء", "ؤ", "ر", "لا", "ى", "ة", "و", "ز", "ظ", "ذ"]]+ }+ return [Array("qwertyuiop").map(String.init), Array("asdfghjkl").map(String.init), Array("zxcvbnm").map(String.init)]+ }++ var body: some View {+ GeometryReader { geometry in+ let canvas = CGSize(width: min(geometry.size.width, 1060), height: min(geometry.size.height, 420))+ let metrics = CarKeyboardMetrics(size: canvas, arabic: arabic && !symbols, symbols: symbols)+ VStack(spacing: metrics.gap) {+ entryBar(metrics: metrics)+ .padding(.bottom, metrics.gap / 2)+ ForEach(rows.indices, id: \.self) { index in+ HStack(spacing: metrics.gap) {+ if index == 2 && !symbols && !arabic {+ key("shift", metrics: metrics, width: metrics.unit * 1.35,+ selected: shifted, symbol: true, secondary: true) { shifted.toggle() }+ .accessibilityLabel("Shift")+ .accessibilityValue(shifted ? "On" : "Off")+ }+ ForEach(rows[index], id: \.self) { character in+ let label = shifted && !symbols && !arabic ? character.uppercased() : character+ key(label, metrics: metrics, width: metrics.unit) {+ text += label+ if shifted { shifted = false }+ }+ .contextMenu {+ if arabic, character == "ا" {+ ForEach(["أ", "إ", "آ"], id: \.self) { variant in+ Button(variant) { BrowserKeyboardFeedback.shared.tap(); text += variant }+ }+ }+ }+ }+ if index == 2 {+ key("delete.left", metrics: metrics, width: metrics.unit * 1.35,+ symbol: true, secondary: true) {+ if !text.isEmpty { text.removeLast() }+ }+ .accessibilityLabel("Delete last character")+ }+ }+ .frame(maxWidth: .infinity)+ }+ HStack(spacing: metrics.gap) {+ key(symbols ? (arabic ? "أبج" : "ABC") : "123", metrics: metrics,+ width: metrics.unit * 1.4, secondary: true) { symbols.toggle() }+ .accessibilityLabel(symbols ? "Letters" : "Numbers and symbols")+ key(arabic ? "EN" : "عربي", metrics: metrics, width: metrics.unit * 1.4, secondary: true) {+ arabic.toggle(); shifted = false+ }+ .accessibilityLabel(arabic ? "Switch to English keyboard" : "Switch to Arabic keyboard")+ key(arabic ? "مسافة" : "Space", metrics: metrics) { text += " " }+ .accessibilityLabel("Space")+ key(arabic ? "بحث" : "Search", metrics: metrics, width: metrics.unit * 1.8,+ selected: true, trailingSymbol: "arrow.right", action: onGo)+ .accessibilityLabel(arabic ? "بحث" : "Go")+ }+ }+ .padding(metrics.inset)+ .frame(width: canvas.width, height: canvas.height)+ .frame(maxWidth: .infinity, maxHeight: .infinity)+ }+ .background(YCPKeyboardTheme.ground)+ .foregroundStyle(YCPKeyboardTheme.ink)+ .environment(\.layoutDirection, .leftToRight)+ .onAppear { BrowserKeyboardFeedback.shared.prepare() }+ }++ private func entryBar(metrics: CarKeyboardMetrics) -> some View {+ HStack(spacing: metrics.gap) {+ HStack(spacing: 10) {+ Image(systemName: "magnifyingglass")+ .font(.system(size: 22, weight: .medium))+ .foregroundStyle(YCPKeyboardTheme.inkMuted)+ ScrollViewReader { proxy in+ ScrollView(.horizontal, showsIndicators: false) {+ HStack(spacing: 4) {+ Text(text.isEmpty ? placeholder : secure ? String(repeating: "•", count: text.count) : text)+ .font(.system(size: metrics.entryFont, weight: .medium))+ .foregroundStyle(text.isEmpty ? YCPKeyboardTheme.inkMuted : YCPKeyboardTheme.ink)+ .environment(\.layoutDirection, arabic ? .rightToLeft : .leftToRight)+ if !text.isEmpty {+ RoundedRectangle(cornerRadius: 1).fill(YCPKeyboardTheme.accent)+ .frame(width: 2, height: metrics.entryFont + 4)+ }+ Color.clear.frame(width: 1).id("caret")+ }+ .frame(height: metrics.entryHeight)+ }+ .onChange(of: text) { _, _ in proxy.scrollTo("caret", anchor: .trailing) }+ }+ .accessibilityLabel(secure ? "Secure text entry" : "Text entry")+ .accessibilityValue(secure ? "Hidden" : text)+ if !text.isEmpty {+ Button {+ BrowserKeyboardFeedback.shared.tap(); text = ""+ } label: {+ Image(systemName: "xmark.circle.fill")+ .font(.system(size: 22, weight: .medium))+ .frame(width: 44, height: metrics.entryHeight)+ .contentShape(Rectangle())+ }+ .buttonStyle(.plain)+ .foregroundStyle(YCPKeyboardTheme.inkMuted)+ .accessibilityLabel("Clear text")+ }+ }+ .padding(.leading, metrics.inset)+ .background(YCPKeyboardTheme.surface, in: RoundedRectangle(cornerRadius: 10))+ .overlay(RoundedRectangle(cornerRadius: 10).strokeBorder(YCPKeyboardTheme.hairline))+ key("xmark", metrics: metrics, width: metrics.entryHeight, height: metrics.entryHeight,+ symbol: true, secondary: true, action: onDone)+ .accessibilityLabel("Close keyboard")+ }+ }++ private func key(_ label: String, metrics: CarKeyboardMetrics, width: CGFloat? = nil,+ height: CGFloat? = nil, selected: Bool = false, symbol: Bool = false,+ secondary: Bool = false, trailingSymbol: String? = nil,+ action: @escaping () -> Void) -> some View {+ Button {+ BrowserKeyboardFeedback.shared.tap()+ action()+ } label: {+ HStack(spacing: 6) {+ if symbol { Image(systemName: label) }+ else { Text(label).minimumScaleFactor(0.75).lineLimit(1) }+ if let trailingSymbol { Image(systemName: trailingSymbol).font(.system(size: metrics.font * 0.65, weight: .bold)) }+ }+ .font(.system(size: secondary || label.count > 2 ? metrics.font * 0.8 : metrics.font,+ weight: .medium))+ .frame(maxWidth: width == nil ? .infinity : nil)+ .frame(width: width, height: height ?? metrics.keyHeight)+ .contentShape(Rectangle())+ }+ .buttonStyle(BrowserKeyboardKeyStyle(selected: selected, secondary: secondary, primary: trailingSymbol != nil))+ }+}++/// Calculated from the actual keyboard bounds, independently of the page's design canvas.+private struct CarKeyboardMetrics {+ let gap: CGFloat+ let inset: CGFloat+ let entryHeight: CGFloat+ let keyHeight: CGFloat+ let unit: CGFloat+ let font: CGFloat+ let entryFont: CGFloat++ init(size: CGSize, arabic: Bool, symbols: Bool) {+ gap = size.height < 300 ? 4 : size.width < 600 ? 6 : 8+ inset = size.width < 600 ? 8 : 16+ entryHeight = min(58, max(44, size.height * 0.14))+ keyHeight = min(76, max(26, (size.height - entryHeight - inset * 2 - gap * 4.5) / 4))+ let columns: CGFloat = arabic ? 13 : symbols ? 12 : 10+ unit = max(16, (size.width - inset * 2 - gap * (columns - 1)) / columns)+ font = min(30, max(20, unit * 0.38))+ entryFont = min(26, max(20, entryHeight * 0.42))+ }+}++private struct BrowserKeyboardKeyStyle: ButtonStyle {+ @Environment(\.isFocused) private var focused+ @Environment(\.colorSchemeContrast) private var contrast+ let selected: Bool+ let secondary: Bool+ let primary: Bool++ func makeBody(configuration: Configuration) -> some View {+ let fill = primary ? YCPKeyboardTheme.accent : selected ? YCPKeyboardTheme.ink : configuration.isPressed ? Color(white: 0.32) : secondary ? YCPKeyboardTheme.surface : YCPKeyboardTheme.raised+ configuration.label+ .foregroundStyle(selected && !primary ? YCPKeyboardTheme.ground : YCPKeyboardTheme.ink)+ .background(fill,+ in: RoundedRectangle(cornerRadius: 10))+ .overlay(RoundedRectangle(cornerRadius: 10).strokeBorder(+ focused ? YCPKeyboardTheme.accent : contrast == .increased ? YCPKeyboardTheme.inkMuted : YCPKeyboardTheme.hairline,+ lineWidth: focused ? 3 : 1))+ .shadow(color: .black.opacity(configuration.isPressed ? 0 : 0.16), radius: 0, y: 2)+ // Keep the entire hit target stable; only its color changes under the finger.+ }+}++@MainActor+private final class BrowserKeyboardFeedback {+ static let shared = BrowserKeyboardFeedback()+ private let selection = UISelectionFeedbackGenerator()+ private var click: SystemSoundID = 0+ private init() {+ if let file = Bundle.main.url(forResource: "keyboard-click", withExtension: "wav")+ ?? Bundle.main.url(forResource: "keyboard-click", withExtension: "wav", subdirectory: "Browser") {+ AudioServicesCreateSystemSoundID(file as CFURL, &click)+ }+ }+ func prepare() { selection.prepare() }+ func tap() {+ selection.selectionChanged()+ selection.prepare()+ if click != 0 { AudioServicesPlaySystemSound(click) }+ }+}+++private enum YCPKeyboardTheme {+ static let ground = Color(white: 0.059)+ static let surface = Color(white: 0.125)+ static let raised = Color(white: 0.18)+ static let ink = Color.white+ static let inkMuted = Color(white: 0.67)+ static let accent = Color(red: 1, green: 0, blue: 0)+ static let hairline = Color.white.opacity(0.08)+}++private struct YCPKeyboardRoot: View {+ @State var text: String+ let secure: Bool+ let onChange: (String) -> Void+ let onGo: () -> Void+ let onDone: () -> Void+ var body: some View {+ YCPCarKeyboard(text: $text, placeholder: "Search YouTube", secure: secure, onGo: onGo, onDone: onDone)+ .preferredColorScheme(.dark)+ .onChange(of: text) { _, value in onChange(value) }+ }+}++@objc(YCPKeyboardFactory)+@MainActor final class YCPKeyboardFactory: NSObject {+ @objc(makeWithText:secure:onChange:onGo:onDone:)+ static func make(text: String, secure: Bool, onChange: @escaping (String) -> Void,+ onGo: @escaping () -> Void, onDone: @escaping () -> Void) -> UIViewController {+ UIHostingController(rootView: YCPKeyboardRoot(text: text, secure: secure, onChange: onChange, onGo: onGo, onDone: onDone))+ }+}diff --git a/CarPlay/YCPNative.h b/CarPlay/YCPNative.hnew file mode 100644index 0000000..da0aae4--- /dev/null+++ b/CarPlay/YCPNative.h@@ -0,0 +1,33 @@+#import <UIKit/UIKit.h>+#import <CarPlay/CarPlay.h>++NS_ASSUME_NONNULL_BEGIN+void YCPLog(NSString *format, ...) NS_FORMAT_FUNCTION(1, 2);+BOOL YCPIsCarRole(UISceneSessionRole role);+void YCPInstallWatchLayoutHooks(void);+void YCPInstallHeaderLayoutHooks(void);+void YCPRefreshHeaderScrollObservers(void);+BOOL YCPShouldOverrideBrowseGrid(id candidate, UIWindow * _Nullable car);+void YCPBootstrapNativeScene(UIWindowScene *scene, UISceneSession *session, UISceneConnectionOptions *options);++@interface YCPSurface : NSObject++ (instancetype)shared;+@property(nonatomic, readonly, nullable) UIWindow *activeWindow;+@property(nonatomic, readonly) CGRect contentBounds;+@property(nonatomic, readonly) UIEdgeInsets miniPlayerSafeInsets;+- (void)connectTemplate:(CPInterfaceController *)controller window:(nullable CPWindow *)window;+- (void)disconnectTemplate;+- (void)connectWindow:(UIWindow *)window;+- (void)disconnectWindow:(UIWindow *)window;+- (void)reconcile;+- (void)textInputBecameActive:(UIView *)view;+- (BOOL)ownsNativeController:(UIViewController *)controller;+- (void)sourceWindowMovedToPhone:(UIWindow *)window;+@end++@interface YCPTemplateDelegate : UIResponder <CPTemplateApplicationSceneDelegate>+@end+@interface YCPWindowDelegate : UIResponder <UIWindowSceneDelegate>+@property(nonatomic, strong, nullable) UIWindow *window;+@end+NS_ASSUME_NONNULL_ENDdiff --git a/CarPlay/YCPNative.m b/CarPlay/YCPNative.mnew file mode 100644index 0000000..8a30a98--- /dev/null+++ b/CarPlay/YCPNative.m@@ -0,0 +1,437 @@+#import "YCPNative.h"+#import "YCPResponsiveLayout.h"+#import <objc/message.h>+#import <objc/runtime.h>++void YCPLog(NSString *format, ...) {+ va_list arguments;+ va_start(arguments, format);+ NSString *message = [[NSString alloc] initWithFormat:format arguments:arguments];+ va_end(arguments);+ NSLog(@"[YouTubeCarPlay] %@", message);+ // No account information, searches, cookies or video URLs are recorded.+ NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/YouTubeCarPlay.log"];+ @synchronized (YCPSurface.class) {+ if (![NSFileManager.defaultManager fileExistsAtPath:path])+ [NSFileManager.defaultManager createFileAtPath:path contents:nil attributes:nil];+ NSFileHandle *file = [NSFileHandle fileHandleForWritingAtPath:path];+ @try {+ [file seekToEndOfFile];+ [file writeData:[[NSString stringWithFormat:@"%@ %@\n", NSDate.date, message] dataUsingEncoding:NSUTF8StringEncoding]];+ [file closeFile];+ } @catch (NSException *exception) { NSLog(@"[YouTubeCarPlay] Log file unavailable"); }+ }+}++BOOL YCPIsCarRole(UISceneSessionRole role) {+ return [role isEqualToString:CPTemplateApplicationSceneSessionRoleApplication]+ || [role isEqualToString:@"UIWindowSceneSessionRoleCarPlay"]+ || [role isEqualToString:UIWindowSceneSessionRoleExternalDisplayNonInteractive];+}++static id YCPReadObject(id object, NSString *name) {+ SEL selector = NSSelectorFromString(name);+ return [object respondsToSelector:selector] ? ((id (*)(id, SEL))objc_msgSend)(object, selector) : nil;+}++@interface YCPHost : UIViewController+@property(nonatomic, strong) UIViewController *nativeController;+@property(nonatomic, strong) YCPScaledContentView *content;+@property(nonatomic, strong) UIStackView *keyboard;+@property(nonatomic, weak) UIView<UIKeyInput> *inputTarget;+@property(nonatomic, strong) UILabel *status;+@property(nonatomic) BOOL originalTranslatesAutoresizingMask;+@property(nonatomic, strong) UIWindow *keyboardWindow;+@property(nonatomic, strong) NSLayoutConstraint *leftInset;+- (void)embed:(UIViewController *)controller;+- (void)releaseNative;+- (void)showKeyboardFor:(UIView<UIKeyInput> *)target;+@end++@implementation YCPHost+- (UIButton *)button:(NSString *)title action:(SEL)action {+ UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];+ [button setTitle:title forState:UIControlStateNormal];+ button.titleLabel.font = [UIFont systemFontOfSize:17 weight:UIFontWeightSemibold];+ button.accessibilityLabel = title;+ [button addTarget:self action:action forControlEvents:UIControlEventTouchUpInside];+ return button;+}+- (void)viewDidLoad {+ [super viewDidLoad];+ self.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;+ // Draw YouTube's surface edge to edge; only interactive content is inset+ // by the CarPlay safe-area guide below.+ UIColor *surface = [UIColor colorWithWhite:15.0 / 255.0 alpha:1];+ self.view.backgroundColor = surface;+ self.content = [YCPScaledContentView new];+ self.content.backgroundColor = surface;+ self.keyboard = [UIStackView new];+ self.keyboard.axis = UILayoutConstraintAxisVertical;+ self.keyboard.spacing = 4;+ self.keyboard.hidden = YES;+ self.keyboard.backgroundColor = [UIColor colorWithWhite:0.12 alpha:1];+ for (NSString *row in @[@"1234567890", @"qwertyuiop", @"asdfghjkl", @"zxcvbnm"]) {+ UIStackView *keys = [UIStackView new];+ keys.distribution = UIStackViewDistributionFillEqually;+ for (NSUInteger index = 0; index < row.length; index++) {+ UIButton *key = [self button:[row substringWithRange:NSMakeRange(index, 1)] action:@selector(typeKey:)];+ [keys addArrangedSubview:key];+ }+ [keys.heightAnchor constraintEqualToConstant:38].active = YES;+ [self.keyboard addArrangedSubview:keys];+ }+ UIStackView *controls = [UIStackView new];+ controls.distribution = UIStackViewDistributionFillEqually;+ [controls addArrangedSubview:[self button:@"Space" action:@selector(typeSpace)]];+ [controls addArrangedSubview:[self button:@"Delete" action:@selector(deleteKey)]];+ [controls addArrangedSubview:[self button:@"Search" action:@selector(submitSearch)]];+ [controls addArrangedSubview:[self button:@"Done" action:@selector(hideKeyboard)]];+ [controls.heightAnchor constraintEqualToConstant:42].active = YES;+ [self.keyboard addArrangedSubview:controls];+ UIStackView *stack = [[UIStackView alloc] initWithArrangedSubviews:@[self.content, self.keyboard]];+ stack.axis = UILayoutConstraintAxisVertical;+ stack.translatesAutoresizingMaskIntoConstraints = NO;+ [self.view addSubview:stack];+ UILayoutGuide *safe = self.view.safeAreaLayoutGuide;+ self.leftInset = [stack.leadingAnchor constraintEqualToAnchor:safe.leadingAnchor];+ [NSLayoutConstraint activateConstraints:@[+ self.leftInset,+ [stack.trailingAnchor constraintEqualToAnchor:safe.trailingAnchor],+ [stack.topAnchor constraintEqualToAnchor:safe.topAnchor],+ [stack.bottomAnchor constraintEqualToAnchor:safe.bottomAnchor]+ ]];+ self.status = [UILabel new];+ self.status.text = @"Opening YouTube…";+ self.status.numberOfLines = 0;+ self.status.textAlignment = NSTextAlignmentCenter;+ self.status.textColor = UIColor.whiteColor;+ self.status.translatesAutoresizingMaskIntoConstraints = NO;+ [self.content addSubview:self.status];+ [NSLayoutConstraint activateConstraints:@[+ [self.status.centerYAnchor constraintEqualToAnchor:self.content.centerYAnchor],+ [self.status.leadingAnchor constraintEqualToAnchor:self.content.leadingAnchor constant:20],+ [self.status.trailingAnchor constraintEqualToAnchor:self.content.trailingAnchor constant:-20]+ ]];+}+- (void)viewSafeAreaInsetsDidChange {+ [super viewSafeAreaInsetsDidChange];+ self.leftInset.constant = 0;+}+- (void)embed:(UIViewController *)controller {+ [self loadViewIfNeeded];+ if (self.nativeController == controller) return;+ [self releaseNative];+ self.nativeController = controller;+ self.originalTranslatesAutoresizingMask = controller.view.translatesAutoresizingMaskIntoConstraints;+ controller.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;+ [self addChildViewController:controller];+ controller.view.translatesAutoresizingMaskIntoConstraints = NO;+ [self.content.canvas addSubview:controller.view];+ [NSLayoutConstraint activateConstraints:@[+ [controller.view.leadingAnchor constraintEqualToAnchor:self.content.canvas.leadingAnchor],+ [controller.view.trailingAnchor constraintEqualToAnchor:self.content.canvas.trailingAnchor],+ [controller.view.topAnchor constraintEqualToAnchor:self.content.canvas.topAnchor],+ [controller.view.bottomAnchor constraintEqualToAnchor:self.content.canvas.bottomAnchor]+ ]];+ [self.content setNeedsLayout];+ [self.content layoutIfNeeded];+ [controller didMoveToParentViewController:self];+ self.status.hidden = YES;+}+- (void)releaseNative {+ if (!self.nativeController) return;+ [self.nativeController willMoveToParentViewController:nil];+ [self.nativeController.view removeFromSuperview];+ [self.nativeController removeFromParentViewController];+ self.nativeController.view.translatesAutoresizingMaskIntoConstraints = self.originalTranslatesAutoresizingMask;+ self.nativeController = nil;+ self.status.hidden = NO;+ [self hideKeyboard];+}+- (void)showKeyboardFor:(UIView<UIKeyInput> *)target {+ if (self.inputTarget == target && self.keyboardWindow) return;+ self.inputTarget = target;+ UIWindowScene *scene = target.window.windowScene;+ if (!scene) return;+ Class factory = NSClassFromString(@"YCPKeyboardFactory");+ SEL make = NSSelectorFromString(@"makeWithText:secure:onChange:onGo:onDone:");+ if (![factory respondsToSelector:make]) return;+ self.keyboardWindow = [[UIWindow alloc] initWithWindowScene:scene];+ self.keyboardWindow.windowLevel = UIWindowLevelAlert + 1;+ NSString *text = [target respondsToSelector:@selector(text)] ? [(id)target text] : @"";+ BOOL secure = [target respondsToSelector:@selector(isSecureTextEntry)] && [(id)target isSecureTextEntry];+ __weak typeof(self) weakSelf = self;+ void (^changed)(NSString *) = ^(NSString *value) {+ UIView<UIKeyInput> *input = weakSelf.inputTarget;+ if ([input conformsToProtocol:@protocol(UITextInput)]) {+ id<UITextInput> editor = (id)input;+ UITextRange *all = [editor textRangeFromPosition:editor.beginningOfDocument toPosition:editor.endOfDocument];+ [editor replaceRange:all withText:value];+ }+ };+ void (^go)(void) = ^{ [weakSelf submitSearch]; };+ void (^done)(void) = ^{ [weakSelf hideKeyboard]; };+ UIViewController *keys = ((id (*)(id, SEL, id, BOOL, id, id, id))objc_msgSend)(factory, make, text ?: @"", secure, changed, go, done);+ self.keyboardWindow.rootViewController = keys;+ self.keyboardWindow.hidden = NO;+}+- (void)hideKeyboard {+ self.keyboardWindow.hidden = YES;+ self.keyboardWindow = nil;+ self.keyboard.hidden = YES;+ [self.inputTarget resignFirstResponder];+ self.inputTarget = nil;+}+- (void)typeKey:(UIButton *)sender { [self.inputTarget insertText:sender.currentTitle]; }+- (void)typeSpace { [self.inputTarget insertText:@" "]; }+- (void)deleteKey { [self.inputTarget deleteBackward]; }+- (void)submitSearch {+ id target = self.inputTarget;+ if ([target isKindOfClass:UITextField.class]) {+ UITextField *field = target;+ if ([field.delegate respondsToSelector:@selector(textFieldShouldReturn:)]) [field.delegate textFieldShouldReturn:field];+ else [field sendActionsForControlEvents:UIControlEventEditingDidEndOnExit];+ } else [target insertText:@"\n"];+ [self hideKeyboard];+}+- (UIInterfaceOrientationMask)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAllButUpsideDown; }+- (BOOL)prefersStatusBarHidden { return YES; }+@end++@interface YCPSurface ()+@property(nonatomic, strong) CPInterfaceController *interfaceController;+@property(nonatomic, weak) UIWindow *templateWindow;+@property(nonatomic, weak) UIWindow *sceneWindow;+@property(nonatomic, strong) UIWindow *phoneWindow;+@property(nonatomic, strong) UIViewController *nativeController;+@property(nonatomic, strong) YCPHost *host;+@property(nonatomic, strong) UIViewController *phonePlaceholder;+@property(nonatomic, strong) NSTimer *retryTimer;+@property(nonatomic) NSUInteger attempts;+@property(nonatomic) BOOL reconciling;+@property(nonatomic) BOOL requestedPhoneScene;+@end++@implementation YCPSurface++ (instancetype)shared {+ static YCPSurface *surface;+ static dispatch_once_t once;+ dispatch_once(&once, ^{ surface = [YCPSurface new]; });+ return surface;+}+- (UIWindow *)activeWindow { return self.sceneWindow ?: self.templateWindow; }+- (CGRect)contentBounds {+ UIView *view = self.nativeController.viewIfLoaded ?: self.activeWindow.rootViewController.viewIfLoaded;+ return view ? view.bounds : self.activeWindow.bounds;+}+- (UIEdgeInsets)miniPlayerSafeInsets {+ UIEdgeInsets insets = self.nativeController.viewIfLoaded ? self.nativeController.viewIfLoaded.safeAreaInsets : UIEdgeInsetsZero;+ id pivot = YCPReadObject(self.nativeController, @"pivotBarViewController");+ UIView *bar = [pivot isKindOfClass:UIViewController.class] ? ((UIViewController *)pivot).viewIfLoaded : nil;+ if (bar && !bar.hidden && bar.window == self.activeWindow) {+ CGFloat height = bar.bounds.size.height;+ insets.bottom = MAX(insets.bottom, height > 0 && height < 100 ? height + 8 : 64);+ }+ return insets;+}+- (BOOL)ownsNativeController:(UIViewController *)controller { return controller && controller == self.nativeController; }+- (void)sourceWindowMovedToPhone:(UIWindow *)window {+ if (window != self.phoneWindow) return;+ window.hidden = NO;+ [window makeKeyAndVisible];+ YCPLog(@"Native phone window activated alongside CarPlay");+}+- (void)connectTemplate:(CPInterfaceController *)controller window:(CPWindow *)window {+ YCPLog(@"Template connected: window=%@", window ? NSStringFromCGRect(window.bounds) : @"none");+ self.interfaceController = controller;+ self.templateWindow = window;+ if (self.activeWindow) {+ [controller setRootTemplate:[[CPListTemplate alloc] initWithTitle:@"YouTube" sections:@[]] animated:NO completion:nil];+ } else {+ CPListItem *item = [[CPListItem alloc] initWithText:@"Waiting for a CarPlay window" detailText:@"Native YouTube needs a drawable car display. Open YouTube Car on your iPhone to finish setup."];+ [controller setRootTemplate:[[CPListTemplate alloc] initWithTitle:@"YouTube" sections:@[[[CPListSection alloc] initWithItems:@[item]]]] animated:NO completion:nil];+ }+ [self reconcile];+}+- (void)disconnectTemplate {+ YCPLog(@"Template disconnected");+ UIWindow *old = self.templateWindow;+ self.templateWindow = nil;+ self.interfaceController = nil;+ if (old.rootViewController == self.host) old.rootViewController = nil;+ [self reconcile];+}+- (void)connectWindow:(UIWindow *)window {+ YCPLog(@"Window connected: role=%@ bounds=%@", window.windowScene.session.role, NSStringFromCGRect(window.bounds));+ if (self.sceneWindow != window && self.sceneWindow.rootViewController == self.host)+ self.sceneWindow.rootViewController = nil;+ self.sceneWindow = window;+ [self reconcile];+}+- (void)disconnectWindow:(UIWindow *)window {+ YCPLog(@"Window disconnected");+ if (self.sceneWindow != window) return;+ self.sceneWindow = nil;+ if (window.rootViewController == self.host) window.rootViewController = nil;+ [self reconcile];+}+- (UIWindow *)findPhoneWindow {+ UIWindow *best = nil;+ for (UIScene *scene in UIApplication.sharedApplication.connectedScenes) {+ if (![scene isKindOfClass:UIWindowScene.class] || ![scene.session.role isEqualToString:UIWindowSceneSessionRoleApplication]) continue;+ for (UIWindow *window in ((UIWindowScene *)scene).windows) {+ UIViewController *root = window.rootViewController;+ if (!root || [root isKindOfClass:YCPHost.class] || window.windowLevel != UIWindowLevelNormal) continue;+ if (!best || window.isKeyWindow) best = window;+ }+ }+ if (!best) {+ id delegate = UIApplication.sharedApplication.delegate;+ Ivar ivar = class_getInstanceVariable([delegate class], "_mainWindow");+ UIWindow *nativeWindow = ivar ? object_getIvar(delegate, ivar) : nil;+ if ([nativeWindow.rootViewController isKindOfClass:NSClassFromString(@"YTAppViewControllerImpl")]) best = nativeWindow;+ }+ return best;+}+- (void)restorePhone {+ [self.retryTimer invalidate]; self.retryTimer = nil;+ UIViewController *native = self.nativeController;+ [self.host releaseNative];+ // Clear ownership before assigning the root: the window hook otherwise+ // correctly prevents an owned car controller from moving back to the phone.+ self.nativeController = nil;+ if (native && self.phoneWindow.rootViewController == self.phonePlaceholder) {+ self.phoneWindow.rootViewController = native;+ [self.phoneWindow makeKeyAndVisible];+ YCPLog(@"Restored initialized YouTube interface to source window");+ }+ self.phonePlaceholder = nil;+ self.phoneWindow = nil;+ self.host = nil;+ self.requestedPhoneScene = NO;+ self.attempts = 0;+}+- (void)scheduleRetry {+ if (self.retryTimer || self.attempts >= 90) return;+ __weak typeof(self) weakSelf = self;+ self.retryTimer = [NSTimer scheduledTimerWithTimeInterval:1 repeats:YES block:^(NSTimer *timer) {+ YCPSurface *owner = weakSelf;+ if (!owner || ++owner.attempts >= 90) {+ [timer invalidate]; owner.retryTimer = nil;+ owner.host.status.text = @"Open YouTube Car on your phone, then reconnect CarPlay.";+ YCPLog(@"Native scene initialization timed out");+ return;+ }+ [owner reconcile];+ }];+}+- (void)reconcile {+ NSAssert(NSThread.isMainThread, @"CarPlay UI must run on main thread");+ if (self.reconciling) return;+ self.reconciling = YES;+ @try {+ UIWindow *destination = self.activeWindow;+ if (!destination) { [self restorePhone]; return; }+ if (!self.host) self.host = [YCPHost new];+ destination.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;+ if (destination.rootViewController != self.host) {+ // A CPWindow and a window scene can arrive in either order. One host owns+ // the native controller; moving surfaces must never duplicate the player.+ for (UIWindow *other in @[self.templateWindow ?: destination, self.sceneWindow ?: destination])+ if (other != destination && other.rootViewController == self.host) other.rootViewController = nil;+ destination.rootViewController = self.host;+ [destination makeKeyAndVisible];+ }+ if (self.nativeController) return;+ UIWindow *phone = [self findPhoneWindow];+ if (phone) {+ UIViewController *phoneRoot = phone.rootViewController;+ Class nativeClass = NSClassFromString(@"YTAppViewControllerImpl");+ if (!nativeClass || ![phoneRoot isKindOfClass:nativeClass]) {+ YCPLog(@"Waiting for Google's initialized native root, current=%@", NSStringFromClass(phoneRoot.class));+ [self scheduleRetry];+ return;+ }+ // The independent root rendered the pivot bar but had an empty+ // navigation stack. Reuse Google's initialized tree and its existing+ // account, navigation, event handlers and playback services instead.+ id navigation = YCPReadObject(phoneRoot, @"appNavigationController");+ NSArray *stack = YCPReadObject(navigation, @"viewControllers");+ if (stack.count == 0) {+ self.host.status.text = @"Waiting for YouTube to finish loading on the phone…";+ [self scheduleRetry];+ return;+ }+ self.phoneWindow = phone;+ self.nativeController = phoneRoot;+ UIViewController *placeholder = [UIViewController new];+ placeholder.view.backgroundColor = UIColor.blackColor;+ UILabel *label = [UILabel new];+ label.text = @"YouTube is on the car display.\nDisconnect CarPlay to restore it here.";+ label.numberOfLines = 0;+ label.textColor = UIColor.whiteColor;+ label.textAlignment = NSTextAlignmentCenter;+ label.translatesAutoresizingMaskIntoConstraints = NO;+ [placeholder.view addSubview:label];+ [NSLayoutConstraint activateConstraints:@[+ [label.centerYAnchor constraintEqualToAnchor:placeholder.view.centerYAnchor],+ [label.leadingAnchor constraintEqualToAnchor:placeholder.view.leadingAnchor constant:24],+ [label.trailingAnchor constraintEqualToAnchor:placeholder.view.trailingAnchor constant:-24]+ ]];+ self.phonePlaceholder = placeholder;+ // Preserve phone UI idiom and size classes inside the car host.+ self.host.traitOverrides.userInterfaceIdiom = UIUserInterfaceIdiomPad;+ self.host.traitOverrides.horizontalSizeClass = UIUserInterfaceSizeClassRegular;+ self.host.traitOverrides.verticalSizeClass = UIUserInterfaceSizeClassRegular;+ phone.rootViewController = placeholder;+ [self.host embed:phoneRoot];+ [destination makeKeyAndVisible];+ if (YCPIsCarRole(phone.windowScene.session.role) && phone != destination) phone.hidden = YES;+ [self.retryTimer invalidate]; self.retryTimer = nil;+ YCPLog(@"Transferred initialized native root: %@ navigationDepth=%lu car=%@", NSStringFromClass(phoneRoot.class), (unsigned long)stack.count, NSStringFromCGRect(destination.bounds));+ } else {+ if (!self.requestedPhoneScene) {+ self.requestedPhoneScene = YES;+ YCPLog(@"Waiting for native startup services from the car scene");+ }+ [self scheduleRetry];+ }+ } @finally { self.reconciling = NO; }+}+- (void)textInputBecameActive:(UIView *)view {+ if (view.window != self.activeWindow || ![view conformsToProtocol:@protocol(UIKeyInput)]) return;+ [self.host showKeyboardFor:(id)view];+}+@end++@implementation YCPTemplateDelegate+- (void)templateApplicationScene:(CPTemplateApplicationScene *)scene didConnectInterfaceController:(CPInterfaceController *)controller toWindow:(CPWindow *)window {+ [YCPSurface.shared connectTemplate:controller window:window];+}+- (void)templateApplicationScene:(CPTemplateApplicationScene *)scene didConnectInterfaceController:(CPInterfaceController *)controller {+ [YCPSurface.shared connectTemplate:controller window:nil];+}+- (void)templateApplicationScene:(CPTemplateApplicationScene *)scene didDisconnectInterfaceController:(CPInterfaceController *)controller fromWindow:(CPWindow *)window {+ [YCPSurface.shared disconnectTemplate];+}+- (void)templateApplicationScene:(CPTemplateApplicationScene *)scene didDisconnectInterfaceController:(CPInterfaceController *)controller {+ [YCPSurface.shared disconnectTemplate];+}+- (void)sceneDidBecomeActive:(UIScene *)scene { [YCPSurface.shared reconcile]; }+- (void)sceneDidDisconnect:(UIScene *)scene { [YCPSurface.shared disconnectTemplate]; }+@end++@implementation YCPWindowDelegate+- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)options {+ if (![scene isKindOfClass:UIWindowScene.class]) return;+ YCPBootstrapNativeScene((UIWindowScene *)scene, session, options);+ self.window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)scene];+ [YCPSurface.shared connectWindow:self.window];+}+- (void)sceneDidDisconnect:(UIScene *)scene {+ [YCPSurface.shared disconnectWindow:self.window];+ self.window = nil;+}+- (void)sceneDidBecomeActive:(UIScene *)scene { [YCPSurface.shared reconcile]; }+@enddiff --git a/CarPlay/YCPResponsiveLayout.h b/CarPlay/YCPResponsiveLayout.hnew file mode 100644index 0000000..684ec79--- /dev/null+++ b/CarPlay/YCPResponsiveLayout.h@@ -0,0 +1,12 @@+#import <UIKit/UIKit.h>++// Pure geometry shared by native layout hooks and the resize regression suite.+BOOL YCPShouldUseWideWatch(CGSize size);+CGRect YCPFitMiniPlayer(CGRect requested, CGRect contentBounds, UIEdgeInsets safeInsets);++// Native content lays out in logical points, then fits the actual car viewport.+CGFloat YCPContentScaleForSize(CGSize viewport);+@interface YCPScaledContentView : UIView+@property(nonatomic, readonly) UIView *canvas;+@property(nonatomic, readonly) CGFloat contentScale;+@enddiff --git a/CarPlay/YCPResponsiveLayout.m b/CarPlay/YCPResponsiveLayout.mnew file mode 100644index 0000000..662fa03--- /dev/null+++ b/CarPlay/YCPResponsiveLayout.m@@ -0,0 +1,50 @@+#import "YCPResponsiveLayout.h"++BOOL YCPShouldUseWideWatch(CGSize size) {+ // Leave room for a readable video/details column and a 260-point queue.+ return size.width >= 820 && size.height >= 300 && size.width > size.height;+}++CGRect YCPFitMiniPlayer(CGRect requested, CGRect contentBounds, UIEdgeInsets safeInsets) {+ CGRect safe = UIEdgeInsetsInsetRect(contentBounds, safeInsets);+ safe = CGRectInset(safe, 12, 12);+ if (safe.size.width <= 0 || safe.size.height <= 0 || CGRectIsEmpty(requested)) return requested;+ CGFloat width = MIN(320, MAX(180, safe.size.width * 0.30));+ // A 16:9 floating video, with enough surface for the native 44-point controls.+ width = MIN(width, MIN(safe.size.width, safe.size.height * 16.0 / 9.0));+ CGFloat height = width * 9.0 / 16.0;+ CGFloat x = MIN(MAX(requested.origin.x, CGRectGetMinX(safe)), CGRectGetMaxX(safe) - width);+ CGFloat y = MIN(MAX(requested.origin.y, CGRectGetMinY(safe)), CGRectGetMaxY(safe) - height);+ return CGRectMake(x, y, width, height);+}++CGFloat YCPContentScaleForSize(CGSize viewport) {+ if (viewport.width <= 0 || viewport.height <= 0) return 1;+ // Do not clamp to 0.5: small cars can have fewer than 410 usable points+ // after the system sidebar, which otherwise leaves the canvas below the+ // native wide-watch breakpoint and forces the phone's stacked player.+ return MIN(1, MIN(viewport.width / 1024.0, viewport.height / 600.0));+}++@implementation YCPScaledContentView+- (instancetype)initWithFrame:(CGRect)frame {+ if ((self = [super initWithFrame:frame])) {+ _canvas = [UIView new];+ _canvas.backgroundColor = [UIColor colorWithWhite:15.0 / 255.0 alpha:1];+ [self addSubview:_canvas];+ self.clipsToBounds = YES;+ }+ return self;+}+- (CGFloat)contentScale { return YCPContentScaleForSize(self.bounds.size); }+- (void)layoutSubviews {+ [super layoutSubviews];+ CGFloat scale = self.contentScale;+ CGRect bounds = CGRectMake(0, 0, self.bounds.size.width / scale, self.bounds.size.height / scale);+ CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds));+ CGAffineTransform transform = CGAffineTransformMakeScale(scale, scale);+ if (!CGRectEqualToRect(self.canvas.bounds, bounds)) self.canvas.bounds = bounds;+ if (!CGPointEqualToPoint(self.canvas.center, center)) self.canvas.center = center;+ if (!CGAffineTransformEqualToTransform(self.canvas.transform, transform)) self.canvas.transform = transform;+}+@enddiff --git a/CarPlay/YCPWatchLayout.m b/CarPlay/YCPWatchLayout.mnew file mode 100644index 0000000..3b791de--- /dev/null+++ b/CarPlay/YCPWatchLayout.m@@ -0,0 +1,146 @@+#import "YCPNative.h"+#import "YCPResponsiveLayout.h"+#import <objc/message.h>+#import <objc/runtime.h>++static const void *YCPWatchOriginalsKey = &YCPWatchOriginalsKey;++static IMP YCPWatchOriginal(id object, SEL selector) {+ for (Class cls = object_getClass(object); cls; cls = class_getSuperclass(cls)) {+ NSDictionary *methods = objc_getAssociatedObject(cls, YCPWatchOriginalsKey);+ NSValue *value = methods[NSStringFromSelector(selector)];+ if (value) return value.pointerValue;+ }+ return NULL;+}++static BOOL YCPCarWideWatchView(UIView *view) {+ UIWindow *car = YCPSurface.shared.activeWindow;+ return car && view && view.window == car && YCPShouldUseWideWatch(YCPSurface.shared.contentBounds.size);+}++static UIView *YCPWatchLayer(id object) {+ SEL getter = NSSelectorFromString(@"watchLayerView");+ id view = [object respondsToSelector:getter] ? ((id (*)(id, SEL))objc_msgSend)(object, getter) : nil;+ return [view isKindOfClass:UIView.class] ? view : nil;+}++static BOOL YCPWatchLayoutFlag(id object, SEL selector) {+ UIView *view = YCPWatchLayer(object);+ UIWindow *car = YCPSurface.shared.activeWindow;+ if (car && view.window == car) {+ CGSize size = YCPSurface.shared.contentBounds.size;+ if (selector == NSSelectorFromString(@"isLargeWideLayout")) return YCPShouldUseWideWatch(size);+ if (selector == NSSelectorFromString(@"isLandscape")) return size.width > size.height;+ return size.width >= 600;+ }+ IMP original = YCPWatchOriginal(object, selector);+ return original ? ((BOOL (*)(id, SEL))original)(object, selector) : NO;+}++static NSInteger YCPWatchOrientation(id object, SEL selector) {+ UIView *view = YCPWatchLayer(object);+ if (YCPSurface.shared.activeWindow && view.window == YCPSurface.shared.activeWindow) {+ CGSize size = YCPSurface.shared.contentBounds.size;+ return size.width > size.height ? UIInterfaceOrientationLandscapeLeft : UIInterfaceOrientationPortrait;+ }+ IMP original = YCPWatchOriginal(object, selector);+ return original ? ((NSInteger (*)(id, SEL))original)(object, selector) : UIInterfaceOrientationUnknown;+}++static BOOL YCPWideWatchDelegate(id object, SEL selector, UIView *watch) {+ if (YCPSurface.shared.activeWindow && watch.window == YCPSurface.shared.activeWindow) return YCPShouldUseWideWatch(YCPSurface.shared.contentBounds.size);+ IMP original = YCPWatchOriginal(object, selector);+ return original ? ((BOOL (*)(id, SEL, id))original)(object, selector, watch) : NO;+}++static CGFloat YCPWatchTopInset(id object, SEL selector) {+ UIView *view = [object isKindOfClass:UIViewController.class] ? ((UIViewController *)object).viewIfLoaded : nil;+ if (YCPCarWideWatchView(view)) return YCPSurface.shared.activeWindow.safeAreaInsets.top;+ IMP original = YCPWatchOriginal(object, selector);+ return original ? ((CGFloat (*)(id, SEL))original)(object, selector) : 0;+}++static UIEdgeInsets YCPNativeWindowInsets(UIView *view, SEL selector) {+ IMP original = YCPWatchOriginal(view, selector);+ UIEdgeInsets insets = original ? ((UIEdgeInsets (*)(id, SEL))original)(view, selector) : UIEdgeInsetsZero;+ UIWindow *car = YCPSurface.shared.activeWindow;+ // YouTube's category can use the phone window's cached status-bar height,+ // independently of the watch controller's statusBarHeight property.+ if (car && view.window == car) insets.top = car.safeAreaInsets.top;+ return insets;+}++static CGRect YCPMiniPlayerFrame(id object, SEL selector) {+ IMP original = YCPWatchOriginal(object, selector);+ CGRect frame = original ? ((CGRect (*)(id, SEL))original)(object, selector) : CGRectZero;+ if (!YCPSurface.shared.activeWindow) return frame;+ return YCPFitMiniPlayer(frame, YCPSurface.shared.contentBounds, YCPSurface.shared.miniPlayerSafeInsets);+}++// Keep the first below-player cell clear of the player's scrubber/clipping edge.+// Use the actual collection viewport, not phone dimensions or a scroll reset.+static UIEdgeInsets YCPWatchSectionInsets(UIViewController *controller, SEL selector, UICollectionView *collection, UICollectionViewLayout *layout, NSInteger section) {+ IMP original = YCPWatchOriginal(controller, selector);+ UIEdgeInsets insets = original ? ((UIEdgeInsets (*)(id, SEL, id, id, NSInteger))original)(controller, selector, collection, layout, section) : UIEdgeInsetsZero;+ UIWindow *car = YCPSurface.shared.activeWindow;+ if (section != 0 || !YCPCarWideWatchView(controller.viewIfLoaded) || collection.window != car) return insets;+ CGRect viewport = [collection convertRect:collection.bounds toView:car];+ // The metadata column is below the player, on the leading side. The queue+ // starts at the top on the trailing side and must retain its native insets.+ if (CGRectGetMinY(viewport) > car.safeAreaInsets.top + 44+ && CGRectGetMinX(viewport) < CGRectGetMidX(car.bounds)+ && CGRectGetWidth(viewport) < CGRectGetWidth(car.bounds) * 0.8)+ insets.top = MAX(12, insets.top);+ return insets;+}++static BOOL YCPSplitMetadataFix(id object, SEL selector) {+ if (YCPSurface.shared.activeWindow) return YES;+ IMP original = YCPWatchOriginal(object, selector);+ return original ? ((BOOL (*)(id, SEL))original)(object, selector) : NO;+}++static void YCPPatchWatch(Class cls, SEL selector, IMP replacement) {+ Method method = class_getInstanceMethod(cls, selector);+ if (!method || method_getImplementation(method) == replacement) return;+ NSMutableDictionary *methods = [objc_getAssociatedObject(cls, YCPWatchOriginalsKey) mutableCopy] ?: [NSMutableDictionary new];+ methods[NSStringFromSelector(selector)] = [NSValue valueWithPointer:method_getImplementation(method)];+ objc_setAssociatedObject(cls, YCPWatchOriginalsKey, methods, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ if (!class_addMethod(cls, selector, replacement, method_getTypeEncoding(method)))+ class_replaceMethod(cls, selector, replacement, method_getTypeEncoding(method));+}++void YCPInstallWatchLayoutHooks(void) {+ YCPPatchWatch(UIView.class, NSSelectorFromString(@"yt_safeAreaInsetsForWindow"), (IMP)YCPNativeWindowInsets);+ YCPPatchWatch(UIView.class, NSSelectorFromString(@"yt_safeAreaInsetsForBrowse"), (IMP)YCPNativeWindowInsets);+ // 21.42.4 implements this ObjC protocol in a Swift class with a mangled name.+ // Discover that implementation instead of depending on the Swift module name.+ Protocol *protocol = objc_getProtocol("YTWatchLayoutController");+ unsigned int count = 0;+ Class *classes = objc_copyClassList(&count);+ for (unsigned int index = 0; index < count; index++) {+ Class cls = classes[index];+ // Enable the native fix for metadata measured in a split watch column.+ SEL metadataFix = NSSelectorFromString(@"enableIosSplitMetadataViewFix");+ if (class_getInstanceMethod(cls, metadataFix))+ YCPPatchWatch(cls, metadataFix, (IMP)YCPSplitMetadataFix);+ if (!protocol || !class_conformsToProtocol(cls, protocol)+ || !class_getInstanceMethod(cls, NSSelectorFromString(@"watchLayerView"))) continue;+ for (NSString *name in @[@"isLargeLayout", @"isLargeWideLayout", @"isLandscape"])+ YCPPatchWatch(cls, NSSelectorFromString(name), (IMP)YCPWatchLayoutFlag);+ YCPPatchWatch(cls, NSSelectorFromString(@"interfaceOrientation"), (IMP)YCPWatchOrientation);+ }+ free(classes);+ Class results = NSClassFromString(@"YTWatchNextResultsViewController");+ if (results) YCPPatchWatch(results, NSSelectorFromString(@"collectionView:layout:insetForSectionAtIndex:"), (IMP)YCPWatchSectionInsets);+ Class mini = NSClassFromString(@"YTWatchMiniplayerLayoutOutput");+ if (mini) YCPPatchWatch(mini, NSSelectorFromString(@"miniplayerFrame"), (IMP)YCPMiniPlayerFrame);+ Class layer = NSClassFromString(@"YTWatchLayerViewController");+ if (layer) {+ YCPPatchWatch(layer, NSSelectorFromString(@"statusBarHeight"), (IMP)YCPWatchTopInset);+ YCPPatchWatch(layer, NSSelectorFromString(@"headerHeight"), (IMP)YCPWatchTopInset);+ }+ Class watch = NSClassFromString(@"YTWatchViewController");+ if (watch) YCPPatchWatch(watch, NSSelectorFromString(@"isWideLayoutForWatchView:"), (IMP)YCPWideWatchDelegate);+}diff --git a/LICENSE b/LICENSEnew file mode 100644index 0000000..f288702--- /dev/null+++ b/LICENSE@@ -0,0 +1,674 @@+ GNU GENERAL PUBLIC LICENSE+ Version 3, 29 June 2007++ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>+ Everyone is permitted to copy and distribute verbatim copies+ of this license document, but changing it is not allowed.++ Preamble++ The GNU General Public License is a free, copyleft license for+software and other kinds of works.++ The licenses for most software and other practical works are designed+to take away your freedom to share and change the works. By contrast,+the GNU General Public License is intended to guarantee your freedom to+share and change all versions of a program--to make sure it remains free+software for all its users. We, the Free Software Foundation, use the+GNU General Public License for most of our software; it applies also to+any other work released this way by its authors. You can apply it to+your programs, too.++ When we speak of free software, we are referring to freedom, not+price. Our General Public Licenses are designed to make sure that you+have the freedom to distribute copies of free software (and charge for+them if you wish), that you receive source code or can get it if you+want it, that you can change the software or use pieces of it in new+free programs, and that you know you can do these things.++ To protect your rights, we need to prevent others from denying you+these rights or asking you to surrender the rights. Therefore, you have+certain responsibilities if you distribute copies of the software, or if+you modify it: responsibilities to respect the freedom of others.++ For example, if you distribute copies of such a program, whether+gratis or for a fee, you must pass on to the recipients the same+freedoms that you received. You must make sure that they, too, receive+or can get the source code. And you must show them these terms so they+know their rights.++ Developers that use the GNU GPL protect your rights with two steps:+(1) assert copyright on the software, and (2) offer you this License+giving you legal permission to copy, distribute and/or modify it.++ For the developers' and authors' protection, the GPL clearly explains+that there is no warranty for this free software. For both users' and+authors' sake, the GPL requires that modified versions be marked as+changed, so that their problems will not be attributed erroneously to+authors of previous versions.++ Some devices are designed to deny users access to install or run+modified versions of the software inside them, although the manufacturer+can do so. This is fundamentally incompatible with the aim of+protecting users' freedom to change the software. The systematic+pattern of such abuse occurs in the area of products for individuals to+use, which is precisely where it is most unacceptable. Therefore, we+have designed this version of the GPL to prohibit the practice for those+products. If such problems arise substantially in other domains, we+stand ready to extend this provision to those domains in future versions+of the GPL, as needed to protect the freedom of users.++ Finally, every program is threatened constantly by software patents.+States should not allow patents to restrict development and use of+software on general-purpose computers, but in those that do, we wish to+avoid the special danger that patents applied to a free program could+make it effectively proprietary. To prevent this, the GPL assures that+patents cannot be used to render the program non-free.++ The precise terms and conditions for copying, distribution and+modification follow.++ TERMS AND CONDITIONS++ 0. Definitions.++ "This License" refers to version 3 of the GNU General Public License.++ "Copyright" also means copyright-like laws that apply to other kinds of+works, such as semiconductor masks.++ "The Program" refers to any copyrightable work licensed under this+License. Each licensee is addressed as "you". "Licensees" and+"recipients" may be individuals or organizations.++ To "modify" a work means to copy from or adapt all or part of the work+in a fashion requiring copyright permission, other than the making of an+exact copy. The resulting work is called a "modified version" of the+earlier work or a work "based on" the earlier work.++ A "covered work" means either the unmodified Program or a work based+on the Program.++ To "propagate" a work means to do anything with it that, without+permission, would make you directly or secondarily liable for+infringement under applicable copyright law, except executing it on a+computer or modifying a private copy. Propagation includes copying,+distribution (with or without modification), making available to the+public, and in some countries other activities as well.++ To "convey" a work means any kind of propagation that enables other+parties to make or receive copies. Mere interaction with a user through+a computer network, with no transfer of a copy, is not conveying.++ An interactive user interface displays "Appropriate Legal Notices"+to the extent that it includes a convenient and prominently visible+feature that (1) displays an appropriate copyright notice, and (2)+tells the user that there is no warranty for the work (except to the+extent that warranties are provided), that licensees may convey the+work under this License, and how to view a copy of this License. If+the interface presents a list of user commands or options, such as a+menu, a prominent item in the list meets this criterion.++ 1. Source Code.++ The "source code" for a work means the preferred form of the work+for making modifications to it. "Object code" means any non-source+form of a work.++ A "Standard Interface" means an interface that either is an official+standard defined by a recognized standards body, or, in the case of+interfaces specified for a particular programming language, one that+is widely used among developers working in that language.++ The "System Libraries" of an executable work include anything, other+than the work as a whole, that (a) is included in the normal form of+packaging a Major Component, but which is not part of that Major+Component, and (b) serves only to enable use of the work with that+Major Component, or to implement a Standard Interface for which an+implementation is available to the public in source code form. A+"Major Component", in this context, means a major essential component+(kernel, window system, and so on) of the specific operating system+(if any) on which the executable work runs, or a compiler used to+produce the work, or an object code interpreter used to run it.++ The "Corresponding Source" for a work in object code form means all+the source code needed to generate, install, and (for an executable+work) run the object code and to modify the work, including scripts to+control those activities. However, it does not include the work's+System Libraries, or general-purpose tools or generally available free+programs which are used unmodified in performing those activities but+which are not part of the work. For example, Corresponding Source+includes interface definition files associated with source files for+the work, and the source code for shared libraries and dynamically+linked subprograms that the work is specifically designed to require,+such as by intimate data communication or control flow between those+subprograms and other parts of the work.++ The Corresponding Source need not include anything that users+can regenerate automatically from other parts of the Corresponding+Source.++ The Corresponding Source for a work in source code form is that+same work.++ 2. Basic Permissions.++ All rights granted under this License are granted for the term of+copyright on the Program, and are irrevocable provided the stated+conditions are met. This License explicitly affirms your unlimited+permission to run the unmodified Program. The output from running a+covered work is covered by this License only if the output, given its+content, constitutes a covered work. This License acknowledges your+rights of fair use or other equivalent, as provided by copyright law.++ You may make, run and propagate covered works that you do not+convey, without conditions so long as your license otherwise remains+in force. You may convey covered works to others for the sole purpose+of having them make modifications exclusively for you, or provide you+with facilities for running those works, provided that you comply with+the terms of this License in conveying all material for which you do+not control copyright. Those thus making or running the covered works+for you must do so exclusively on your behalf, under your direction+and control, on terms that prohibit them from making any copies of+your copyrighted material outside their relationship with you.++ Conveying under any other circumstances is permitted solely under+the conditions stated below. Sublicensing is not allowed; section 10+makes it unnecessary.++ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.++ No covered work shall be deemed part of an effective technological+measure under any applicable law fulfilling obligations under article+11 of the WIPO copyright treaty adopted on 20 December 1996, or+similar laws prohibiting or restricting circumvention of such+measures.++ When you convey a covered work, you waive any legal power to forbid+circumvention of technological measures to the extent such circumvention+is effected by exercising rights under this License with respect to+the covered work, and you disclaim any intention to limit operation or+modification of the work as a means of enforcing, against the work's+users, your or third parties' legal rights to forbid circumvention of+technological measures.++ 4. Conveying Verbatim Copies.++ You may convey verbatim copies of the Program's source code as you+receive it, in any medium, provided that you conspicuously and+appropriately publish on each copy an appropriate copyright notice;+keep intact all notices stating that this License and any+non-permissive terms added in accord with section 7 apply to the code;+keep intact all notices of the absence of any warranty; and give all+recipients a copy of this License along with the Program.++ You may charge any price or no price for each copy that you convey,+and you may offer support or warranty protection for a fee.++ 5. Conveying Modified Source Versions.++ You may convey a work based on the Program, or the modifications to+produce it from the Program, in the form of source code under the+terms of section 4, provided that you also meet all of these conditions:++ a) The work must carry prominent notices stating that you modified+ it, and giving a relevant date.++ b) The work must carry prominent notices stating that it is+ released under this License and any conditions added under section+ 7. This requirement modifies the requirement in section 4 to+ "keep intact all notices".++ c) You must license the entire work, as a whole, under this+ License to anyone who comes into possession of a copy. This+ License will therefore apply, along with any applicable section 7+ additional terms, to the whole of the work, and all its parts,+ regardless of how they are packaged. This License gives no+ permission to license the work in any other way, but it does not+ invalidate such permission if you have separately received it.++ d) If the work has interactive user interfaces, each must display+ Appropriate Legal Notices; however, if the Program has interactive+ interfaces that do not display Appropriate Legal Notices, your+ work need not make them do so.++ A compilation of a covered work with other separate and independent+works, which are not by their nature extensions of the covered work,+and which are not combined with it such as to form a larger program,+in or on a volume of a storage or distribution medium, is called an+"aggregate" if the compilation and its resulting copyright are not+used to limit the access or legal rights of the compilation's users+beyond what the individual works permit. Inclusion of a covered work+in an aggregate does not cause this License to apply to the other+parts of the aggregate.++ 6. Conveying Non-Source Forms.++ You may convey a covered work in object code form under the terms+of sections 4 and 5, provided that you also convey the+machine-readable Corresponding Source under the terms of this License,+in one of these ways:++ a) Convey the object code in, or embodied in, a physical product+ (including a physical distribution medium), accompanied by the+ Corresponding Source fixed on a durable physical medium+ customarily used for software interchange.++ b) Convey the object code in, or embodied in, a physical product+ (including a physical distribution medium), accompanied by a+ written offer, valid for at least three years and valid for as+ long as you offer spare parts or customer support for that product+ model, to give anyone who possesses the object code either (1) a+ copy of the Corresponding Source for all the software in the+ product that is covered by this License, on a durable physical+ medium customarily used for software interchange, for a price no+ more than your reasonable cost of physically performing this+ conveying of source, or (2) access to copy the+ Corresponding Source from a network server at no charge.++ c) Convey individual copies of the object code with a copy of the+ written offer to provide the Corresponding Source. This+ alternative is allowed only occasionally and noncommercially, and+ only if you received the object code with such an offer, in accord+ with subsection 6b.++ d) Convey the object code by offering access from a designated+ place (gratis or for a charge), and offer equivalent access to the+ Corresponding Source in the same way through the same place at no+ further charge. You need not require recipients to copy the+ Corresponding Source along with the object code. If the place to+ copy the object code is a network server, the Corresponding Source+ may be on a different server (operated by you or a third party)+ that supports equivalent copying facilities, provided you maintain+ clear directions next to the object code saying where to find the+ Corresponding Source. Regardless of what server hosts the+ Corresponding Source, you remain obligated to ensure that it is+ available for as long as needed to satisfy these requirements.++ e) Convey the object code using peer-to-peer transmission, provided+ you inform other peers where the object code and Corresponding+ Source of the work are being offered to the general public at no+ charge under subsection 6d.++ A separable portion of the object code, whose source code is excluded+from the Corresponding Source as a System Library, need not be+included in conveying the object code work.++ A "User Product" is either (1) a "consumer product", which means any+tangible personal property which is normally used for personal, family,+or household purposes, or (2) anything designed or sold for incorporation+into a dwelling. In determining whether a product is a consumer product,+doubtful cases shall be resolved in favor of coverage. For a particular+product received by a particular user, "normally used" refers to a+typical or common use of that class of product, regardless of the status+of the particular user or of the way in which the particular user+actually uses, or expects or is expected to use, the product. A product+is a consumer product regardless of whether the product has substantial+commercial, industrial or non-consumer uses, unless such uses represent+the only significant mode of use of the product.++ "Installation Information" for a User Product means any methods,+procedures, authorization keys, or other information required to install+and execute modified versions of a covered work in that User Product from+a modified version of its Corresponding Source. The information must+suffice to ensure that the continued functioning of the modified object+code is in no case prevented or interfered with solely because+modification has been made.++ If you convey an object code work under this section in, or with, or+specifically for use in, a User Product, and the conveying occurs as+part of a transaction in which the right of possession and use of the+User Product is transferred to the recipient in perpetuity or for a+fixed term (regardless of how the transaction is characterized), the+Corresponding Source conveyed under this section must be accompanied+by the Installation Information. But this requirement does not apply+if neither you nor any third party retains the ability to install+modified object code on the User Product (for example, the work has+been installed in ROM).++ The requirement to provide Installation Information does not include a+requirement to continue to provide support service, warranty, or updates+for a work that has been modified or installed by the recipient, or for+the User Product in which it has been modified or installed. Access to a+network may be denied when the modification itself materially and+adversely affects the operation of the network or violates the rules and+protocols for communication across the network.++ Corresponding Source conveyed, and Installation Information provided,+in accord with this section must be in a format that is publicly+documented (and with an implementation available to the public in+source code form), and must require no special password or key for+unpacking, reading or copying.++ 7. Additional Terms.++ "Additional permissions" are terms that supplement the terms of this+License by making exceptions from one or more of its conditions.+Additional permissions that are applicable to the entire Program shall+be treated as though they were included in this License, to the extent+that they are valid under applicable law. If additional permissions+apply only to part of the Program, that part may be used separately+under those permissions, but the entire Program remains governed by+this License without regard to the additional permissions.++ When you convey a copy of a covered work, you may at your option+remove any additional permissions from that copy, or from any part of+it. (Additional permissions may be written to require their own+removal in certain cases when you modify the work.) You may place+additional permissions on material, added by you to a covered work,+for which you have or can give appropriate copyright permission.++ Notwithstanding any other provision of this License, for material you+add to a covered work, you may (if authorized by the copyright holders of+that material) supplement the terms of this License with terms:++ a) Disclaiming warranty or limiting liability differently from the+ terms of sections 15 and 16 of this License; or++ b) Requiring preservation of specified reasonable legal notices or+ author attributions in that material or in the Appropriate Legal+ Notices displayed by works containing it; or++ c) Prohibiting misrepresentation of the origin of that material, or+ requiring that modified versions of such material be marked in+ reasonable ways as different from the original version; or++ d) Limiting the use for publicity purposes of names of licensors or+ authors of the material; or++ e) Declining to grant rights under trademark law for use of some+ trade names, trademarks, or service marks; or++ f) Requiring indemnification of licensors and authors of that+ material by anyone who conveys the material (or modified versions of+ it) with contractual assumptions of liability to the recipient, for+ any liability that these contractual assumptions directly impose on+ those licensors and authors.++ All other non-permissive additional terms are considered "further+restrictions" within the meaning of section 10. If the Program as you+received it, or any part of it, contains a notice stating that it is+governed by this License along with a term that is a further+restriction, you may remove that term. If a license document contains+a further restriction but permits relicensing or conveying under this+License, you may add to a covered work material governed by the terms+of that license document, provided that the further restriction does+not survive such relicensing or conveying.++ If you add terms to a covered work in accord with this section, you+must place, in the relevant source files, a statement of the+additional terms that apply to those files, or a notice indicating+where to find the applicable terms.++ Additional terms, permissive or non-permissive, may be stated in the+form of a separately written license, or stated as exceptions;+the above requirements apply either way.++ 8. Termination.++ You may not propagate or modify a covered work except as expressly+provided under this License. Any attempt otherwise to propagate or+modify it is void, and will automatically terminate your rights under+this License (including any patent licenses granted under the third+paragraph of section 11).++ However, if you cease all violation of this License, then your+license from a particular copyright holder is reinstated (a)+provisionally, unless and until the copyright holder explicitly and+finally terminates your license, and (b) permanently, if the copyright+holder fails to notify you of the violation by some reasonable means+prior to 60 days after the cessation.++ Moreover, your license from a particular copyright holder is+reinstated permanently if the copyright holder notifies you of the+violation by some reasonable means, this is the first time you have+received notice of violation of this License (for any work) from that+copyright holder, and you cure the violation prior to 30 days after+your receipt of the notice.++ Termination of your rights under this section does not terminate the+licenses of parties who have received copies or rights from you under+this License. If your rights have been terminated and not permanently+reinstated, you do not qualify to receive new licenses for the same+material under section 10.++ 9. Acceptance Not Required for Having Copies.++ You are not required to accept this License in order to receive or+run a copy of the Program. Ancillary propagation of a covered work+occurring solely as a consequence of using peer-to-peer transmission+to receive a copy likewise does not require acceptance. However,+nothing other than this License grants you permission to propagate or+modify any covered work. These actions infringe copyright if you do+not accept this License. Therefore, by modifying or propagating a+covered work, you indicate your acceptance of this License to do so.++ 10. Automatic Licensing of Downstream Recipients.++ Each time you convey a covered work, the recipient automatically+receives a license from the original licensors, to run, modify and+propagate that work, subject to this License. You are not responsible+for enforcing compliance by third parties with this License.++ An "entity transaction" is a transaction transferring control of an+organization, or substantially all assets of one, or subdividing an+organization, or merging organizations. If propagation of a covered+work results from an entity transaction, each party to that+transaction who receives a copy of the work also receives whatever+licenses to the work the party's predecessor in interest had or could+give under the previous paragraph, plus a right to possession of the+Corresponding Source of the work from the predecessor in interest, if+the predecessor has it or can get it with reasonable efforts.++ You may not impose any further restrictions on the exercise of the+rights granted or affirmed under this License. For example, you may+not impose a license fee, royalty, or other charge for exercise of+rights granted under this License, and you may not initiate litigation+(including a cross-claim or counterclaim in a lawsuit) alleging that+any patent claim is infringed by making, using, selling, offering for+sale, or importing the Program or any portion of it.++ 11. Patents.++ A "contributor" is a copyright holder who authorizes use under this+License of the Program or a work on which the Program is based. The+work thus licensed is called the contributor's "contributor version".++ A contributor's "essential patent claims" are all patent claims+owned or controlled by the contributor, whether already acquired or+hereafter acquired, that would be infringed by some manner, permitted+by this License, of making, using, or selling its contributor version,+but do not include claims that would be infringed only as a+consequence of further modification of the contributor version. For+purposes of this definition, "control" includes the right to grant+patent sublicenses in a manner consistent with the requirements of+this License.++ Each contributor grants you a non-exclusive, worldwide, royalty-free+patent license under the contributor's essential patent claims, to+make, use, sell, offer for sale, import and otherwise run, modify and+propagate the contents of its contributor version.++ In the following three paragraphs, a "patent license" is any express+agreement or commitment, however denominated, not to enforce a patent+(such as an express permission to practice a patent or covenant not to+sue for patent infringement). To "grant" such a patent license to a+party means to make such an agreement or commitment not to enforce a+patent against the party.++ If you convey a covered work, knowingly relying on a patent license,+and the Corresponding Source of the work is not available for anyone+to copy, free of charge and under the terms of this License, through a+publicly available network server or other readily accessible means,+then you must either (1) cause the Corresponding Source to be so+available, or (2) arrange to deprive yourself of the benefit of the+patent license for this particular work, or (3) arrange, in a manner+consistent with the requirements of this License, to extend the patent+license to downstream recipients. "Knowingly relying" means you have+actual knowledge that, but for the patent license, your conveying the+covered work in a country, or your recipient's use of the covered work+in a country, would infringe one or more identifiable patents in that+country that you have reason to believe are valid.++ If, pursuant to or in connection with a single transaction or+arrangement, you convey, or propagate by procuring conveyance of, a+covered work, and grant a patent license to some of the parties+receiving the covered work authorizing them to use, propagate, modify+or convey a specific copy of the covered work, then the patent license+you grant is automatically extended to all recipients of the covered+work and works based on it.++ A patent license is "discriminatory" if it does not include within+the scope of its coverage, prohibits the exercise of, or is+conditioned on the non-exercise of one or more of the rights that are+specifically granted under this License. You may not convey a covered+work if you are a party to an arrangement with a third party that is+in the business of distributing software, under which you make payment+to the third party based on the extent of your activity of conveying+the work, and under which the third party grants, to any of the+parties who would receive the covered work from you, a discriminatory+patent license (a) in connection with copies of the covered work+conveyed by you (or copies made from those copies), or (b) primarily+for and in connection with specific products or compilations that+contain the covered work, unless you entered into that arrangement,+or that patent license was granted, prior to 28 March 2007.++ Nothing in this License shall be construed as excluding or limiting+any implied license or other defenses to infringement that may+otherwise be available to you under applicable patent law.++ 12. No Surrender of Others' Freedom.++ If conditions are imposed on you (whether by court order, agreement or+otherwise) that contradict the conditions of this License, they do not+excuse you from the conditions of this License. If you cannot convey a+covered work so as to satisfy simultaneously your obligations under this+License and any other pertinent obligations, then as a consequence you may+not convey it at all. For example, if you agree to terms that obligate you+to collect a royalty for further conveying from those to whom you convey+the Program, the only way you could satisfy both those terms and this+License would be to refrain entirely from conveying the Program.++ 13. Use with the GNU Affero General Public License.++ Notwithstanding any other provision of this License, you have+permission to link or combine any covered work with a work licensed+under version 3 of the GNU Affero General Public License into a single+combined work, and to convey the resulting work. The terms of this+License will continue to apply to the part which is the covered work,+but the special requirements of the GNU Affero General Public License,+section 13, concerning interaction through a network will apply to the+combination as such.++ 14. Revised Versions of this License.++ The Free Software Foundation may publish revised and/or new versions of+the GNU General Public License from time to time. Such new versions will+be similar in spirit to the present version, but may differ in detail to+address new problems or concerns.++ Each version is given a distinguishing version number. If the+Program specifies that a certain numbered version of the GNU General+Public License "or any later version" applies to it, you have the+option of following the terms and conditions either of that numbered+version or of any later version published by the Free Software+Foundation. If the Program does not specify a version number of the+GNU General Public License, you may choose any version ever published+by the Free Software Foundation.++ If the Program specifies that a proxy can decide which future+versions of the GNU General Public License can be used, that proxy's+public statement of acceptance of a version permanently authorizes you+to choose that version for the Program.++ Later license versions may give you additional or different+permissions. However, no additional obligations are imposed on any+author or copyright holder as a result of your choosing to follow a+later version.++ 15. Disclaimer of Warranty.++ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.++ 16. Limitation of Liability.++ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF+SUCH DAMAGES.++ 17. Interpretation of Sections 15 and 16.++ If the disclaimer of warranty and limitation of liability provided+above cannot be given local legal effect according to their terms,+reviewing courts shall apply local law that most closely approximates+an absolute waiver of all civil liability in connection with the+Program, unless a warranty or assumption of liability accompanies a+copy of the Program in return for a fee.++ END OF TERMS AND CONDITIONS++ How to Apply These Terms to Your New Programs++ If you develop a new program, and you want it to be of the greatest+possible use to the public, the best way to achieve this is to make it+free software which everyone can redistribute and change under these terms.++ To do so, attach the following notices to the program. It is safest+to attach them to the start of each source file to most effectively+state the exclusion of warranty; and each file should have at least+the "copyright" line and a pointer to where the full notice is found.++ <one line to give the program's name and a brief idea of what it does.>+ Copyright (C) <year> <name of author>++ This program is free software: you can redistribute it and/or modify+ it under the terms of the GNU General Public License as published by+ the Free Software Foundation, either version 3 of the License, or+ (at your option) any later version.++ This program is distributed in the hope that it will be useful,+ but WITHOUT ANY WARRANTY; without even the implied warranty of+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ GNU General Public License for more details.++ You should have received a copy of the GNU General Public License+ along with this program. If not, see <https://www.gnu.org/licenses/>.++Also add information on how to contact you by electronic and paper mail.++ If the program does terminal interaction, make it output a short+notice like this when it starts in an interactive mode:++ <program> Copyright (C) <year> <name of author>+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.+ This is free software, and you are welcome to redistribute it+ under certain conditions; type `show c' for details.++The hypothetical commands `show w' and `show c' should show the appropriate+parts of the General Public License. Of course, your program's commands+might be different; for a GUI interface, you would use an "about box".++ You should also get your employer (if you work as a programmer) or school,+if any, to sign a "copyright disclaimer" for the program, if necessary.+For more information on this, and how to apply and follow the GNU GPL, see+<https://www.gnu.org/licenses/>.++ The GNU General Public License does not permit incorporating your program+into proprietary programs. If your program is a subroutine library, you+may consider it more useful to permit linking proprietary applications with+the library. If this is what you want to do, use the GNU Lesser General+Public License instead of this License. But first, please read+<https://www.gnu.org/licenses/why-not-lgpl.html>.diff --git a/NOTICE.md b/NOTICE.mdnew file mode 100644index 0000000..3ac987e--- /dev/null+++ b/NOTICE.md@@ -0,0 +1,22 @@+# Third-party notices and attribution++## Project source++The YouTube Car integration is distributed under GPL-3.0; see `LICENSE`.++## YouMod++`vendor/YouMod/` is an unmodified source snapshot from [Tonwalter888/YouMod](https://github.com/Tonwalter888/YouMod), commit `fb6a9f6f3bbfcbe8aa8b92debda6405f2b7be2d7`, under GPL-3.0. Its original README, license, comments, and credits are preserved. The development input used YouMod 2.0.0. YouMod in a supplied IPA is reused as a binary unless explicitly rebuilt by the developer.++## Reference and build tools++- [PoomSmart/YouTubeHeader](https://github.com/PoomSmart/YouTubeHeader), reference pin `4b9977e2b243fcb143395e0a20d975a32eaa93e0`.+- [asdfzxcvbn/pyzule-rw (cyan)](https://github.com/asdfzxcvbn/pyzule-rw), build dependency pin `740d3716dcd98c20c000f12cdb88f1f0b2a533a4`.+- [mrdrvt99/YouProEXTRA](https://github.com/mrdrvt99/YouProEXTRA), source of the compatible development input, actual YouTube 21.42.4 / YouMod 2.0.0. Input SHA-256: `57e93f6805c56fcc8b1c43f0a421475959061ff5df7b0fe7ffa36d0b1c9bf549`.+- Playback compatibility research: the upstream issues linked in `docs/COMPATIBILITY.md`.++## External application binaries++Google's YouTube application is proprietary. Its binary, resources, trademarks, and service are not relicensed as project source. Supplying or receiving an IPA does not grant a right to redistribute Google's code. Public release preparation should prefer the integration module/source and a builder accepting the user's own authorized input. Any private unsigned IPA asset retains the underlying third-party rights and requires the recipient's own authorized signing.++The repository does not include any source tree from a separate app project. The keyboard and native module included here are the self-contained files used by this integration.diff --git a/README.md b/README.mdnew file mode 100644index 0000000..71fcdff--- /dev/null+++ b/README.md@@ -0,0 +1,93 @@+<p align="center"><img src="assets/hero.svg" alt="YouTube Car — native YouTube for Apple CarPlay, with a responsive video and queue layout" width="100%"></p>++# YouTube Car · Native YouTube for Apple CarPlay++**The native YouTube app, adapted for the CarPlay screen.** Browse a responsive video grid, search with an on-screen keyboard, and watch with the video on the left and your queue on the right.++[](LICENSE)+[](docs/BUILD.md)+[](docs/ARCHITECTURE.md)+[](docs/COMPATIBILITY.md)++[Get started](docs/BUILD.md) · [How it works](docs/ARCHITECTURE.md) · [Compatibility](docs/COMPATIBILITY.md) · [Releases](https://github.com/sa4hnd/YouTube-Car/releases) · [Credits](NOTICE.md)++## What makes it different++This project hosts YouTube's **existing native interface and player** in a CarPlay scene. Its integration layer is Objective-C and Swift. Browsing does not use a website, screen mirroring, or a separate video extractor.++- **A responsive feed:** multiple video columns that fit the available display area.+- **A wide watch page:** video and details on the left; mixes or recommendations on the right on landscape displays.+- **Smaller screens handled:** a scaled logical canvas keeps controls and thumbnails proportionate.+- **Search on the car screen:** a dedicated touch keyboard with English, Arabic, symbols, and a query preview.+- **Native navigation:** the initialized controller tree, account state, and player are reused.+- **Phone ↔ car handoff:** a phone placeholder while connected; the original interface returns on disconnect.+- **Focused compatibility hooks:** Home grids, search, watch metadata, header scrolling, and the mini-player use separate rules.++The hero above is an original interface illustration, not evidence of head-unit certification. See [compatibility](docs/COMPATIBILITY.md) for the demonstrated baseline and limits.++## Start here++You need macOS, Xcode with an iPhoneOS SDK, Python 3.9+, and a compatible decrypted YouTube + YouMod IPA that you are authorized to use. Signing and CarPlay capabilities are your own; this project does not grant entitlements or bypass platform/vehicle restrictions.++```sh+git clone https://github.com/sa4hnd/YouTube-Car.git+cd YouTube-Car+python3 -m venv .venv+source .venv/bin/activate+python3 -m pip install -r requirements-build.txt++# Compile only: no IPA, certificate, profile, or device required.+python3 scripts/build_carplay.py --compile-only++# Produce an unsigned IPA from your own compatible input.+python3 scripts/build_carplay.py --ipa /path/to/YouMod.ipa --unsigned+```++For device signing, your own app ID, and installation, follow the [complete build guide](docs/BUILD.md). The [release](https://github.com/sa4hnd/YouTube-Car/releases) includes a compiled module and hashes; any IPA marked **unsigned** must be signed before installation.++## The working baseline++| Component | Baseline |+| --- | --- |+| Actual YouTube executable | 21.42.4 |+| YouMod | 2.0.0 |+| Reported bundle version | 21.45.4 |+| Integration | Native UIKit controller hosting + SwiftUI keyboard |+| Deployment target | iOS 17.0 |+| Source license | GPL-3.0; third-party notices apply |++The reported-version override resolved repeated playback error 14 on the development device according to the user's observation. **That is a compatibility workaround, not a universal playback fix or an upgrade to the underlying executable.** Keep the actual and reported versions distinct when reporting issues.++## Explore the source++| Path | Purpose |+| --- | --- |+| [`CarPlay/`](CarPlay) | Native scene lifecycle, surface ownership, responsive layout, input, and UI hooks |+| [`scripts/`](scripts) | Module compilation, IPA packaging/signing, device updates, and release auditing |+| [`tests/`](tests) | Packaging checks and native simulator harnesses for maintainers |+| [`vendor/YouMod/`](vendor/YouMod) | Attributed upstream YouMod source snapshot; not Google's application source |+| [`docs/`](docs) | Build steps, architecture, compatibility, and privacy/release instructions |++## FAQ++**Is this the source code of YouTube?** No. This repository contains the CarPlay integration and the credited YouMod source. Google's native application is an external binary input; its proprietary code and trademarks are not relicensed by this project.++**Does it work in every car?** That has not been established. The OS must provide an authorized drawable CarPlay window. Display geometry, app version, entitlement availability, and head-unit behavior matter.++**Can I install the release IPA immediately?** An unsigned IPA contains no signing profile and cannot launch until signed with an appropriate certificate/profile and your own authorized capabilities. A sideloader cannot grant missing CarPlay entitlements.++**Does it replace YouTube's player with AVPlayer?** No. The working baseline preserves YouTube's existing player. The proposed AVPlayer-backend fallback was not integrated.++**Why is playback sometimes account- or version-dependent?** Playback is also controlled by YouTube's service. Error 14 is generic. See [known issues](docs/COMPATIBILITY.md); endless automatic retries only mask failures.++**Why private?** This repository is currently private for preparation. GitHub topics, readable documentation, a clear description, and social artwork are ready for a future public release. Private repositories are not indexed for public search.++## Contributing++Report the actual YouTube version, reported version, iOS version, display size, and reproduction steps. Redact diagnostics before sharing. See [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md).++## Credits and independence++Built on [YouMod](https://github.com/Tonwalter888/YouMod), with references to [YouTubeHeader](https://github.com/PoomSmart/YouTubeHeader) and packaging by [cyan](https://github.com/asdfzxcvbn/pyzule-rw). Full attribution is in [NOTICE.md](NOTICE.md).++An independent community project. Not affiliated with or endorsed by Google, YouTube, or Apple. YouTube and CarPlay are trademarks of their respective owners.diff --git a/SECURITY.md b/SECURITY.mdnew file mode 100644index 0000000..e101e83--- /dev/null+++ b/SECURITY.md@@ -0,0 +1,7 @@+# Security and privacy++Do not post credentials, signing keys, profiles, device identifiers, media URLs, account information, or raw app-container exports in issues. Review every diagnostic file before sharing.++For a sensitive finding, use GitHub's private vulnerability-reporting feature when available; otherwise contact the repository owner privately through GitHub. Never open a public issue containing a secret.++The project does not provide signing certificates, shared Apple accounts, authentication tokens, or missing entitlements. Build artifacts intended for sharing must be unsigned and profile-free. See `docs/RELEASING.md` for the audit procedure.diff --git a/assets/hero.svg b/assets/hero.svgnew file mode 100644index 0000000..1ef216b--- /dev/null+++ b/assets/hero.svg@@ -0,0 +1,36 @@+<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="840" viewBox="0 0 1600 840" role="img" aria-labelledby="title desc">+<title id="title">YouTube Car — Native YouTube for Apple CarPlay</title>+<desc id="desc">Original project illustration showing a responsive native video player and right-hand video queue. Not a head-unit screenshot.</desc>+<defs>+<linearGradient id="bg" x2="1" y2="1"><stop stop-color="#0c0d10"/><stop offset="1" stop-color="#19191e"/></linearGradient>+<linearGradient id="video" x2="1" y2="1"><stop stop-color="#c74639"/><stop offset=".5" stop-color="#752820"/><stop offset="1" stop-color="#151b2b"/></linearGradient>+<linearGradient id="glass" x2="0" y2="1"><stop stop-color="#ffffff" stop-opacity=".13"/><stop offset="1" stop-color="#ffffff" stop-opacity=".04"/></linearGradient>+</defs>+<rect width="1600" height="840" rx="0" fill="url(#bg)"/>+<circle cx="1450" cy="160" r="290" fill="#f03" opacity=".045"/>+<text x="96" y="102" fill="#a0a3ae" font-family="-apple-system,BlinkMacSystemFont,Arial,sans-serif" font-size="20" letter-spacing="4">YOUTUBE CAR · NATIVE CARPLAY INTEGRATION</text>+<text x="92" y="190" fill="#fff" font-family="-apple-system,BlinkMacSystemFont,Arial,sans-serif" font-weight="700" font-size="70" letter-spacing="-3">YouTube, native.</text>+<text x="92" y="268" fill="#fff" font-family="-apple-system,BlinkMacSystemFont,Arial,sans-serif" font-weight="700" font-size="70" letter-spacing="-3">Now on CarPlay.</text>+<text x="96" y="318" fill="#b3b5bf" font-family="-apple-system,BlinkMacSystemFont,Arial,sans-serif" font-size="24">Responsive browsing. On-screen search. Your native player.</text>+<rect x="94" y="372" width="1412" height="374" rx="35" fill="#08090b" stroke="#3a3b41" stroke-width="2"/>+<rect x="107" y="386" width="58" height="345" rx="24" fill="url(#glass)" stroke="#45464e"/>+<text x="119" y="416" fill="#fff" font-family="Arial,sans-serif" font-size="15" font-weight="700">10:00</text>+<rect x="121" y="510" width="30" height="30" rx="9" fill="#52c5ef"/>+<rect x="121" y="553" width="30" height="30" rx="9" fill="#39c874"/>+<rect x="121" y="596" width="30" height="30" rx="9" fill="#fff"/>+<rect x="127" y="604" width="18" height="14" rx="4" fill="#f03"/><path d="m134 607 6 4-6 4z" fill="#fff"/>+<g fill="#ddd"><rect x="126" y="690" width="7" height="7" rx="1"/><rect x="137" y="690" width="7" height="7" rx="1"/><rect x="126" y="701" width="7" height="7" rx="1"/><rect x="137" y="701" width="7" height="7" rx="1"/></g>+<rect x="183" y="391" width="902" height="256" rx="18" fill="url(#video)"/>+<path d="M183 604 390 455 616 582 830 445 1085 647H183z" fill="#ffffff" opacity=".055"/>+<circle cx="634" cy="519" r="32" fill="#000" opacity=".32"/><path d="m625 501 27 18-27 18z" fill="#fff"/>+<rect x="183" y="643" width="342" height="4" fill="#f03"/>+<text x="190" y="680" fill="#fff" font-family="Arial,sans-serif" font-weight="700" font-size="22">The native player. A layout that fits.</text>+<text x="190" y="710" fill="#989ba8" font-family="Arial,sans-serif" font-size="17">Original interface · Native playback · Responsive canvas</text>+<rect x="1104" y="391" width="382" height="338" rx="18" fill="#141519"/>+<text x="1125" y="426" fill="#fff" font-family="Arial,sans-serif" font-weight="700" font-size="21">Up next</text>+<g font-family="Arial,sans-serif"><rect x="1125" y="449" width="120" height="69" rx="9" fill="#354658"/><text x="1261" y="475" fill="#eee" font-size="18">Your video queue</text><text x="1261" y="501" fill="#999caa" font-size="15">Native recommendations</text>+<rect x="1125" y="537" width="120" height="69" rx="9" fill="#585045"/><text x="1261" y="563" fill="#eee" font-size="18">Mixes beside video</text><text x="1261" y="589" fill="#999caa" font-size="15">More room to browse</text>+<rect x="1125" y="625" width="120" height="69" rx="9" fill="#4f384d"/><text x="1261" y="651" fill="#eee" font-size="18">Small or wide display</text><text x="1261" y="677" fill="#999caa" font-size="15">Scaled to the viewport</text></g>+<text x="96" y="794" fill="#777b88" font-family="Arial,sans-serif" font-size="16">EXPERIMENTAL COMMUNITY PROJECT · SOURCE + BUILD GUIDE · INTERFACE ILLUSTRATION</text>+<text x="1506" y="794" text-anchor="end" fill="#ddd" font-family="Arial,sans-serif" font-size="16">github.com/sa4hnd/YouTube-Car</text>+</svg>diff --git a/assets/social-preview.png b/assets/social-preview.pngnew file mode 100644index 0000000..f929d38Binary files /dev/null and b/assets/social-preview.png differdiff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdnew file mode 100644index 0000000..917c136--- /dev/null+++ b/docs/ARCHITECTURE.md@@ -0,0 +1,46 @@+# How native YouTube reaches the CarPlay display++The core idea is to **reuse the already initialized application controller tree**. A second native root can have an empty navigation stack even when the tab bar renders, so constructing another root is insufficient.++```mermaid+flowchart LR+ P[Native phone scene initializes services] --> S[Single surface coordinator]+ S --> H[CarPlay host]+ H --> C[Scaled logical canvas]+ C --> N[Existing YouTube controller tree and player]+ H --> K[Separate touch keyboard window]+ S --> R[Restore original phone root on disconnect]+```++## Ownership and lifecycle++`YCPSurface` owns one initialized root and one active car host. A placeholder temporarily occupies the source phone window. On disconnect the exact root returns, preserving its navigation state. A stale disconnect cannot release the active destination. The original phone scene manifest is retained; the package adds both a template route and a normal CarPlay-window route.++The implementation is app-local. It does not inject into SpringBoard, CarPlay services, or other applications, and it does not grant missing capabilities.++## Responsive layout++`YCPScaledContentView` computes scale from the actual safe viewport. The logical canvas aims for at least 1024×600 points on smaller displays, then scales uniformly. UIKit transforms maintain touch-coordinate conversion. Large displays need no enlargement. Geometry setters run only when values change, avoiding repeated work during playback updates.++The window background extends edge to edge; interactive content uses the safe-area guide so controls avoid the system sidebar. Wide watch layout is chosen from logical dimensions, with video/details on the left and the native queue/recommendations on the right. Tall displays keep the native stacked layout.++## Scoped native hooks++- **Browse:** positively recognized Home/Browse/Subscriptions sections may receive grid-column overrides. Search, watch, playlist, queue, metadata, and unknown contexts keep native measurements.+- **Search:** the presented search viewport accounts for the system sidebar and content scale.+- **Header:** browse-specific safe-area correction removes a cached phone inset. Observing feed scroll movement drives the native header collapse/reveal methods without replacing the scroll delegate.+- **Watch:** native layout/orientation flags are derived from actual content geometry. Native split-metadata measurement is retained. The first below-player section receives clearance from the scrubber edge.+- **Mini-player:** native output frames are clamped to content bounds, preserve 16:9, and reserve tab-bar space.+- **Input:** a separate window places the SwiftUI keyboard above native search modals. Changes are forwarded through native text-input APIs.++The keyboard supports English/Arabic, symbols, shift, deletion, preview, and submission. Its implementation is self-contained in this repository.++## Playback compatibility++The working package keeps YouTube's player. Only bundle version metadata is overridden: actual 21.42.4 reports 21.45.4. This is a device-observed compatibility workaround, not proof of a general solution to server-side playback rejection. It is reversible through the packaging tools.++The original ad coordinator is not restored over YouMod's hooks. An earlier attempt introduced ads without fixing playback and was removed. The external TV-client request patch is excluded. Error instrumentation records domain/code and numeric status identifiers, without logging media URLs or credentials.++## Source boundaries++`CarPlay/` is the integration. `vendor/YouMod/` is attributed upstream tweak source. The YouTube executable and optional input dependencies remain external binaries. Their implementation is not the integration's source and is not covered by the integration's GPL grant.diff --git a/docs/BUILD.md b/docs/BUILD.mdnew file mode 100644index 0000000..5f51450--- /dev/null+++ b/docs/BUILD.md@@ -0,0 +1,89 @@+# Build YouTube Car for CarPlay++## Prerequisites++- macOS with Xcode selected (`xcode-select -p`), an iPhoneOS SDK, and command-line tools.+- Python 3.9 or later. The code targets iOS 17.0.+- A compatible, decrypted YouTube + YouMod IPA you are authorized to modify. The baseline is actual YouTube **21.42.4 + YouMod 2.0.0**. A plain App Store download is encrypted and the packager rejects it.+- For device installation: your own signing certificate/private key in Keychain and a provisioning profile that authorizes your exact bundle ID, registered device, and necessary CarPlay capabilities. Those assets are never supplied by this repository.++```sh+python3 -m venv .venv+source .venv/bin/activate+python3 -m pip install -r requirements-build.txt+python3 scripts/build_carplay.py --compile-only+```++The last command produces `build/YouTubeCarPlay.dylib`. It compiles the module without changing or installing an app.++## Produce an unsigned IPA++```sh+python3 scripts/build_carplay.py --ipa /path/to/YouMod.ipa --unsigned --bundle-id com.example.youtubecar --reported-version 21.45.4+```++`com.example.youtubecar` is a placeholder. Use your own identifier when signing. Outputs are `dist/YouTube.app`, `dist/YouTubeCarPlay-21.42.4-unsigned.ipa`, and a hash/version manifest. The output name uses the **actual** version; the bundle reports the compatibility value. To use the unmodified input version instead, pass `--reported-version native`.++The unsigned path does not read your signing profiles or certificates. It strips embedded provisioning profiles and signatures from nested binaries and the app. It still contains Google's and the input provider's proprietary binaries; their rights remain separate from our source license.++## Sign and install with your own profile++First create an app ID/profile through your own authorized developer setup. Match the bundle ID to that profile. Import its certificate/private key into Keychain using your usual secure process; do not copy them into this repository.++```sh+xcrun devicectl list devices++python3 scripts/build_carplay.py --ipa /path/to/YouMod.ipa --profile /path/to/your.mobileprovision --bundle-id com.example.youtubecar --device YOUR_DEVICE_UDID+```++Use your own UDID locally. The script checks profile/device membership, compiles the module, injects it through cyan, signs nested code, verifies signatures, then installs and launches. It uses only the profile's permitted entitlements and does not copy foreign application groups. Missing CarPlay capabilities require an authorized profile; changing a plist or installing with a sideloader does not grant them.++## Update the module without repackaging the input++After a signed package has been created in `dist/YouTube.app`:++```sh+python3 scripts/update_carplay_module.py --device YOUR_DEVICE_UDID+```++Metadata-only version changes can reuse the module:++```sh+python3 scripts/update_carplay_module.py --device YOUR_DEVICE_UDID --reported-version 21.45.4 --reuse-module++python3 scripts/update_carplay_module.py --device YOUR_DEVICE_UDID --restore-reported-version --reuse-module+```++Actual input version fields are retained under `YCPActualYouTubeVersion` and `YCPActualYouTubeBuild`. Do not use the displayed compatibility value to identify the underlying executable.++## What the packager changes++1. Verifies a decrypted arm64 main executable.+2. Preserves native phone scene entries and adds CarPlay template/window routes.+3. Removes unselected optional weak tweak loads; retains YouMod, YouGroupSettings, and our integration.+4. Injects `YouTubeCarPlay.dylib`, changes app identity, enables audio background mode, and sets the reported-version compatibility fields.+5. Either removes all signatures/profiles for an unsigned package or signs using your own profile.++The `YouFixPlaybackIssues` TV-client patch is excluded from this working baseline. YouMod's ad-blocking behavior is retained. No alternative player is installed.++## Rebuilding YouMod itself++The compiled YouMod in the input IPA is reused. `vendor/YouMod/` is the attributed source snapshot for inspection and modification. Editing it does not change an existing dylib. To rebuild it, use Theos with the upstream headers/dependencies and the original build instructions in `vendor/YouMod/README.md`; then provide an IPA containing your newly built YouMod. This repository's module build does not pretend to rebuild Google or every third-party tweak from source.++## Common build problems++- **Encrypted input:** supply a compatible decrypted input you are authorized to use.+- **cyan unavailable:** activate `.venv` and install `requirements-build.txt`. The script runs cyan with the current Python interpreter.+- **Profile/app ID mismatch:** use the exact ID authorized by your profile.+- **Device unavailable/locked:** reconnect and unlock the device before installation/launch.+- **App installs but no CarPlay window:** inspect your authorized capabilities and OS/head-unit support. See `COMPATIBILITY.md`.++## Optional maintainer checks++These are not required for an end user to install. The native harnesses require a booted iOS simulator:++```sh+python3 -m unittest discover -s tests -v+python3 tests/run_native_surface.py YOUR_SIMULATOR_UDID+python3 tests/run_watch_layout.py YOUR_SIMULATOR_UDID+```diff --git a/docs/COMPATIBILITY.md b/docs/COMPATIBILITY.mdnew file mode 100644index 0000000..ba984ec--- /dev/null+++ b/docs/COMPATIBILITY.md@@ -0,0 +1,36 @@+# Compatibility and known limits++## Demonstrated baseline++Actual YouTube 21.42.4 + YouMod 2.0.0, reporting 21.45.4, with the native YouTube player and this CarPlay module. UI and playback success were reported on a development iPhone running iOS 27.0.1 with several CarPlay display profiles. This is not certification for every head unit or every account.++The source targets iOS 17.0. A compilation target is not a promise that every target OS supports the required drawable CarPlay scene, entitlement, or vehicle behavior.++| Area | Behavior / limitation |+| --- | --- |+| Native phone scene | Preserved rather than replaced with a guessed initializer |+| Display sizes | Scale derives from the safe viewport; landscape supports split watch layout |+| CarPlay routing | Requires an authorized drawable window; templates alone cannot show arbitrary native views |+| Playback | Uses YouTube's existing engine; service behavior may vary by account/version |+| Reported version | 21.45.4 workaround; actual executable stays 21.42.4 |+| App updates | May rename private classes/selectors or alter layouts; compatibility is not automatic |+| Input | Native fields need to expose standard text-input APIs |+| Optional tweaks | Removed by default to reduce conflicts |+| Installation | Appropriate personal signing and capabilities required |++## Playback error 14++“Something went wrong. Refresh and try again later” is a generic playback failure. Reloading on every failure can create an interruption loop; it does not repair the cause. In the development session, restoring native request-signal/ad-coordinator methods did not fix it and introduced ads, so that experiment was reverted. Incognito also failed. Reporting version 21.45.4 was then observed to resolve playback on that device.++These are observations, not a guarantee. Upstream reports remain relevant:++- [YouMod #172 — playback stops during viewing](https://github.com/Tonwalter888/YouMod/issues/172)+- [YouMod #86 — playback-fix failures and error 14](https://github.com/Tonwalter888/YouMod/issues/86)+- [uYouEnhanced #903 — version-related workaround discussion](https://github.com/arichornlover/uYouEnhanced/issues/903)+- [YTLite #364 — mixed results across versions and configurations](https://github.com/dayanch96/YTLite/issues/364)++An AVPlayer-backend replacement was considered but **not included** in this baseline. It is not necessary to build this project.++## Report a useful issue++Include actual and reported versions, OS version, viewport dimensions, whether the issue affects phone/car/both, and exact reproduction steps. A cropped screenshot may help, but remove account names, notifications, location, and unrelated desktop content. Do not upload your provisioning profile, account state, raw app container, or unreviewed logs.diff --git a/docs/RELEASING.md b/docs/RELEASING.mdnew file mode 100644index 0000000..c71b61d--- /dev/null+++ b/docs/RELEASING.md@@ -0,0 +1,37 @@+# Private releases and future public launch++## Repository boundaries++This is a fresh, standalone repository. Only the integration, build tools, docs, harness source, artwork, and attributed upstream snapshot belong here. Local signing assets, input files, generated app bundles, diagnostics, unrelated app projects, and development history do not.++## Prepare artifacts++```sh+python3 scripts/build_carplay.py --compile-only+python3 scripts/package_release.py+python3 scripts/audit_release.py . --artifact release/YouTube-Car-v0.1.0-build-kit.zip+```++Use an unsigned integration module and a source/patch kit as the default redistributable artifacts. Document the user's own input and signing requirements. For a private unsigned IPA, build using `--unsigned`, then audit the entire archive. Do not upload a personal signed app or simply remove its outer signature while leaving nested signatures/profiles.++Audit both source and every artifact. Reject profiles, certificates/private keys, credential patterns, device IDs, personal home-directory paths, and signed code. Also scan locally for your own names, private bundle IDs, certificate names, and team IDs; generic scanners cannot recognize every personal identifier. Do not put those private identifiers into a committed scanner configuration.++Include SHA-256 sums and a machine-readable manifest recording actual/reported versions and source revision. Do not publish profile UUIDs, device lists, signer identities, or account exports.++## Public launch preparation++Keep the repository private until its owner explicitly changes visibility. While private, search engines cannot index its README. Repository name/description/topics and an original social image are prepared for discoverability after publication, not a guarantee of reach.++Before a public launch:++- Review third-party binary distribution rights separately from the GPL source.+- Prefer a source/module release and user-supplied application input.+- Add an account-free, cropped demo captured with permission; label illustrations accurately.+- Keep claims concrete: native interface/player, controller handoff, responsive layouts. Do not claim “first,” universal compatibility, entitlement approval, or guaranteed playback without evidence.+- Re-run the source, history, and artifact privacy audit.++Draft public announcement:++> YouTube Car brings the native YouTube interface to a CarPlay display: responsive browsing, an on-screen keyboard, and video with a queue beside it. The integration source and reproducible build instructions are available. Experimental, with documented signing and compatibility requirements.++An optional Actions workflow template is in `docs/examples/build-workflow.yml`. Enable it under `.github/workflows/` only with repository/workflow authorization. No CI workflow is active by default.diff --git a/docs/examples/build-workflow.yml b/docs/examples/build-workflow.ymlnew file mode 100644index 0000000..4cd975e--- /dev/null+++ b/docs/examples/build-workflow.yml@@ -0,0 +1,21 @@+name: Build native CarPlay module+on:+ workflow_dispatch:+ push:+ branches: [main]+ paths: ["CarPlay/**", "scripts/**", ".github/workflows/build.yml"]+permissions:+ contents: read+jobs:+ module:+ runs-on: macos-latest+ steps:+ - uses: actions/checkout@v4+ - name: Compile module without app input or signing credentials+ run: python3 scripts/build_carplay.py --compile-only+ - name: Audit repository and compiled module+ run: python3 scripts/audit_release.py . --artifact build/YouTubeCarPlay.dylib+ - uses: actions/upload-artifact@v4+ with:+ name: YouTubeCarPlay-module-unsigned+ path: build/YouTubeCarPlay.dylibdiff --git a/requirements-build.txt b/requirements-build.txtnew file mode 100644index 0000000..e754dfb--- /dev/null+++ b/requirements-build.txt@@ -0,0 +1 @@+cyan @ https://github.com/asdfzxcvbn/pyzule-rw/archive/740d3716dcd98c20c000f12cdb88f1f0b2a533a4.zipdiff --git a/scripts/audit_release.py b/scripts/audit_release.pynew file mode 100644index 0000000..b9c194d--- /dev/null+++ b/scripts/audit_release.py@@ -0,0 +1,92 @@+#!/usr/bin/env python3+"""Audit source/artifacts for common credentials, personal paths and signing data.++This is a release gate, not a guarantee that arbitrary input contains no secrets.+Also review local owner-specific names/identifiers outside committed config.+"""+import argparse+import io+from pathlib import Path+import re+import struct+import sys+import zipfile++SKIP = {'.git', '.local', '.venv', 'venv', 'build', 'dist', 'release', '__pycache__'}+FORBIDDEN_SUFFIXES = {'.mobileprovision', '.provisionprofile', '.p12', '.pfx', '.pem', '.key', '.cer', '.ips', '.crash', '.log'}+RULES = {+ 'private signing key': rb'-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----',+ 'GitHub credential': rb'(?:gh[pousr]_[A-Za-z0-9]{30,}|github_pat_[A-Za-z0-9_]{40,})',+ 'AWS credential': rb'AKIA[0-9A-Z]{16}',+ 'Slack credential': rb'xox[baprs]-[A-Za-z0-9-]{20,}',+ 'device identifier': rb'\b[0-9A-Fa-f]{8}-[0-9A-Fa-f]{16}\b',+ 'personal filesystem path': rb'/(?:Users|home)/[A-Za-z0-9_.-]+/',+}+COMPILED = {label: re.compile(pattern) for label, pattern in RULES.items()}++def signed_macho(data):+ if len(data) < 32 or data[:4] != b'\xcf\xfa\xed\xfe':+ return False+ count, size = struct.unpack_from('<II', data, 16)+ if 32 + size > len(data):+ return False+ offset = 32+ for _ in range(count):+ if offset + 8 > 32 + size:+ return False+ kind, length = struct.unpack_from('<II', data, offset)+ if length < 8 or offset + length > 32 + size:+ return False+ if kind == 0x1D and length >= 16:+ if struct.unpack_from('<I', data, offset + 12)[0] > 0:+ return True+ offset += length+ return False++def check(name, data, artifact, failures):+ path = Path(name)+ if path.suffix.lower() in FORBIDDEN_SUFFIXES or path.name.startswith('.env'):+ failures.append((name, 'forbidden local/signing file'))+ if '_CodeSignature' in path.parts:+ failures.append((name, 'code-signature directory'))+ for label, pattern in COMPILED.items():+ if pattern.search(data):+ failures.append((name, label))+ if artifact and signed_macho(data):+ failures.append((name, 'Mach-O contains a code signature'))++def main():+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument('root', type=Path)+ parser.add_argument('--artifact', type=Path, action='append', default=[])+ args = parser.parse_args()+ failures = []+ count = 0+ for path in args.root.rglob('*'):+ if not path.is_file() or any(part in SKIP for part in path.relative_to(args.root).parts):+ continue+ check(str(path.relative_to(args.root)), path.read_bytes(), False, failures)+ count += 1+ for path in args.artifact:+ if not path.is_file():+ failures.append((path.name, 'artifact missing'))+ continue+ if zipfile.is_zipfile(path):+ with zipfile.ZipFile(path) as archive:+ for item in archive.infolist():+ if not item.is_dir():+ check(path.name + ':' + item.filename, archive.read(item), True, failures)+ count += 1+ else:+ check(path.name, path.read_bytes(), True, failures)+ count += 1+ if failures:+ for name, reason in failures:+ print('REJECT:', name, '—', reason)+ print('Audit failed; matched values are intentionally not printed.')+ return 1+ print('Privacy/signing audit passed for', count, 'files. Manual owner-specific review is still required.')+ return 0++if __name__ == '__main__':+ sys.exit(main())diff --git a/scripts/build_carplay.py b/scripts/build_carplay.pynew file mode 100644index 0000000..b150b96--- /dev/null+++ b/scripts/build_carplay.py@@ -0,0 +1,327 @@+#!/usr/bin/env python3+"""Build a native CarPlay dylib and package/sign a supplied native YouTube IPA.++Requires Xcode and cyan (pip install from the pinned source in SOURCES.md).+Inputs stay outside Git. The original IPA and the retired experiment are untouched.+"""+import argparse+import datetime+import hashlib+import json+from pathlib import Path+import plistlib+import shutil+import sys+import struct+import subprocess+import tempfile+import zipfile++ROOT = Path(__file__).resolve().parents[1]+BUNDLE_ID = "io.github.youtubecar.app"+KEEP_TWEAKS = {"YouMod.dylib", "YouGroupSettings.dylib", "YouTubeCarPlay.dylib"}+MACHO_MAGICS = {b"\xcf\xfa\xed\xfe", b"\xce\xfa\xed\xfe", b"\xca\xfe\xba\xbe", b"\xca\xfe\xba\xbf"}+++def run(*arguments, capture=False):+ result = subprocess.run([str(arg) for arg in arguments], check=True,+ stdout=subprocess.PIPE if capture else None,+ stderr=subprocess.PIPE if capture else None)+ return result.stdout if capture else None+++def commands(data):+ """Read a thin arm64 Mach-O with bounds checks before any mutation."""+ if len(data) < 32 or data[:4] != b"\xcf\xfa\xed\xfe":+ raise ValueError("Expected a thin little-endian 64-bit Mach-O; thin the input first")+ count, size = struct.unpack_from("<II", data, 16)+ if 32 + size > len(data):+ raise ValueError("Mach-O load command table extends beyond file")+ offset = 32+ result = []+ for _ in range(count):+ if offset + 8 > 32 + size:+ raise ValueError("Truncated Mach-O command header")+ kind, length = struct.unpack_from("<II", data, offset)+ if length < 8 or length % 8 or offset + length > 32 + size:+ raise ValueError("Invalid Mach-O load command length")+ result.append((kind, data[offset:offset + length]))+ offset += length+ if offset != 32 + size:+ raise ValueError("Inconsistent Mach-O command table")+ return result+++def dylib_name(command):+ if len(command) < 24:+ raise ValueError("Truncated dylib command")+ offset = struct.unpack_from("<I", command, 8)[0]+ if offset < 24 or offset >= len(command):+ raise ValueError("Invalid dylib name offset")+ return command[offset:].split(b"\0", 1)[0].decode("utf-8")+++def remove_optional_tweaks(data):+ """Remove only appended weak tweak loads; preserve segment/file offsets.++ The supplied release appends weak tweak loads with no imported symbols.+ Native strong dependencies and Swift compatibility libraries are preserved.+ """+ entries = commands(data)+ kept, removed = [], []+ for kind, command in entries:+ name = dylib_name(command) if kind == 0x80000018 else ""+ basename = Path(name).name+ if name.startswith("@rpath/") and basename.endswith(".dylib") and not basename.startswith("libswift") and basename not in KEEP_TWEAKS:+ removed.append(name)+ else:+ kept.append(command)+ packed = b"".join(kept)+ old_size = struct.unpack_from("<I", data, 20)[0]+ output = bytearray(data)+ struct.pack_into("<II", output, 16, len(kept), len(packed))+ output[32:32 + old_size] = packed + bytes(old_size - len(packed))+ return bytes(output), removed+++def assert_decrypted(data):+ for kind, command in commands(data):+ if kind in (0x21, 0x2C) and struct.unpack_from("<I", command, 16)[0] != 0:+ raise ValueError("The YouTube executable is encrypted; a decrypted input is required")+++def patch_scene_manifest(info):+ """Preserve Google's exact phone configuration and add both proven car roles."""+ manifest = info.setdefault("UIApplicationSceneManifest", {})+ manifest["UIApplicationSupportsMultipleScenes"] = True+ configurations = manifest.setdefault("UISceneConfigurations", {})+ if not configurations.get("UIWindowSceneSessionRoleApplication"):+ raise ValueError("No native phone scene configuration in this YouTube build")+ configurations["CPTemplateApplicationSceneSessionRoleApplication"] = [{+ "UISceneConfigurationName": "YouTube CarPlay", "UISceneClassName": "CPTemplateApplicationScene",+ "UISceneDelegateClassName": "YCPTemplateDelegate"}]+ for role in ("UIWindowSceneSessionRoleCarPlay", "UIWindowSceneSessionRoleExternalDisplayNonInteractive"):+ configurations[role] = [{"UISceneConfigurationName": "YouTube CarPlay Window",+ "UISceneClassName": "UIWindowScene", "UISceneDelegateClassName": "YCPWindowDelegate"}]+ info["UIApplicationSupportsIndirectInputEvents"] = True+ info["UIFileSharingEnabled"] = True+ info["LSSupportsOpeningDocumentsInPlace"] = True+ info["UISupportedInterfaceOrientations"] = ["UIInterfaceOrientationPortrait", "UIInterfaceOrientationLandscapeLeft", "UIInterfaceOrientationLandscapeRight"]+ modes = info.setdefault("UIBackgroundModes", [])+ if "audio" not in modes:+ modes.append("audio")+ return info+++def read_profile(path):+ return plistlib.loads(run("security", "cms", "-D", "-i", path, capture=True))+++def find_profile(explicit=None):+ roots = [Path.home() / "Library/Developer/Xcode/UserData/Provisioning Profiles",+ Path.home() / "Library/MobileDevice/Provisioning Profiles"]+ candidates = [Path(explicit)] if explicit else [p for root in roots for p in root.glob("*.mobileprovision")]+ matches = []+ for path in candidates:+ profile = read_profile(path)+ entitlements = profile["Entitlements"]+ if entitlements.get("application-identifier", "").endswith("." + BUNDLE_ID) and entitlements.get("com.apple.developer.carplay-video"):+ matches.append((path, profile))+ if not matches:+ raise ValueError("No authorized CarPlay video provisioning profile for " + BUNDLE_ID)+ path, profile = max(matches, key=lambda pair: pair[1]["ExpirationDate"])+ if profile["ExpirationDate"] < datetime.datetime.utcnow():+ raise ValueError("CarPlay provisioning profile has expired")+ return path, profile+++def signing_entitlements(profile):+ authorized = profile["Entitlements"]+ application_id = authorized["application-identifier"]+ return {"application-identifier": application_id,+ "com.apple.developer.team-identifier": authorized["com.apple.developer.team-identifier"],+ "keychain-access-groups": [application_id],+ "get-task-allow": authorized.get("get-task-allow", False),+ **{key: authorized[key] for key in ("com.apple.developer.carplay-audio", "com.apple.developer.carplay-video") if key in authorized}}+++def signing_identity(profile, explicit=None):+ identities = run("security", "find-identity", "-v", "-p", "codesigning", capture=True).decode()+ for certificate in profile["DeveloperCertificates"]:+ fingerprint = hashlib.sha1(certificate).hexdigest().upper()+ if fingerprint in identities and (not explicit or explicit == fingerprint or explicit in identities.split(fingerprint, 1)[1].split("\n", 1)[0]):+ return fingerprint+ raise ValueError("No local signing identity matches this profile's DeveloperCertificates")+++def build_dylib(destination):+ destination.parent.mkdir(parents=True, exist_ok=True)+ sdk = run("xcrun", "--sdk", "iphoneos", "--show-sdk-path", capture=True).decode().strip()+ with tempfile.TemporaryDirectory(prefix="youmod-module-") as temp:+ objects = []+ for source in ("YCPNative", "YCPHooks", "YCPWatchLayout", "YCPResponsiveLayout", "YCPBrowseLayout", "YCPHeaderLayout"):+ obj = Path(temp) / (source + ".o")+ run("xcrun", "clang", "-target", "arm64-apple-ios17.0", "-isysroot", sdk,+ "-fobjc-arc", "-g0", "-ffile-prefix-map=" + str(ROOT) + "=.", "-fdebug-prefix-map=" + str(ROOT) + "=.", "-Wall", "-Wextra", "-Werror", "-Wno-unused-parameter",+ "-c", ROOT / ("CarPlay/" + source + ".m"), "-o", obj)+ objects.append(obj)+ run("xcrun", "swiftc", "-emit-library", "-target", "arm64-apple-ios17.0", "-sdk", sdk,+ "-file-prefix-map", str(ROOT) + "=.", "-debug-prefix-map", str(ROOT) + "=.",+ "-module-name", "YouTubeCarPlay", ROOT / "CarPlay/YCPKeyboard.swift", *objects,+ "-framework", "UIKit", "-framework", "CarPlay", "-framework", "Foundation",+ "-Xlinker", "-install_name", "-Xlinker", "@rpath/YouTubeCarPlay.dylib", "-o", destination)+ run("codesign", "--remove-signature", destination)+++def extract_ipa(source, directory):+ with zipfile.ZipFile(source) as archive:+ for entry in archive.infolist():+ if not (directory / entry.filename).resolve().is_relative_to(directory.resolve()):+ raise ValueError("Unsafe path in input archive")+ archive.extractall(directory)+ apps = list((directory / "Payload").glob("*.app"))+ if len(apps) != 1:+ raise ValueError("Expected exactly one app under Payload")+ return apps[0]+++def main():+ global BUNDLE_ID+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument("--ipa", type=Path)+ parser.add_argument("--profile", type=Path)+ parser.add_argument("--identity")+ parser.add_argument("--cyan", help="Optional cyan executable; default: current Python -m cyan")+ parser.add_argument("--bundle-id", default=BUNDLE_ID, help="App ID authorized by your own provisioning profile")+ parser.add_argument("--unsigned", action="store_true", help="Package without certificates, profiles, or signing entitlements")+ parser.add_argument("--reported-version", default="21.45.4", help="Bundle-version compatibility value; use native to disable")+ parser.add_argument("--keep-extra-tweaks", action="store_true")+ parser.add_argument("--compile-only", action="store_true")+ parser.add_argument("--device", help="Confirmed physical iPhone identifier; installs and launches when supplied")+ args = parser.parse_args()+ BUNDLE_ID = args.bundle_id+ if args.unsigned and args.device:+ parser.error("Unsigned apps must be signed with your own profile before device installation")+ output = ROOT / "build"+ output.mkdir(exist_ok=True)+ dylib = output / "YouTubeCarPlay.dylib"+ build_dylib(dylib)+ if args.compile_only:+ print("Compiled", dylib)+ return+ if not args.ipa or not args.ipa.is_file():+ parser.error("--ipa must point to the supplied native YouTube IPA")+ profile_path, profile, identity = None, None, None+ if not args.unsigned:+ profile_path, profile = find_profile(args.profile)+ identity = signing_identity(profile, args.identity)+ if args.device:+ run("xcrun", "devicectl", "device", "info", "details", "--device", args.device,+ "--json-output", output / "device.json", capture=True)+ details = json.loads((output / "device.json").read_text())+ result = details["result"]+ udid = result.get("properties", {}).get("hardware", {}).get("udid") or result.get("hardwareProperties", {}).get("udid")+ if udid not in profile.get("ProvisionedDevices", []):+ raise ValueError("Selected iPhone is not registered in this provisioning profile")+ with tempfile.TemporaryDirectory(prefix="youtube-carplay-") as temp:+ temp = Path(temp)+ app = extract_ipa(args.ipa, temp / "original")+ info_path = app / "Info.plist"+ info = plistlib.loads(info_path.read_bytes())+ executable = app / info["CFBundleExecutable"]+ original_id = info["CFBundleIdentifier"]+ original_version = info["CFBundleShortVersionString"]+ data = executable.read_bytes()+ if data[:4] != b"\xcf\xfa\xed\xfe":+ run("xcrun", "lipo", executable, "-thin", "arm64", "-output", temp / "thin")+ data = (temp / "thin").read_bytes()+ assert_decrypted(data)+ removed = []+ if not args.keep_extra_tweaks:+ data, removed = remove_optional_tweaks(data)+ executable.write_bytes(data)+ # Unloaded optional dylibs remain absent from the app, not just disabled.+ for dependency in removed:+ path = app / "Frameworks" / Path(dependency).name+ if path.is_file():+ path.unlink()+ patch_scene_manifest(info)+ info["CFBundleIdentifier"] = BUNDLE_ID+ info["CFBundleDisplayName"] = "YouTube Car"+ if args.reported_version != "native":+ info["YCPActualYouTubeVersion"] = original_version+ info["YCPActualYouTubeBuild"] = info["CFBundleVersion"]+ info["CFBundleShortVersionString"] = args.reported_version+ info["CFBundleVersion"] = args.reported_version+ # Invalid after changing Google's signing team. These are optional features.+ info.pop("BGTaskSchedulerPermittedIdentifiers", None)+ info["UIBackgroundModes"] = [mode for mode in info["UIBackgroundModes"] if mode == "audio"]+ info_path.write_bytes(plistlib.dumps(info))+ signed_app = temp / "signed/Payload/YouTube.app"+ cyan_command = [args.cyan] if args.cyan else [sys.executable, "-m", "cyan"]+ run(*cyan_command, "-i", app, "-o", signed_app, "-f", dylib, "-u", "-w", "-e")+ for directory in signed_app.rglob("_CodeSignature"):+ if directory.is_dir():+ shutil.rmtree(directory)+ for provision in signed_app.rglob("*.mobileprovision"):+ provision.unlink()+ if not args.unsigned:+ shutil.copy2(profile_path, signed_app / "embedded.mobileprovision")+ entitlements = signing_entitlements(profile)+ ent_path = temp / "entitlements.plist"+ ent_path.write_bytes(plistlib.dumps(entitlements))+ binary_paths = []+ for path in signed_app.rglob("*"):+ if path.is_file() and not path.is_symlink():+ with path.open("rb") as stream:+ if stream.read(4) in MACHO_MAGICS and path != signed_app / info["CFBundleExecutable"]:+ binary_paths.append(path)+ if args.unsigned:+ # Remove every input signature, not just the app's outer signature.+ # A distributable unsigned IPA must not contain someone's Team ID,+ # provisioning profile, signing certificate, or signed entitlements.+ for path in sorted(binary_paths, key=lambda p: len(p.parts), reverse=True):+ signature = subprocess.run(["codesign", "-d", str(path)], capture_output=True)+ if signature.returncode == 0:+ run("codesign", "--remove-signature", path)+ elif b"not signed at all" not in signature.stderr:+ raise RuntimeError("Could not inspect nested code signature: " + path.name)+ signature = subprocess.run(["codesign", "-d", str(signed_app)], capture_output=True)+ if signature.returncode == 0:+ run("codesign", "--remove-signature", signed_app)+ elif b"not signed at all" not in signature.stderr:+ raise RuntimeError("Could not inspect app signature")+ else:+ for path in sorted(binary_paths, key=lambda p: len(p.parts), reverse=True):+ run("codesign", "--force", "--sign", identity, "--timestamp=none", path)+ for framework in sorted(signed_app.rglob("*.framework"), key=lambda p: len(p.parts), reverse=True):+ run("codesign", "--force", "--sign", identity, "--timestamp=none", framework)+ run("codesign", "--force", "--sign", identity, "--timestamp=none", "--entitlements", ent_path, signed_app)+ run("codesign", "--verify", "--deep", "--strict", signed_app)+ signed_info = plistlib.loads((signed_app / "Info.plist").read_bytes())+ assert signed_info["CFBundleIdentifier"] == BUNDLE_ID+ dependencies = run("xcrun", "otool", "-L", signed_app / info["CFBundleExecutable"], capture=True).decode()+ assert "@rpath/YouTubeCarPlay.dylib" in dependencies, "CarPlay module was not injected"+ destination = ROOT / "dist"+ destination.mkdir(exist_ok=True)+ app_destination = destination / "YouTube.app"+ if app_destination.exists():+ shutil.rmtree(app_destination)+ shutil.copytree(signed_app, app_destination)+ ipa_destination = destination / ("YouTubeCarPlay-" + original_version + ("-unsigned" if args.unsigned else "") + ".ipa")+ run("ditto", "-c", "-k", "--keepParent", signed_app.parent, ipa_destination)+ metadata = {"bundle_id": BUNDLE_ID, "youtube_version": original_version, "input_bundle_id": original_id,+ "input_sha256": hashlib.sha256(args.ipa.read_bytes()).hexdigest(),+ "output_sha256": hashlib.sha256(ipa_destination.read_bytes()).hexdigest(),+ "reported_version": signed_info["CFBundleShortVersionString"],+ "removed_optional_tweaks": removed, "unsigned": args.unsigned,+ "device_tested": False}+ (destination / "build-manifest.json").write_text(json.dumps(metadata, indent=2) + "\n")+ print("Packaged app:", app_destination, "\nIPA:", ipa_destination)+ if args.device:+ run("xcrun", "devicectl", "device", "install", "app", "--device", args.device, app_destination)+ run("xcrun", "devicectl", "device", "process", "launch", "--device", args.device, BUNDLE_ID)+++if __name__ == "__main__":+ main()diff --git a/scripts/package_release.py b/scripts/package_release.pynew file mode 100644index 0000000..c6dbec2--- /dev/null+++ b/scripts/package_release.py@@ -0,0 +1,51 @@+#!/usr/bin/env python3+"""Package a source/module kit without any app input, profiles, or credentials."""+import hashlib+import json+from pathlib import Path+import shutil+import subprocess+import zipfile++ROOT = Path(__file__).resolve().parents[1]+OUT = ROOT / 'release'+VERSION = 'v0.1.0'++def digest(path):+ return hashlib.sha256(path.read_bytes()).hexdigest()++def main():+ module = ROOT / 'build/YouTubeCarPlay.dylib'+ if not module.is_file():+ raise SystemExit('Run scripts/build_carplay.py --compile-only first.')+ OUT.mkdir(exist_ok=True)+ shutil.copy2(module, OUT / module.name)+ tracked = subprocess.check_output(['git', 'ls-files', '-z'], cwd=ROOT).decode().split('\0')+ kit = OUT / ('YouTube-Car-' + VERSION + '-build-kit.zip')+ with zipfile.ZipFile(kit, 'w', compression=zipfile.ZIP_DEFLATED) as archive:+ for name in tracked:+ if name:+ archive.write(ROOT / name, 'YouTube-Car/' + name)+ archive.write(module, 'YouTube-Car/module/' + module.name)+ revision = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=ROOT).decode().strip()+ manifest = {'project': 'YouTube Car', 'release': VERSION, 'source_revision': revision,+ 'actual_youtube_version': '21.42.4', 'reported_version': '21.45.4',+ 'youmod_version': '2.0.0', 'deployment_target': 'iOS 17.0', 'signed': False,+ 'contains_provisioning_profile': False, 'contains_google_application': False,+ 'contains_unrelated_app_source': False, 'device_certified': False,+ 'artifacts': {path.name: digest(path) for path in [kit, OUT / module.name]}}+ (OUT / 'release-manifest.json').write_text(json.dumps(manifest, indent=2) + '\n')+ (OUT / 'PRIVACY-REVIEW.txt').write_text(+ 'Fresh standalone history. Source and module audited before upload.\n'+ 'No known owner-specific names, device IDs, personal paths, signing profiles,\n'+ 'private certificates/keys, app-container data, or unrelated app folders included.\n'+ 'The module contains no code signature. Examples use generic app IDs.\n'+ 'Third-party app IPA excluded after conservative binary-sharing audit.\n'+ 'Use the builder with your own authorized input to generate an IPA locally.\n'+ 'Automated pattern matching is not a guarantee of absence of all secrets.\n')+ names = ['YouTubeCarPlay.dylib', kit.name, 'release-manifest.json', 'PRIVACY-REVIEW.txt']+ (OUT / 'SHA256SUMS').write_text(''.join(digest(OUT / name) + ' ' + name + '\n' for name in sorted(names)))+ print('Prepared source/module release kit. Audit before uploading.')++if __name__ == '__main__':+ main()diff --git a/scripts/update_carplay_module.py b/scripts/update_carplay_module.pynew file mode 100644index 0000000..c205bca--- /dev/null+++ b/scripts/update_carplay_module.py@@ -0,0 +1,76 @@+#!/usr/bin/env python3+"""Fast device iteration: replace only our dylib in the already packaged app."""+import argparse+import json+from pathlib import Path+import plistlib+import re+import shutil+import tempfile+import build_carplay as build++from build_carplay import ROOT, BUNDLE_ID, build_dylib, read_profile, signing_identity, signing_entitlements, remove_optional_tweaks, run+++def main():+ global BUNDLE_ID+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument("--device", required=True)+ version = parser.add_mutually_exclusive_group()+ version.add_argument("--reported-version", help="Reversible bundle-version compatibility override")+ version.add_argument("--restore-reported-version", action="store_true")+ parser.add_argument("--reuse-module", action="store_true", help="Only re-sign metadata; retain the current compiled CarPlay module")+ args = parser.parse_args()+ if args.reported_version and not re.fullmatch(r"[0-9]+(?:\.[0-9]+){1,2}", args.reported_version):+ parser.error("--reported-version must be a numeric app version")+ app = ROOT / "dist/YouTube.app"+ info = plistlib.loads((app / "Info.plist").read_bytes())+ if not (app / "Frameworks/YouTubeCarPlay.dylib").is_file():+ raise ValueError("Refusing to modify an app without the CarPlay module")+ BUNDLE_ID = info["CFBundleIdentifier"]+ build.BUNDLE_ID = BUNDLE_ID+ profile = read_profile(app / "embedded.mobileprovision")+ run("xcrun", "devicectl", "device", "info", "details", "--device", args.device,+ "--json-output", ROOT / ".local/update-device.json", capture=True)+ device = json.loads((ROOT / ".local/update-device.json").read_text())["result"]+ udid = device.get("properties", {}).get("hardware", {}).get("udid") or device.get("hardwareProperties", {}).get("udid")+ if udid not in profile.get("ProvisionedDevices", []):+ raise ValueError("Device is not registered in the profile")+ identity = signing_identity(profile)+ executable = app / info["CFBundleExecutable"]+ native_binary, removed = remove_optional_tweaks(executable.read_bytes())+ if removed:+ executable.write_bytes(native_binary)+ print("Disabled optional playback/request patches:", ", ".join(removed))+ installed_dylib = app / "Frameworks/YouTubeCarPlay.dylib"+ if args.reuse_module:+ if not installed_dylib.is_file():+ raise ValueError("No existing CarPlay module to reuse")+ else:+ dylib = ROOT / "build/YouTubeCarPlay.dylib"+ build_dylib(dylib)+ shutil.copy2(dylib, installed_dylib)+ run("codesign", "--force", "--sign", identity, "--timestamp=none", installed_dylib)+ if args.reported_version:+ info.setdefault("YCPActualYouTubeVersion", info["CFBundleShortVersionString"])+ info.setdefault("YCPActualYouTubeBuild", info["CFBundleVersion"])+ info["CFBundleShortVersionString"] = args.reported_version+ info["CFBundleVersion"] = args.reported_version+ print("Version compatibility override:", info["YCPActualYouTubeVersion"], "reports", args.reported_version)+ elif args.restore_reported_version:+ if "YCPActualYouTubeVersion" in info:+ info["CFBundleShortVersionString"] = info.pop("YCPActualYouTubeVersion")+ info["CFBundleVersion"] = info.pop("YCPActualYouTubeBuild")+ (app / "Info.plist").write_bytes(plistlib.dumps(info))+ with tempfile.TemporaryDirectory() as temp:+ entitlements = Path(temp) / "entitlements.plist"+ entitlements.write_bytes(plistlib.dumps(signing_entitlements(profile)))+ run("codesign", "--force", "--sign", identity, "--timestamp=none", "--entitlements", entitlements, app)+ run("codesign", "--verify", "--deep", "--strict", app)+ run("xcrun", "devicectl", "device", "install", "app", "--device", args.device, app)+ run("xcrun", "devicectl", "device", "process", "launch", "--device", args.device, BUNDLE_ID)+ print("Updated device app. Run build_carplay.py to refresh the distributable IPA.")+++if __name__ == "__main__":+ main()diff --git a/tests/native_surface_harness.m b/tests/native_surface_harness.mnew file mode 100644index 0000000..f10ee2b--- /dev/null+++ b/tests/native_surface_harness.m@@ -0,0 +1,95 @@+#import "YCPNative.h"+#import "YCPResponsiveLayout.h"++// An initialized app root with real navigation content, without Google's binary.+@interface YTAppViewControllerImpl : UIViewController+@property(nonatomic, strong) UINavigationController *appNavigationController;+@end+@implementation YTAppViewControllerImpl+- (instancetype)init {+ if ((self = [super init])) {+ UIViewController *feed = [UIViewController new];+ feed.title = @"Loaded feed";+ self.appNavigationController = [[UINavigationController alloc] initWithRootViewController:feed];+ }+ return self;+}+- (void)viewDidLoad {+ [super viewDidLoad];+ [self addChildViewController:self.appNavigationController];+ self.appNavigationController.view.frame = self.view.bounds;+ self.appNavigationController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;+ [self.view addSubview:self.appNavigationController.view];+ [self.appNavigationController didMoveToParentViewController:self];+}+@end++void YCPBootstrapNativeScene(UIWindowScene *scene, UISceneSession *session, UISceneConnectionOptions *options) {}++@interface HarnessDelegate : UIResponder <UIApplicationDelegate>+@property(nonatomic, strong) UIWindow *mainWindow;+@end+@implementation HarnessDelegate+- (BOOL)application:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)options {+ self.mainWindow = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 390, 844)];+ dispatch_async(dispatch_get_main_queue(), ^{+ YCPSurface *surface = YCPSurface.shared;+ UIWindow *first = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 1000, 570)];+ [surface connectWindow:first];+ YTAppViewControllerImpl *native = [YTAppViewControllerImpl new];+ self.mainWindow.rootViewController = native;+ [self.mainWindow makeKeyAndVisible];+ BOOL originalLayout = native.view.translatesAutoresizingMaskIntoConstraints;+ UIViewController *feed = native.appNavigationController.topViewController;+ [surface reconcile];+ NSCAssert([surface ownsNativeController:native], @"Must transfer initialized root, not build another");+ NSCAssert(self.mainWindow.rootViewController != native, @"Phone must have placeholder");+ NSCAssert(native.view.window == first, @"Loaded interface must be in car window");+ NSCAssert(native.appNavigationController.topViewController == feed, @"Navigation content must survive");+ NSCAssert(native.traitCollection.userInterfaceIdiom == UIUserInterfaceIdiomPad, @"Car host supplies the native tablet layout trait");+ NSArray *sizes = @[[NSValue valueWithCGSize:CGSizeMake(480, 240)], [NSValue valueWithCGSize:CGSizeMake(640, 360)], [NSValue valueWithCGSize:CGSizeMake(800, 480)], [NSValue valueWithCGSize:CGSizeMake(1024, 600)], [NSValue valueWithCGSize:CGSizeMake(1280, 480)], [NSValue valueWithCGSize:CGSizeMake(1920, 720)], [NSValue valueWithCGSize:CGSizeMake(768, 1024)]];+ for (NSValue *value in sizes) {+ YCPScaledContentView *viewport = [[YCPScaledContentView alloc] initWithFrame:(CGRect){CGPointZero, value.CGSizeValue}];+ [first.rootViewController.view addSubview:viewport];+ [viewport setNeedsLayout]; [viewport layoutIfNeeded];+ CGFloat scale = viewport.contentScale;+ CGRect visible = [viewport.canvas convertRect:viewport.canvas.bounds toView:viewport];+ NSCAssert(fabs(visible.size.width - viewport.bounds.size.width) < 0.01 && fabs(visible.size.height - viewport.bounds.size.height) < 0.01, @"Scaled canvas must fill both axes without cropping or letterboxing");+ NSCAssert(scale > 0 && scale <= 1, @"Density must stay bounded");+ UIButton *target = [[UIButton alloc] initWithFrame:CGRectMake(100, 100, 44, 44)];+ [viewport.canvas addSubview:target];+ CGPoint physicalPoint = [target convertPoint:CGPointMake(22, 22) toView:viewport];+ NSCAssert([viewport hitTest:physicalPoint withEvent:nil] == target, @"Scaled buttons must receive touches at their visible position");+ if (value.CGSizeValue.width >= 480 && value.CGSizeValue.width < 960 && value.CGSizeValue.width > value.CGSizeValue.height)+ NSCAssert(YCPShouldUseWideWatch(viewport.canvas.bounds.size), @"Small landscape screens must retain the side-by-side watch layout after density adjustment");+ [viewport removeFromSuperview];+ }+ first.frame = CGRectMake(0, 0, 480, 240);+ first.rootViewController.view.frame = first.bounds;+ [first.rootViewController.view setNeedsLayout]; [first.rootViewController.view layoutIfNeeded];+ [native.view.superview.superview setNeedsLayout]; [native.view.superview.superview layoutIfNeeded];+ [native.view.superview setNeedsLayout]; [native.view.superview layoutIfNeeded];+ NSCAssert(surface.contentBounds.size.width >= 820, @"The actual hosted native tree must use logical canvas dimensions on a small car");+ UIWindow *replacement = [[UIWindow alloc] initWithFrame:first.frame];+ [surface connectWindow:replacement];+ NSCAssert(first.rootViewController == nil, @"Old car window must release host");+ NSCAssert(native.view.window == replacement, @"One native tree must move to replacement");+ [surface disconnectWindow:first];+ NSCAssert([surface ownsNativeController:native], @"Stale disconnect must not release active root");+ [surface disconnectWindow:replacement];+ NSCAssert(self.mainWindow.rootViewController == native, @"Disconnect must restore exact phone root");+ NSCAssert(native.parentViewController == nil, @"Restored root must leave host containment");+ NSCAssert(native.view.translatesAutoresizingMaskIntoConstraints == originalLayout, @"Restore root layout behavior");+ [surface connectWindow:replacement];+ NSCAssert([surface ownsNativeController:native], @"Reconnect must reuse initialized root");+ [surface disconnectWindow:replacement];+ NSCAssert(self.mainWindow.rootViewController == native, @"Repeated disconnect must restore root");+ NSLog(@"NATIVE_SURFACE_TESTS_PASSED");+ exit(0);+ });+ return YES;+}+@end+int main(int argc, char **argv) {+ @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass(HarnessDelegate.class)); }+}diff --git a/tests/run_native_surface.py b/tests/run_native_surface.pynew file mode 100644index 0000000..09c2713--- /dev/null+++ b/tests/run_native_surface.py@@ -0,0 +1,38 @@+"""Run native window-transfer regression checks in a booted iOS simulator.++Usage: python3 tests/run_native_surface.py SIMULATOR_UDID+"""+import pathlib+import plistlib+import subprocess+import sys+import tempfile++root = pathlib.Path(__file__).resolve().parents[1]+def run(*args):+ result = subprocess.run([str(a) for a in args], capture_output=True, text=True)+ if result.returncode:+ sys.stderr.write(result.stdout + result.stderr)+ result.check_returncode()+ return result+with tempfile.TemporaryDirectory(prefix="youmod-surface-test-") as temp:+ app = pathlib.Path(temp) / "SurfaceTests.app"+ app.mkdir()+ sdk = run("xcrun", "--sdk", "iphonesimulator", "--show-sdk-path").stdout.strip()+ run("xcrun", "clang", "-target", "arm64-apple-ios17.0-simulator", "-isysroot", sdk,+ "-fobjc-arc", "-I", root / "CarPlay", "-framework", "UIKit", "-framework", "CarPlay",+ "-framework", "Foundation", "-framework", "CoreGraphics", root / "CarPlay/YCPNative.m", root / "CarPlay/YCPResponsiveLayout.m", root / "tests/native_surface_harness.m",+ "-o", app / "SurfaceTests")+ (app / "Info.plist").write_bytes(plistlib.dumps({+ "CFBundleIdentifier": "io.github.youtubecar.surface-tests", "CFBundleExecutable": "SurfaceTests",+ "CFBundleName": "SurfaceTests", "CFBundlePackageType": "APPL", "CFBundleVersion": "1",+ "CFBundleShortVersionString": "1", "MinimumOSVersion": "17.0",+ "UIDeviceFamily": [1], "UILaunchScreen": {},+ }))+ run("codesign", "--force", "--sign", "-", app)+ run("xcrun", "simctl", "install", sys.argv[1], app)+ result = run("xcrun", "simctl", "launch", "--console", "--terminate-running-process", sys.argv[1], "io.github.youtubecar.surface-tests")+ output = result.stdout + result.stderr+ if "NATIVE_SURFACE_TESTS_PASSED" not in output:+ raise RuntimeError(output)+ print("Native surface regression checks passed: startup, transfer, navigation, traits, replacement, restoration, reconnect")diff --git a/tests/run_watch_layout.py b/tests/run_watch_layout.pynew file mode 100644index 0000000..d4c8066--- /dev/null+++ b/tests/run_watch_layout.py@@ -0,0 +1,38 @@+"""Run native iPad watch-layout regression checks in a booted iOS simulator.++Usage: python3 tests/run_watch_layout.py SIMULATOR_UDID+"""+import pathlib+import plistlib+import subprocess+import sys+import tempfile++root = pathlib.Path(__file__).resolve().parents[1]+def run(*args):+ result = subprocess.run([str(a) for a in args], capture_output=True, text=True)+ if result.returncode:+ sys.stderr.write(result.stdout + result.stderr)+ result.check_returncode()+ return result+with tempfile.TemporaryDirectory(prefix="youmod-surface-test-") as temp:+ app = pathlib.Path(temp) / "SurfaceTests.app"+ app.mkdir()+ sdk = run("xcrun", "--sdk", "iphonesimulator", "--show-sdk-path").stdout.strip()+ run("xcrun", "clang", "-target", "arm64-apple-ios17.0-simulator", "-isysroot", sdk,+ "-fobjc-arc", "-I", root / "CarPlay", "-framework", "UIKit", "-framework", "CarPlay",+ "-framework", "Foundation", "-framework", "CoreGraphics", root / "CarPlay/YCPWatchLayout.m", root / "CarPlay/YCPResponsiveLayout.m", root / "CarPlay/YCPBrowseLayout.m", root / "CarPlay/YCPHeaderLayout.m", root / "tests/watch_layout_harness.m",+ "-o", app / "SurfaceTests")+ (app / "Info.plist").write_bytes(plistlib.dumps({+ "CFBundleIdentifier": "io.github.youtubecar.watch-layout-tests", "CFBundleExecutable": "SurfaceTests",+ "CFBundleName": "SurfaceTests", "CFBundlePackageType": "APPL", "CFBundleVersion": "1",+ "CFBundleShortVersionString": "1", "MinimumOSVersion": "17.0",+ "UIDeviceFamily": [1], "UILaunchScreen": {},+ }))+ run("codesign", "--force", "--sign", "-", app)+ run("xcrun", "simctl", "install", sys.argv[1], app)+ result = run("xcrun", "simctl", "launch", "--console", "--terminate-running-process", sys.argv[1], "io.github.youtubecar.watch-layout-tests")+ output = result.stdout + result.stderr+ if "WATCH_LAYOUT_TESTS_PASSED" not in output:+ raise RuntimeError(output)+ print("Responsive layout checks passed: seven screen sizes, mini-player bounds/aspect ratio, native split-metadata fix, watch layout, phone isolation, disconnect, search/metadata grid isolation, car header scroll/reveal configuration")diff --git a/tests/test_packaging.py b/tests/test_packaging.pynew file mode 100644index 0000000..5781eef--- /dev/null+++ b/tests/test_packaging.py@@ -0,0 +1,76 @@+import copy+import importlib.util+from pathlib import Path+import struct+import unittest++spec = importlib.util.spec_from_file_location("build_carplay", Path(__file__).resolve().parents[1] / "scripts/build_carplay.py")+build = importlib.util.module_from_spec(spec)+spec.loader.exec_module(build)+++def dylib(name, kind=0x80000018):+ encoded = name.encode() + b"\0"+ size = (24 + len(encoded) + 7) & ~7+ return struct.pack("<IIIIII", kind, size, 24, 0, 0, 0) + encoded + bytes(size - 24 - len(encoded))+++def binary(*entries):+ commands = b"".join(entries)+ header = struct.pack("<IIIIIIII", 0xFEEDFACF, 0x100000C, 0, 2, len(entries), len(commands), 0, 0)+ return header + commands + b"unchanged executable content"+++class PackagingTests(unittest.TestCase):+ def test_optional_removal_preserves_native_dependencies_and_file_offsets(self):+ native = dylib("/System/Library/Frameworks/UIKit.framework/UIKit", 0xC)+ youmod = dylib("@rpath/YouMod.dylib")+ swift = dylib("@rpath/libswiftCompatibilitySpan.dylib")+ optional = dylib("@rpath/VolumeBoostYT.dylib")+ source = binary(native, optional, youmod, swift)+ patched, removed = build.remove_optional_tweaks(source)+ self.assertEqual(removed, ["@rpath/VolumeBoostYT.dylib"])+ self.assertEqual([entry for _, entry in build.commands(patched)], [native, youmod, swift])+ self.assertEqual(len(source), len(patched))+ offset = 32 + struct.unpack_from("<I", source, 20)[0]+ self.assertEqual(source[offset:], patched[offset:])+ self.assertEqual(build.remove_optional_tweaks(patched), (patched, []))++ def test_rejects_corrupt_command_tables(self):+ source = bytearray(binary(dylib("@rpath/YouMod.dylib")))+ struct.pack_into("<I", source, 36, 0)+ with self.assertRaises(ValueError):+ build.remove_optional_tweaks(source)+ with self.assertRaises(ValueError):+ build.commands(b"not a macho")++ def test_rejects_encrypted_input(self):+ encrypted = struct.pack("<IIIIII", 0x2C, 24, 16384, 100, 1, 0)+ with self.assertRaisesRegex(ValueError, "encrypted"):+ build.assert_decrypted(binary(encrypted))+ decrypted = struct.pack("<IIIIII", 0x2C, 24, 16384, 100, 0, 0)+ build.assert_decrypted(binary(decrypted))++ def test_native_phone_lifecycle_and_other_configurations_survive(self):+ phone = [{"UISceneConfigurationName": "Default Configuration", "UISceneDelegateClassName": "YTSceneDelegate", "UISceneClassName": "UIWindowScene"}]+ info = {"UIApplicationSceneManifest": {"UIApplicationSupportsMultipleScenes": False,+ "UISceneConfigurations": {"UIWindowSceneSessionRoleApplication": copy.deepcopy(phone), "another-role": [{"custom": True}]}}, "UIBackgroundModes": ["audio"]}+ build.patch_scene_manifest(info)+ configurations = info["UIApplicationSceneManifest"]["UISceneConfigurations"]+ self.assertEqual(configurations["UIWindowSceneSessionRoleApplication"], phone)+ self.assertEqual(configurations["another-role"], [{"custom": True}])+ self.assertEqual(configurations["UIWindowSceneSessionRoleCarPlay"][0]["UISceneDelegateClassName"], "YCPWindowDelegate")+ self.assertEqual(configurations["CPTemplateApplicationSceneSessionRoleApplication"][0]["UISceneDelegateClassName"], "YCPTemplateDelegate")++ def test_no_foreign_entitlements_copied(self):+ app_id = "TEAM." + build.BUNDLE_ID+ result = build.signing_entitlements({"Entitlements": {"application-identifier": app_id,+ "com.apple.developer.team-identifier": "TEAM", "com.apple.developer.carplay-video": True,+ "keychain-access-groups": ["TEAM.*"], "com.apple.security.application-groups": ["foreign.group"]}})+ self.assertEqual(result["keychain-access-groups"], [app_id])+ self.assertNotIn("com.apple.security.application-groups", result)+ self.assertTrue(result["com.apple.developer.carplay-video"])+++if __name__ == "__main__":+ unittest.main()diff --git a/tests/watch_layout_harness.m b/tests/watch_layout_harness.mnew file mode 100644index 0000000..48e9db1--- /dev/null+++ b/tests/watch_layout_harness.m@@ -0,0 +1,271 @@+#import "YCPNative.h"+#import "YCPResponsiveLayout.h"++@interface UIView (FixtureWindowInsets)+- (UIEdgeInsets)yt_safeAreaInsetsForWindow;+- (UIEdgeInsets)yt_safeAreaInsetsForBrowse;+@end+@implementation UIView (FixtureWindowInsets)+- (UIEdgeInsets)yt_safeAreaInsetsForWindow { return UIEdgeInsetsMake(60, 7, 9, 11); }+- (UIEdgeInsets)yt_safeAreaInsetsForBrowse { return UIEdgeInsetsMake(60, 0, 0, 0); }+@end++@protocol YTWatchLayoutController <NSObject>+@end+@interface FixtureCarWindow : UIWindow @end+@implementation FixtureCarWindow+- (UIEdgeInsets)safeAreaInsets { return UIEdgeInsetsMake(0, 48, 0, 0); }+@end+static UIWindow *TestCarWindow;+@implementation YCPSurface++ (instancetype)shared { static YCPSurface *s; static dispatch_once_t once; dispatch_once(&once, ^{ s = [self new]; }); return s; }+- (UIWindow *)activeWindow { return TestCarWindow; }+- (CGRect)contentBounds { return TestCarWindow.bounds; }+- (UIEdgeInsets)miniPlayerSafeInsets { return UIEdgeInsetsMake(0, 0, 64, 0); }+@end++@interface FixtureWatchLayoutController : NSObject <YTWatchLayoutController>+@property(nonatomic, weak) UIView *watchLayerView;+- (BOOL)isLargeLayout;+- (BOOL)isLargeWideLayout;+- (BOOL)isLandscape;+- (NSInteger)interfaceOrientation;+@end+@implementation FixtureWatchLayoutController+- (BOOL)isLargeLayout { return NO; }+- (BOOL)isLargeWideLayout { return NO; }+- (BOOL)isLandscape { return NO; }+- (NSInteger)interfaceOrientation { return UIInterfaceOrientationPortrait; }+@end++@interface YTWatchViewController : UIViewController+- (BOOL)isWideLayoutForWatchView:(UIView *)view;+@end+@implementation YTWatchViewController+- (BOOL)isWideLayoutForWatchView:(UIView *)view { return NO; }+@end++@interface YTWatchNextResultsViewController : UIViewController+- (UIEdgeInsets)collectionView:(UICollectionView *)collection layout:(UICollectionViewLayout *)layout insetForSectionAtIndex:(NSInteger)section;+@end+@implementation YTWatchNextResultsViewController+- (UIEdgeInsets)collectionView:(UICollectionView *)collection layout:(UICollectionViewLayout *)layout insetForSectionAtIndex:(NSInteger)section {+ return UIEdgeInsetsMake(-6, 10, 4, 10);+}+@end++@interface YTWatchLayerViewController : UIViewController+- (CGFloat)statusBarHeight;+- (CGFloat)headerHeight;+@end+@implementation YTWatchLayerViewController+- (CGFloat)statusBarHeight { return 60; }+- (CGFloat)headerHeight { return 60; }+@end++@interface YTWatchMiniplayerLayoutOutput : NSObject+- (CGRect)miniplayerFrame;+@end+@implementation YTWatchMiniplayerLayoutOutput+- (CGRect)miniplayerFrame { return CGRectMake(900, 800, 500, 300); }+@end+@interface FixtureNativeConfig : NSObject+- (BOOL)enableIosSplitMetadataViewFix;+@end+@implementation FixtureNativeConfig+- (BOOL)enableIosSplitMetadataViewFix { return NO; }+@end++@interface YTHomeViewController : UIViewController @end+@implementation YTHomeViewController @end+@interface YTSearchResultsViewController : UIViewController @end+@implementation YTSearchResultsViewController @end+@interface YTWatchMetadataViewController : UIViewController @end+@implementation YTWatchMetadataViewController @end+@interface FixtureGridSection : NSObject+@property(nonatomic, strong) id feedController;+@end+@implementation FixtureGridSection @end++@interface FixtureNavigationBar : UIView+@property(nonatomic, strong) UIColor *barTintColor;+@end+@implementation FixtureNavigationBar @end+@interface YTHeaderView : FixtureNavigationBar+@property(nonatomic) BOOL headerScrollEnabled;+@property(nonatomic) BOOL stickyNavHeaderEnabled;+@property(nonatomic) CGFloat maximumHeaderHeight;+@property(nonatomic) CGFloat currentHeaderHeight;+- (void)updateBackgroundColor;+- (void)resetHeaderParamsForStatusBarUpdate;+- (void)scrollNavHeaderViewWithOffset:(CGFloat)offset;+@end+@implementation YTHeaderView+- (void)updateBackgroundColor {+ self.barTintColor = UIColor.darkGrayColor;+ self.backgroundColor = UIColor.darkGrayColor;+}+- (void)resetHeaderParamsForStatusBarUpdate {+ self.maximumHeaderHeight = 44 + [self yt_safeAreaInsetsForBrowse].top;+ self.currentHeaderHeight = self.maximumHeaderHeight;+}+- (void)scrollNavHeaderViewWithOffset:(CGFloat)offset {+ if (!self.headerScrollEnabled || self.stickyNavHeaderEnabled) return;+ self.currentHeaderHeight = MIN(self.maximumHeaderHeight, MAX(0, self.currentHeaderHeight - offset));+}+@end++@interface TestApp : UIResponder <UIApplicationDelegate>+@property(nonatomic, strong) UIWindow *window;+@end+@implementation TestApp+- (BOOL)application:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)options {+ self.window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 390, 844)];+ YTWatchViewController *phone = [YTWatchViewController new];+ self.window.rootViewController = phone;+ [self.window makeKeyAndVisible];+ dispatch_async(dispatch_get_main_queue(), ^{+ FixtureWatchLayoutController *layout = [FixtureWatchLayoutController new];+ layout.watchLayerView = phone.view;+ YCPInstallWatchLayoutHooks();+ FixtureNativeConfig *config = [FixtureNativeConfig new];+ YTWatchMiniplayerLayoutOutput *mini = [YTWatchMiniplayerLayoutOutput new];+ NSCAssert(!config.enableIosSplitMetadataViewFix, @"Native metadata setting must remain unchanged outside CarPlay");+ NSCAssert(CGRectEqualToRect(mini.miniplayerFrame, CGRectMake(900, 800, 500, 300)), @"Phone mini-player geometry must remain untouched");+ NSArray *sizes = @[[NSValue valueWithCGSize:CGSizeMake(480, 240)], [NSValue valueWithCGSize:CGSizeMake(640, 360)],+ [NSValue valueWithCGSize:CGSizeMake(800, 480)], [NSValue valueWithCGSize:CGSizeMake(1024, 600)],+ [NSValue valueWithCGSize:CGSizeMake(1280, 480)], [NSValue valueWithCGSize:CGSizeMake(1920, 720)],+ [NSValue valueWithCGSize:CGSizeMake(768, 1024)]];+ for (NSValue *value in sizes) {+ CGSize size = value.CGSizeValue;+ CGRect bounds = (CGRect){CGPointZero, size};+ UIEdgeInsets safe = UIEdgeInsetsMake(0, 48, 64, 0);+ for (NSValue *origin in @[[NSValue valueWithCGPoint:CGPointMake(-999, -999)], [NSValue valueWithCGPoint:CGPointMake(9999, 9999)]]) {+ CGRect requested = (CGRect){origin.CGPointValue, CGSizeMake(500, 300)};+ CGRect fitted = YCPFitMiniPlayer(requested, bounds, safe);+ NSCAssert(CGRectContainsRect(UIEdgeInsetsInsetRect(bounds, safe), fitted), @"Mini-player must stay inside the usable area at every supported test size");+ NSCAssert(fabs(fitted.size.width / fitted.size.height - 16.0/9.0) < 0.001, @"Mini-player must preserve the video aspect ratio");+ }+ }+ NSCAssert(!YCPShouldUseWideWatch(CGSizeMake(800, 480)), @"Short narrow screens must not squeeze two columns");+ NSCAssert(YCPShouldUseWideWatch(CGSizeMake(1024, 600)), @"Wide screens must keep video and queue side by side");+ NSCAssert(!YCPShouldUseWideWatch(CGSizeMake(768, 1024)), @"Tall displays must use the native stacked layout");+ NSCAssert(!layout.isLargeWideLayout && !layout.isLandscape, @"Phone flags must remain original");+ NSCAssert(layout.interfaceOrientation == UIInterfaceOrientationPortrait, @"Phone orientation must remain original");+ TestCarWindow = [[FixtureCarWindow alloc] initWithFrame:CGRectMake(0, 0, 1020, 573)];+ YTWatchViewController *car = [YTWatchViewController new];+ YTWatchLayerViewController *layer = [YTWatchLayerViewController new];+ TestCarWindow.rootViewController = layer;+ [layer addChildViewController:car];+ [layer.view addSubview:car.view];+ [car didMoveToParentViewController:layer];+ TestCarWindow.hidden = NO;+ layout.watchLayerView = car.view;+ UIEdgeInsets nativeInsets = [car.view yt_safeAreaInsetsForWindow];+ NSCAssert(nativeInsets.top == TestCarWindow.safeAreaInsets.top, @"Native window-inset category must discard the phone status-bar height");+ NSCAssert(nativeInsets.left == 7 && nativeInsets.bottom == 9, @"Unrelated native insets must be preserved");+ NSCAssert([phone.view yt_safeAreaInsetsForWindow].top == 60, @"Phone safe-area category must remain unchanged");+ NSCAssert(config.enableIosSplitMetadataViewFix, @"CarPlay must enable the native split-metadata measurement fix");+ NSCAssert(CGRectContainsRect(TestCarWindow.bounds, mini.miniplayerFrame), @"Actual mini-player hook must fit car dimensions");+ NSCAssert(layer.statusBarHeight == TestCarWindow.safeAreaInsets.top, @"Car status inset must use its own window, not the phone's cached height");+ NSCAssert(layer.headerHeight == TestCarWindow.safeAreaInsets.top, @"Car header must not reserve phone navigation space");+ YTWatchLayerViewController *phoneLayer = [YTWatchLayerViewController new];+ NSCAssert(phoneLayer.statusBarHeight == 60 && phoneLayer.headerHeight == 60, @"Other controllers must retain native phone insets");+ NSCAssert(layout.isLargeLayout && layout.isLargeWideLayout && layout.isLandscape, @"Native iPad wide branch must be selected in car");+ NSCAssert(layout.interfaceOrientation == UIInterfaceOrientationLandscapeLeft, @"Watch orientation must follow car geometry");+ NSCAssert([car isWideLayoutForWatchView:car.view], @"Native watch delegate must select the wide renderer");+ NSCAssert(![phone isWideLayoutForWatchView:phone.view], @"Phone delegate must stay unchanged while car connected");+ YTWatchNextResultsViewController *metadataInsets = [YTWatchNextResultsViewController new];+ [car addChildViewController:metadataInsets];+ metadataInsets.view.frame = car.view.bounds;+ [car.view addSubview:metadataInsets.view];+ [metadataInsets didMoveToParentViewController:car];+ UICollectionViewFlowLayout *metadataFlow = [UICollectionViewFlowLayout new];+ UICollectionView *metadataCollection = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 310, 680, 220) collectionViewLayout:metadataFlow];+ [metadataInsets.view addSubview:metadataCollection];+ UIEdgeInsets titleInset = [metadataInsets collectionView:metadataCollection layout:metadataFlow insetForSectionAtIndex:0];+ NSCAssert(titleInset.top == 12 && titleInset.left == 10 && titleInset.bottom == 4, @"First metadata section must clear the player without altering horizontal/bottom spacing");+ metadataCollection.contentOffset = CGPointMake(0, 90);+ (void)[metadataInsets collectionView:metadataCollection layout:metadataFlow insetForSectionAtIndex:0];+ NSCAssert(metadataCollection.contentOffset.y == 90, @"Metadata spacing must never reset the user's scroll position");+ NSCAssert([metadataInsets collectionView:metadataCollection layout:metadataFlow insetForSectionAtIndex:1].top == -6, @"Later metadata sections retain native spacing");+ metadataCollection.frame = CGRectMake(700, 0, 320, 530);+ NSCAssert([metadataInsets collectionView:metadataCollection layout:metadataFlow insetForSectionAtIndex:0].top == -6, @"Right video queue retains native spacing");+ [phone.view addSubview:metadataCollection];+ NSCAssert([metadataInsets collectionView:metadataCollection layout:metadataFlow insetForSectionAtIndex:0].top == -6, @"Phone collection spacing is unchanged");+ layout.watchLayerView = phone.view;+ NSCAssert(!layout.isLargeWideLayout, @"Another window must not inherit car flags");+ UIWindow *gridWindow = [[FixtureCarWindow alloc] initWithFrame:CGRectMake(0, 0, 1020, 573)];+ YTHomeViewController *home = [YTHomeViewController new];+ gridWindow.rootViewController = home; gridWindow.hidden = NO;+ FixtureGridSection *section = [FixtureGridSection new]; section.feedController = home;+ NSCAssert(YCPShouldOverrideBrowseGrid(section, gridWindow), @"Recognized Home sections may use the car grid");+ NSCAssert(!YCPShouldOverrideBrowseGrid([FixtureGridSection new], gridWindow), @"Unknown sections must preserve native layout");+ YTSearchResultsViewController *search = [YTSearchResultsViewController new];+ gridWindow.rootViewController = search;+ section.feedController = search;+ NSCAssert(!YCPShouldOverrideBrowseGrid(section, gridWindow), @"Search rows must never inherit Home columns");+ [search addChildViewController:home]; [search.view addSubview:home.view]; [home didMoveToParentViewController:search];+ section.feedController = home;+ NSCAssert(!YCPShouldOverrideBrowseGrid(section, gridWindow), @"Search ancestors must override a Home-like child name");+ YTWatchMetadataViewController *metadata = [YTWatchMetadataViewController new];+ gridWindow.rootViewController = metadata; section.feedController = metadata;+ NSCAssert(!YCPShouldOverrideBrowseGrid(section, gridWindow), @"Watch metadata must retain its native column measurements");+ NSCAssert(!YCPShouldOverrideBrowseGrid(phone.view, gridWindow), @"Other windows must not receive car grid changes");+ UIWindow *watchCar = TestCarWindow;+ TestCarWindow = gridWindow;+ YCPInstallHeaderLayoutHooks();+ YCPInstallHeaderLayoutHooks();+ YTHomeViewController *headerHome = [YTHomeViewController new];+ gridWindow.rootViewController = headerHome;+ UIScrollView *feedScroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 44, 1020, 520)];+ feedScroll.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;+ feedScroll.alwaysBounceVertical = YES;+ feedScroll.contentSize = CGSizeMake(1020, 2400);+ [headerHome.view addSubview:feedScroll];+ YTHeaderView *header = [[YTHeaderView alloc] initWithFrame:CGRectMake(0, 0, 900, 56)];+ header.headerScrollEnabled = NO; header.stickyNavHeaderEnabled = YES;+ [headerHome.view addSubview:header];+ NSCAssert(header.headerScrollEnabled && !header.stickyNavHeaderEnabled, @"Car browse header must allow native hide/reveal scrolling");+ UIColor *carHeaderColor = [UIColor colorWithWhite:15.0 / 255.0 alpha:1];+ NSCAssert([header.barTintColor isEqual:carHeaderColor], @"Cold-attach header must immediately use YouTube's dark background");+ [header updateBackgroundColor]; header.barTintColor = UIColor.grayColor;+ NSCAssert([header.barTintColor isEqual:carHeaderColor] && [header.backgroundColor isEqual:carHeaderColor], @"Late theme updates must not reintroduce the gray header");+ NSCAssert(header.maximumHeaderHeight == 44, @"Browse header must discard the cached 60-point phone inset");+ YCPRefreshHeaderScrollObservers();+ feedScroll.contentOffset = CGPointMake(0, 80);+ NSCAssert(header.currentHeaderHeight == 0, @"Actual feed scrolling down must collapse the header");+ feedScroll.contentOffset = CGPointMake(0, 55);+ NSCAssert(header.currentHeaderHeight > 0, @"Reversing scroll direction must reveal the header before reaching the top");+ feedScroll.contentOffset = CGPointZero;+ NSCAssert(header.currentHeaderHeight == 44, @"Returning to the top must fully reveal the compact header");+ header.headerScrollEnabled = NO; header.stickyNavHeaderEnabled = YES;+ NSCAssert(header.headerScrollEnabled && !header.stickyNavHeaderEnabled, @"Native configuration updates must not pin the car header");+ [phone.view addSubview:header];+ NSCAssert([header.barTintColor isEqual:UIColor.darkGrayColor], @"Returning to the phone must restore native background updates");+ NSCAssert(!header.headerScrollEnabled && header.stickyNavHeaderEnabled, @"Phone must regain its original header settings");+ YTSearchResultsViewController *headerSearch = [YTSearchResultsViewController new];+ gridWindow.rootViewController = headerSearch;+ YTHeaderView *searchHeader = [YTHeaderView new];+ searchHeader.headerScrollEnabled = NO; searchHeader.stickyNavHeaderEnabled = YES;+ [headerSearch.view addSubview:searchHeader];+ NSCAssert(!searchHeader.headerScrollEnabled && searchHeader.stickyNavHeaderEnabled, @"Search toolbar must not inherit browse-header behavior");+ TestCarWindow = watchCar;+ gridWindow.hidden = YES;+ TestCarWindow.frame = CGRectMake(0, 0, 500, 700);+ layout.watchLayerView = car.view;+ NSCAssert(!layout.isLargeWideLayout, @"Narrow portrait surfaces must retain native layout");+ NSCAssert(layer.statusBarHeight == 60, @"Portrait fallback must restore original status-bar height");+ TestCarWindow = nil;+ NSCAssert(!layout.isLargeWideLayout, @"Disconnect must restore native decisions");+ YCPInstallWatchLayoutHooks();+ NSCAssert(!layout.isLandscape, @"Installing twice must not recurse or replace original");+ NSLog(@"WATCH_LAYOUT_TESTS_PASSED");+ exit(0);+ });+ return YES;+}+@end+int main(int argc, char **argv) {+ @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass(TestApp.class)); }+}diff --git a/vendor/YouMod/Files/Ads.x b/vendor/YouMod/Files/Ads.xnew file mode 100644index 0000000..5a87188--- /dev/null+++ b/vendor/YouMod/Files/Ads.x@@ -0,0 +1,400 @@+#import "Headers.h"++// YouTube-X (https://github.com/PoomSmart/YouTube-X)+static BOOL isProductList(YTICommand *command) {+ if ([command respondsToSelector:@selector(yt_showEngagementPanelEndpoint)]) {+ YTIShowEngagementPanelEndpoint *endpoint = [command yt_showEngagementPanelEndpoint];+ return [endpoint.identifier.tag isEqualToString:@"PAproduct_list"];+ }+ return NO;+}++static NSString *getPostString(NSString *description) {+ static NSArray *postStrings = nil;+ static dispatch_once_t onceToken;+ dispatch_once(&onceToken, ^{+ postStrings = @[+ @"poll_post_root.eml",+ @"options_post_root.eml",+ @"images_post_root_slim.eml",+ @"images_post_responsive_root.eml",+ @"options_post_responsive_root.eml",+ @"post_base_wrapper_slim.eml",+ @"text_post_root_slim.eml",+ @"text_post_responsive_root.eml",+ @"videos_post_root.eml"+ ];+ });+ for (NSString *str in postStrings) {+ if ([description containsString:str]) return str;+ }+ return nil;+}++static NSString *getAdString(NSString *description) {+ static NSArray *adStrings = nil;+ static dispatch_once_t onceToken;+ dispatch_once(&onceToken, ^{+ adStrings = @[+ @"brand_promo",+ @"brand_video_shelf",+ @"brand_video_singleton",+ @"carousel_footered_layout",+ @"carousel_headered_layout",+ @"eml.expandable_metadata",+ @"feed_ad_metadata",+ @"full_width_portrait_image_layout",+ @"full_width_square_image_layout",+ @"grid_ads_image_layout",+ @"landscape_image_wide_button_layout",+ @"post_shelf",+ @"product_carousel",+ @"product_engagement_panel",+ @"product_item",+ @"shopping_carousel",+ @"shopping_item_card_list",+ @"statement_banner",+ @"square_image_layout",+ @"text_image_button_layout",+ @"text_search_ad",+ @"video_display_full_layout",+ @"video_display_full_buttoned_layout"+ ];+ });+ for (NSString *str in adStrings) {+ if ([description containsString:str]) return str;+ }+ return nil;+}++static BOOL isAdRenderer(YTIElementRenderer *elementRenderer, int kind) {+ if ([elementRenderer respondsToSelector:@selector(hasCompatibilityOptions)] && elementRenderer.hasCompatibilityOptions && elementRenderer.compatibilityOptions.hasAdLoggingData) {+ return YES;+ }+ NSString *description = [elementRenderer description];+ NSString *adString = getAdString(description);+ if (adString) return YES;+ return NO;+}++static NSMutableArray <YTIItemSectionRenderer *> *filteredArray(NSArray <YTIItemSectionRenderer *> *array) {+ const BOOL hideShorts = IS_ENABLED(HideShortsShelf);+ const BOOL keepShortsSub = IS_ENABLED(KeepShortsSubscript);+ const BOOL hideFeedPost = IS_ENABLED(HideFeedPost);+ const BOOL hidePlayables = IS_ENABLED(HidePlayables);+ const BOOL hideHoriShelf = IS_ENABLED(HideHoriShelf);+ const BOOL hideCommuGuide = IS_ENABLED(HideCommuGuide);+ const BOOL hideGenMusic = IS_ENABLED(HideGenMusicShelf);+ const BOOL hideSurveys = IS_ENABLED(HideSurveys);+ const BOOL hideComments = IS_ENABLED(HideCommentsSection);++ NSMutableArray <YTIItemSectionRenderer *> *newArray = [array mutableCopy];+ NSIndexSet *removeIndexes = [newArray indexesOfObjectsPassingTest:^BOOL(YTIItemSectionRenderer *sectionRenderer, NSUInteger idx, BOOL *stop) {+ if ([sectionRenderer isKindOfClass:%c(YTIShelfRenderer)]) {+ NSString *description = [sectionRenderer description];+ if ([description containsString:@"community-tab-chip-posts-section"]) return NO;+ if (hideShorts) {+ if (keepShortsSub && [description containsString:@"subscriptions-shorts-shelf-item"]) return NO;+ else if ([description containsString:@"shorts_video_cell.eml"]) return YES;+ else if ([description containsString:@"shelf_header.eml"] && [description containsString:@"youtube_shorts_24_cairo"]) return YES;+ }+ if (hideFeedPost && getPostString(description) != nil) return YES;+ YTIShelfSupportedRenderers *content = ((YTIShelfRenderer *)sectionRenderer).content;+ YTIHorizontalListRenderer *horizontalListRenderer = content.horizontalListRenderer;+ NSMutableArray <YTIHorizontalListSupportedRenderers *> *itemsArray = horizontalListRenderer.itemsArray;+ NSIndexSet *removeItemsArrayIndexes = [itemsArray indexesOfObjectsPassingTest:^BOOL(YTIHorizontalListSupportedRenderers *horizontalListSupportedRenderers, NSUInteger idx2, BOOL *stop2) {+ YTIElementRenderer *elementRenderer = horizontalListSupportedRenderers.elementRenderer;+ return isAdRenderer(elementRenderer, 4);+ }];+ [itemsArray removeObjectsAtIndexes:removeItemsArrayIndexes];+ } else if ([sectionRenderer isKindOfClass:%c(YTIItemSectionRenderer)]) {+ NSString *description = [sectionRenderer description];+ if ([description containsString:@"community-tab-chip-posts-section"]) return NO;+ if ([description containsString:@"UNLIMITED"] && [description containsString:@"SPunlimited"]) {+ NSMutableArray <YTIItemSectionSupportedRenderers *> *contentsArray = sectionRenderer.contentsArray;+ NSMutableIndexSet *indexesToRemove = [NSMutableIndexSet indexSet];+ __block NSUInteger lastCellDividerIndex = NSNotFound;++ [contentsArray enumerateObjectsUsingBlock:^(YTIItemSectionSupportedRenderers *item, NSUInteger idx, BOOL *stop) {+ NSString *desc = [item description];+ if ([desc containsString:@"cell_divider.eml"]) lastCellDividerIndex = idx;+ else if ([desc containsString:@"UNLIMITED"] && [desc containsString:@"SPunlimited"]) {+ [indexesToRemove addIndex:idx];+ if (lastCellDividerIndex != NSNotFound) {+ [indexesToRemove addIndex:lastCellDividerIndex];+ lastCellDividerIndex = NSNotFound;+ }+ }+ }];+ [contentsArray removeObjectsAtIndexes:indexesToRemove];+ return NO;+ }++ const BOOL isShortsShelf = [description containsString:@"shorts_shelf.eml"];+ const BOOL isHistory = [description containsString:@"history-shorts-shelf-item"];+ const BOOL isShortsOverlay = [description containsString:@"video_lockup_overlay"];+ if (hideShorts && keepShortsSub) {+ if (isShortsShelf && ![description containsString:@"subscriptions-shorts-shelf-item"] && !isHistory) return YES;+ else if (isShortsOverlay) return YES;+ } else if (hideShorts) {+ if (isShortsShelf && !isHistory) return YES;+ else if (isShortsOverlay) return YES;+ }++ if ([description containsString:@"horizontal_shelf.eml"]) {+ if (hidePlayables && [description containsString:@"FEmini_app_destination"]) return YES;+ if (hideHoriShelf && ![description containsString:@"UCYfdidRxbB8Qhf0Nx7ioOYw"] && ![description containsString:@"FElibrary"] && ![description containsString:@"mini_game_card.eml"] && ![description containsString:@"FEplaylist_aggregation"]) {+ return YES;+ }+ }++ if (hideCommuGuide && ([description containsString:@"community_guidelines.eml"] || [description containsString:@"channel_guidelines_entry_banner.eml"])) {+ return YES;+ }++ if (hideFeedPost && getPostString(description) != nil) return YES;+ if (hideGenMusic && [description containsString:@"feed_nudge.eml"]) return YES;+ if (hideSurveys && [description containsString:@"in_feed_survey.eml"]) return YES;+ if (hideComments && [description containsString:@"comment-item-section"] && [description containsString:@"comments-entry-point"]) {+ return YES;+ }++ NSMutableArray <YTIItemSectionSupportedRenderers *> *contentsArray = sectionRenderer.contentsArray;+ if (contentsArray.count > 1) {+ NSIndexSet *removeContentsArrayIndexes = [contentsArray indexesOfObjectsPassingTest:^BOOL(YTIItemSectionSupportedRenderers *sectionSupportedRenderers, NSUInteger idx2, BOOL *stop2) {+ YTIElementRenderer *elementRenderer = sectionSupportedRenderers.elementRenderer;+ return isAdRenderer(elementRenderer, 3);+ }];+ [contentsArray removeObjectsAtIndexes:removeContentsArrayIndexes];+ }+ YTIItemSectionSupportedRenderers *firstObject = [contentsArray firstObject];+ YTIElementRenderer *elementRenderer = firstObject.elementRenderer;+ if (isAdRenderer(elementRenderer, 2)) return YES;+ }+ return NO;+ }];+ [newArray removeObjectsAtIndexes:removeIndexes];+ return newArray;+}++%hook YTPlayerResponse+%new(@@:)+- (NSMutableArray *)playerAdsArray { return [NSMutableArray array]; }+%new(@@:)+- (NSMutableArray *)adSlotsArray { return [NSMutableArray array]; }+%end++%hook YTIClientMdxGlobalConfig+%new(B@:)+- (BOOL)enableSkippableAd { return YES; }+%end++%hook YTAdShieldUtils++ (id)spamSignalsDictionary { return @{}; }++ (id)spamSignalsDictionaryWithoutIDFA { return @{}; }+%end++%hook YTDataUtils++ (id)spamSignalsDictionary { return @{ @"ms": @"" }; }++ (id)spamSignalsDictionaryWithoutIDFA { return @{}; }+%end++%hook YTAdsInnerTubeContextDecorator+- (void)decorateContext:(id)context {+ id temp = nil;+ %orig(temp);+}+%end++%hook YTAccountScopedAdsInnerTubeContextDecorator+- (void)decorateContext:(id)context {+ id temp = nil;+ %orig(temp);+}+%end++%hook YTLocalPlaybackController+- (id)createAdsPlaybackCoordinator { return nil; }+%end++%hook MDXSession+- (void)adPlaying:(id)ad {}+%end++%hook MDXSessionImpl+- (void)adPlaying:(id)ad {}+%end++// Live video type = 4 and Live preview = 7, 9 is Playables ads, 10 posts+%hook YTReelDataSource+- (YTReelModel *)makeContentModelForEntry:(id)entry {+ YTReelModel *model = %orig;+ if ([model respondsToSelector:@selector(videoType)] && model.videoType == 3)+ return nil;+ if ([model isKindOfClass:%c(YTReelNonVideoContentModel)])+ return nil;+ if ([model respondsToSelector:@selector(videoType)] && model.videoType == 10 && IS_ENABLED(RemoveShortsPosts))+ return nil;+ if ([model respondsToSelector:@selector(videoType)] && (model.videoType == 4 || model.videoType == 7) && IS_ENABLED(RemoveShortsLive))+ return nil;+ return model;+}+%end++%hook YTReelContentModel++ (YTReelModel *)makeContentModelForEntry:(id)entry {+ YTReelModel *model = %orig;+ if ([model respondsToSelector:@selector(videoType)] && model.videoType == 3)+ return nil;+ if ([model isKindOfClass:%c(YTReelNonVideoContentModel)])+ return nil;+ if ([model respondsToSelector:@selector(videoType)] && model.videoType == 10 && IS_ENABLED(RemoveShortsPosts))+ return nil;+ if ([model respondsToSelector:@selector(videoType)] && (model.videoType == 4 || model.videoType == 7) && IS_ENABLED(RemoveShortsLive))+ return nil;+ return model;+}+%end++%hook YTReelInfinitePlaybackDataSource+- (YTReelModel *)makeContentModelForEntry:(id)entry {+ YTReelModel *model = %orig;+ if ([model respondsToSelector:@selector(videoType)] && model.videoType == 3)+ return nil;+ if ([model isKindOfClass:%c(YTReelNonVideoContentModel)])+ return nil;+ if ([model respondsToSelector:@selector(videoType)] && model.videoType == 10 && IS_ENABLED(RemoveShortsPosts))+ return nil;+ if ([model respondsToSelector:@selector(videoType)] && (model.videoType == 4 || model.videoType == 7) && IS_ENABLED(RemoveShortsLive))+ return nil;+ return model;+}+- (void)setReels:(NSMutableOrderedSet <YTReelModel *> *)reels {+ [reels removeObjectsAtIndexes:[reels indexesOfObjectsPassingTest:^BOOL(YTReelModel *obj, NSUInteger idx, BOOL *stop) {+ if ([obj respondsToSelector:@selector(videoType)] && obj.videoType == 3) return YES;+ if ([obj isKindOfClass:%c(YTReelNonVideoContentModel)]) return YES;+ if ([obj respondsToSelector:@selector(videoType)] && obj.videoType == 10 && IS_ENABLED(RemoveShortsPosts)) return YES;+ if ([obj respondsToSelector:@selector(videoType)] && (obj.videoType == 4 || obj.videoType == 7) && IS_ENABLED(RemoveShortsLive)) return YES;+ return NO;+ }]];+ %orig;+}+%end++%hook YTWatchNextResponseViewController+- (void)loadWithModel:(YTIWatchNextResponse *)model {+ YTICommand *onUiReady = model.onUiReady;+ if ([onUiReady respondsToSelector:@selector(yt_commandExecutorCommand)]) {+ YTICommandExecutorCommand *commandExecutorCommand = [onUiReady yt_commandExecutorCommand];+ NSMutableArray <YTICommand *> *commandsArray = commandExecutorCommand.commandsArray;+ [commandsArray removeObjectsAtIndexes:[commandsArray indexesOfObjectsPassingTest:^BOOL(YTICommand *command, NSUInteger idx, BOOL *stop) {+ return isProductList(command);+ }]];+ }+ if (isProductList(onUiReady))+ model.onUiReady = nil;+ %orig;+}+%end++%hook YTMainAppVideoPlayerOverlayViewController+- (void)playerOverlayProvider:(YTPlayerOverlayProvider *)provider didInsertPlayerOverlay:(YTPlayerOverlay *)overlay {+ NSString *iden = [overlay overlayIdentifier];+ if ([iden isEqualToString:@"player_overlay_product_in_video"]) return;+ if ([iden isEqualToString:@"player_overlay_paid_content"] && IS_ENABLED(HidePaidPromoOverlay)) return;+ %orig;+}+%end++%hook YTWatchFloatingMiniplayerBadgeView+- (void)didMoveToWindow {+ %orig;+ if (IS_ENABLED(HidePaidPromoOverlay)) {+ UIView *badge = [self valueForKey:@"_overlayBadge"];+ if (badge && badge.superview) {+ [badge removeFromSuperview];+ }+ }+}+%end++%hook YTInnerTubeCollectionViewController+- (void)displaySectionsWithReloadingSectionControllerByRenderer:(id)renderer {+ NSMutableArray *sectionRenderers = [self valueForKey:@"_sectionRenderers"];+ [self setValue:filteredArray(sectionRenderers) forKey:@"_sectionRenderers"];+ %orig;+}+- (void)addSectionsFromArray:(NSArray <YTIItemSectionRenderer *> *)array {+ %orig(filteredArray(array));+}+%end++%hook _ASDisplayView+- (void)didMoveToWindow {+ %orig;+ NSString *iden = self.accessibilityIdentifier;+ if ([iden isEqualToString:@"eml.expandable_metadata.vpp"]) [self removeFromSuperview];+ if (IS_ENABLED(HideCommentsPreview) && [iden isEqualToString:@"id.ui.comments_entry_point_teaser"]) [self removeFromSuperview];+ if ([self.accessibilityLabel containsString:@"Premium"] && [self._viewControllerForAncestor isKindOfClass:%c(YTPageHeaderViewController)]) {+ [self removeFromSuperview];+ }+ // Filter new ads in newer YT versions+ if ([iden containsString:@"eml.ad_layout."]) {+ _ASCollectionViewCell *mainView = (_ASCollectionViewCell *)self.superview;+ while (mainView != nil && ![mainView isKindOfClass:%c(_ASCollectionViewCell)]) {+ mainView = (_ASCollectionViewCell *)mainView.superview;+ }+ ASDisplayNode *node = mainView.node;+ for (id child in [node.yogaChildren copy]) {+ [node removeYogaChild:child];+ }+ // [mainView removeFromSuperview]; Sometimes running this crashes the app.+ }+}+%end++// NoYTPremium - @PoomSmart https://github.com/PoomSmart/NoYTPremium+// Alert+%hook YTCommerceEventGroupHandler+- (void)addEventHandlers {}+%end++// Full-screen+%hook YTInterstitialPromoEventGroupHandler+- (void)addEventHandlers {}+%end++%hook YTPromosheetEventGroupHandler+- (void)addEventHandlers {}+%end++%hook YTPromoThrottleController+- (BOOL)canShowThrottledPromo { return NO; }+- (BOOL)canShowThrottledPromoWithFrequencyCap:(id)arg1 { return NO; }+- (BOOL)canShowThrottledPromoWithFrequencyCaps:(id)arg1 { return NO; }+%end++%hook YTPromoThrottleControllerImpl+- (BOOL)canShowThrottledPromo { return NO; }+- (BOOL)canShowThrottledPromoWithFrequencyCap:(id)arg1 { return NO; }+- (BOOL)canShowThrottledPromoWithFrequencyCaps:(id)arg1 { return NO; }+%end++%hook YTIShowFullscreenInterstitialCommand+- (BOOL)shouldThrottleInterstitial {+ if (self.hasModalClientThrottlingRules)+ self.modalClientThrottlingRules.oncePerTimeWindow = YES;+ return %orig;+}+%end++// Settings+%hook YTSettingsSectionItemManager+// - (void)updatePremiumEarlyAccessSectionWithEntry:(id)arg1 {}+- (void)updateUnlimitedSectionWithEntry:(id)arg {}+%end++// Survey+%hook YTSurveyController+- (void)showSurveyWithRenderer:(id)arg1 surveyParentResponder:(id)arg2 {}+%enddiff --git a/vendor/YouMod/Files/Apperence.x b/vendor/YouMod/Files/Apperence.xnew file mode 100644index 0000000..8c204a2--- /dev/null+++ b/vendor/YouMod/Files/Apperence.x@@ -0,0 +1,234 @@+#import "Headers.h"++%group OLEDTheme+%hook YTColor++ (UIColor *)black0 { return [UIColor blackColor]; }++ (UIColor *)black1 { return [UIColor blackColor]; }++ (UIColor *)black2 { return [UIColor blackColor]; }++ (UIColor *)black3 { return [UIColor blackColor]; }++ (UIColor *)black4 { return [UIColor blackColor]; }+%end++%hook YTCommonColorPalette+- (UIColor *)baseBackground { return self.pageStyle == 1 ? [UIColor blackColor] : %orig; }+- (UIColor *)brandBackgroundSolid { return self.pageStyle == 1 ? [UIColor blackColor] : %orig; }+- (UIColor *)brandBackgroundPrimary { return self.pageStyle == 1 ? [UIColor blackColor] : %orig; }+- (UIColor *)brandBackgroundSecondary { return self.pageStyle == 1 ? [UIColor blackColor] : %orig; }+- (UIColor *)raisedBackground { return self.pageStyle == 1 ? [UIColor blackColor] : %orig; }+- (UIColor *)staticBrandBlack { return self.pageStyle == 1 ? [UIColor blackColor] : %orig; }+- (UIColor *)generalBackgroundA { return self.pageStyle == 1 ? [UIColor blackColor] : %orig; }+%end++%hook YTInnerTubeCollectionViewController+- (UIColor *)backgroundColor:(NSInteger)pageStyle { return pageStyle == 1 ? [UIColor blackColor] : %orig; }+%end++%hook _ASDisplayView+- (void)didMoveToWindow {+ %orig;+ NSSet *blackViews = [NSSet setWithObjects:+ @"id.elements.components.comment_composer",+ @"id.subs.subscriptions_channel_bar",+ @"PAmedia_hub_device_picker.engagement_panel_header", nil+ ];+ if ([blackViews containsObject:self.accessibilityIdentifier]) {+ self.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor clearColor];+ }];+ return;+ }+ UIViewController *controller = self._viewControllerForAncestor;+ if ([controller isKindOfClass:%c(YTActionSheetDialogViewController)] || [controller isKindOfClass:%c(YTBottomSheetController)]) {+ if ([self.superview.accessibilityIdentifier isEqualToString:@"eml.animated_subscribe_button"]) return;+ self.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor clearColor];+ }];+ return;+ } else if ([self.accessibilityIdentifier isEqualToString:@"eml.live_chat_text_message"] && [controller isKindOfClass:%c(YCHAsyncLiveChatCollectionViewController)]) {+ YCHAsyncLiveChatCollectionViewController *con = (YCHAsyncLiveChatCollectionViewController *)controller;+ if ([con.view isKindOfClass:%c(YCHAsyncLiveChatImmersiveCollectionView)]) return;+ self.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor whiteColor];+ }];+ return;+ } else if ([controller isKindOfClass:%c(YTELMViewController)]) {+ YTELMViewController *con = (YTELMViewController *)controller;+ YTIElementRenderer *renderer = [con valueForKey:@"_renderer"];+ NSString *desc = [renderer description];+ if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.text_field"] && [desc containsString:@"timeline_search_input_form_id"] && [desc containsString:@"search_input.eml"]) {+ self.superview.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor clearColor];+ }];+ } else if ([desc containsString:@"transcript_panel.eml"]) {+ self.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor clearColor];+ }];+ }+ return;+ } else if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.filter_chip_bar"]) {+ UIColor *dynamicColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor clearColor];+ }];+ self.backgroundColor = dynamicColor;+ self.superview.backgroundColor = dynamicColor;+ return;+ }+}+%end++%hook ASCollectionView+- (void)didMoveToWindow {+ %orig;+ NSSet *blackViews = [NSSet setWithObjects:+ @"eml.chip_bar_collection",+ @"subs_channel_bar.collection", nil+ ];+ if ([blackViews containsObject:self.accessibilityIdentifier]) {+ self.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor clearColor];+ }];+ }+ if ([self.accessibilityIdentifier isEqualToString:@"subs_channel_bar.collection"]) {+ self.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor clearColor];+ }];+ }+ if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.more_drawer_collection"]) {+ self.superview.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor whiteColor];+ }];+ }+}+%end++%hook YTContextualWrapView+- (void)didMoveToWindow {+ %orig;+ UIView *sup = self.superview;+ if ([sup isKindOfClass:%c(YTContextualSheetView)]) {+ self.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor whiteColor];+ }];+ }+}+%end++%hook ASScrollView+- (void)didMoveToWindow {+ %orig;+ ASDisplayNode *node = self.scrollNode;+ if (node) {+ for (UIView *child in node.yogaChildren) {+ NSString *desc = [child description];+ if ([desc containsString:@"id.elements.components.report_form_reason_select_page.container"] || [desc containsString:@"id.elements.components.report_form_sign_in_page.container"]) {+ self.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor clearColor];+ }];+ break;+ }+ }+ }+}+%end++%hook MDCInkView+- (void)didMoveToWindow {+ %orig;+ if ([self.superview isKindOfClass:%c(GOODialogActionMDCButton)]) {+ UIViewController *controller = self._viewControllerForAncestor;+ if ([controller isKindOfClass:%c(YTBottomSheetController)] || [controller isKindOfClass:%c(GOOModalWindowViewController)]) return;+ self.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor clearColor];+ }];+ }+}+%end++%hook YTStartupAnimationViewController+- (void)viewDidAppear:(BOOL)animated {+ %orig;+ UIView *mainView = self.view;+ mainView.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(mainView) ? [UIColor blackColor] : [UIColor whiteColor];+ }];+}+%end++%hook YTEngagementPanelView+- (void)setFooterView:(UIView *)view {+ %orig;+ if (view) {+ UIView *sub = view.subviews.firstObject;+ sub.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor clearColor];+ }];+ }+}+%end+%end++%group OLEDKeyboard+%hook UIKeyboard+- (void)displayLayer:(id)arg1 {+ %orig;+ self.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor clearColor];+ }];+}+%end++%hook UIPredictionViewController+- (id)_currentTextSuggestions {+ UIKeyboard *keyboard = [%c(UIKeyboard) activeKeyboard];+ UIView *mainView = self.view;+ UIColor *dynamicColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(mainView) ? [UIColor blackColor] : [UIColor clearColor];+ }];+ [mainView setBackgroundColor:dynamicColor];+ keyboard.backgroundColor = dynamicColor;+ return %orig;+}+%end++%hook UIKeyboardDockView+- (void)layoutSubviews {+ %orig;+ self.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor clearColor];+ }];+}+%end++// Since we can't hook a private framework class from UIKit, we check the class name through the nearest available from UIKit class+%hook UIInputView+- (void)layoutSubviews {+ %orig;+ if ([self isKindOfClass:NSClassFromString(@"TUIEmojiSearchInputView")] || [self isKindOfClass:NSClassFromString(@"_SFAutoFillInputView")]) {+ self.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor clearColor];+ }];+ }+}+%end++%hook UIKBVisualEffectView+- (void)layoutSubviews {+ %orig;+ if (isDarkMode(self)) {+ self.backgroundEffects = nil;+ }+ self.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return isDarkMode(self) ? [UIColor blackColor] : [UIColor clearColor];+ }];+}+%end+%end++%ctor {+ if (IS_ENABLED(OLEDTheme)) {+ %init(OLEDTheme);+ }+ if (IS_ENABLED(OLEDKeyboard)) {+ %init(OLEDKeyboard);+ }+}\ No newline at end of filediff --git a/vendor/YouMod/Files/Cache.x b/vendor/YouMod/Files/Cache.xnew file mode 100644index 0000000..d18841f--- /dev/null+++ b/vendor/YouMod/Files/Cache.x@@ -0,0 +1,20 @@+#import "Headers.h"++// Auto clear cache+%hook YTAppDelegate+%new+- (void)YouModAutoClearCache {+ NSString *cachePath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject;+ [[NSFileManager defaultManager] removeItemAtPath:cachePath error:nil];+}+- (BOOL)application:(id)application didFinishLaunchingWithOptions:(id)launchOptions {+ BOOL result = %orig;+ if (IS_ENABLED(AutoClearCache)) {+ // Clear cache on app launch+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{+ [self YouModAutoClearCache];+ });+ }+ return result;+}+%end\ No newline at end of filediff --git a/vendor/YouMod/Files/Download.x b/vendor/YouMod/Files/Download.xnew file mode 100644index 0000000..b7463ae--- /dev/null+++ b/vendor/YouMod/Files/Download.x@@ -0,0 +1,2353 @@+#import "Headers.h"+#import <AVFoundation/AVFoundation.h>+#import <Photos/Photos.h>+#import <math.h>+#import <objc/message.h>+#import <objc/runtime.h>+#import <dlfcn.h>+#import <stdarg.h>+#import <stdlib.h>++@interface YouModMenuItem : NSObject+@property (nonatomic, copy) NSString *title;+@property (nonatomic, copy) NSString *subtitle;+@property (nonatomic, strong) UIImage *iconImage;+@property (nonatomic, copy) void (^handler)(void);++ (instancetype)itemWithTitle:(NSString *)title subtitle:(NSString *)subtitle icon:(UIImage *)icon handler:(void (^)(void))handler;+@end++@implementation YouModMenuItem++ (instancetype)itemWithTitle:(NSString *)title subtitle:(NSString *)subtitle icon:(UIImage *)icon handler:(void (^)(void))handler {+ YouModMenuItem *item = [YouModMenuItem new];+ item.title = title;+ item.subtitle = subtitle;+ item.iconImage = icon;+ item.handler = handler;+ return item;+}+@end++@interface YouModMediaFormat : NSObject+@property (nonatomic, strong) YTIFormatStream *source;+@property (nonatomic, copy) NSString *urlString;+@property (nonatomic, copy) NSString *qualityLabel;+@property (nonatomic, copy) NSString *mimeType;+@property (nonatomic, copy) NSString *idp;+@property (nonatomic, assign) NSInteger contentLength;+@property (nonatomic, assign) NSUInteger durationMs;+@property (nonatomic, assign) int fps;+@property (nonatomic, assign) int itag;+@property (nonatomic, assign) int resolution;+@property (nonatomic, assign) BOOL video;+@end++@implementation YouModMediaFormat+@end++typedef void (^YouModFileDownloadCompletion)(NSURL *fileURL, NSError *error);+typedef void (^YouModMergeCompletion)(BOOL success, NSError *error);+typedef void (^YouModRangeDownloadProgress)(unsigned long long completedBytes);++@interface YouModDownloadChunk : NSObject+@property (nonatomic, assign) unsigned long long offset;+@property (nonatomic, assign) unsigned long long length;+@property (nonatomic, assign) NSUInteger attempts;+@end++@implementation YouModDownloadChunk+@end++@interface YouModRangeDownloader : NSObject+@property (nonatomic, strong) NSURL *url;+@property (nonatomic, strong) NSURL *destinationURL;+@property (nonatomic, copy) NSDictionary *httpHeaders;+@property (nonatomic, assign) unsigned long long expectedBytes;+@property (nonatomic, copy) YouModRangeDownloadProgress progress;+@property (nonatomic, copy) YouModFileDownloadCompletion completion;+@property (nonatomic, strong) NSURLSession *session;+@property (nonatomic, strong) NSFileHandle *fileHandle;+@property (nonatomic, strong) NSMutableArray <YouModDownloadChunk *> *pendingChunks;+@property (nonatomic, strong) NSMutableSet <NSURLSessionDataTask *> *tasks;+@property (nonatomic, strong) dispatch_queue_t stateQueue;+@property (nonatomic, strong) dispatch_queue_t fileQueue;+@property (nonatomic, assign) NSUInteger activeTaskCount;+@property (nonatomic, assign) NSUInteger totalChunkCount;+@property (nonatomic, assign) unsigned long long completedBytes;+@property (nonatomic, assign) BOOL cancelled;+@property (nonatomic, assign) BOOL finished;+- (instancetype)initWithURL:(NSURL *)url destinationURL:(NSURL *)destinationURL expectedBytes:(unsigned long long)expectedBytes headers:(NSDictionary *)headers progress:(YouModRangeDownloadProgress)progress completion:(YouModFileDownloadCompletion)completion;+- (void)start;+- (void)cancel;+@end++@interface YouModDownloadCoordinator : NSObject <NSURLSessionDownloadDelegate>+@property (nonatomic, strong) NSURLSession *session;+@property (nonatomic, strong) NSURLSessionDownloadTask *task;+@property (nonatomic, strong) NSURLSessionDataTask *metadataTask;+@property (nonatomic, strong) YouModRangeDownloader *rangeDownloader;+@property (nonatomic, strong) AVAssetExportSession *exporter;+@property (nonatomic, strong) YMDownloadProgressView *progressPill;+@property (nonatomic, weak) UIViewController *presenter;+@property (nonatomic, copy) YouModFileDownloadCompletion fileCompletion;+@property (nonatomic, strong) NSURL *destinationURL;+@property (nonatomic, strong) NSURL *videoTempURL;+@property (nonatomic, strong) NSURL *audioTempURL;+@property (nonatomic, assign) unsigned long long completedBytes;+@property (nonatomic, assign) unsigned long long totalBytes;+@property (nonatomic, assign) unsigned long long currentBytes;+@property (nonatomic, assign) unsigned long long currentExpectedBytes;+@property (nonatomic, assign) BOOL currentResolvedSizeAddedToTotal;+@property (nonatomic, assign) BOOL active;+@property (nonatomic, assign) BOOL finishedCurrentFile;+@property (nonatomic, assign) BOOL cancelled;+@property (nonatomic, copy) NSString *baseProgressTitle;+@property (nonatomic, assign) NSTimeInterval downloadStartTime;+@property (nonatomic, copy) void (^downloadCompletionBlock)(NSURL *localURL, NSString *errorMsg);++ (instancetype)sharedCoordinator;+- (void)startVideoDownloadWithVideoFormat:(YouModMediaFormat *)videoFormat audioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName presenter:(UIViewController *)presenter videoID:(NSString *)vidID;+- (void)startAudioDownloadWithAudioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName presenter:(UIViewController *)presenter videoID:(NSString *)vidID;+- (void)startDirectVideoDownloadWithVideoFormat:(YouModMediaFormat *)videoFormat audioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName presenter:(UIViewController *)presenter videoID:(NSString *)vidID;+- (void)startDirectAudioDownloadWithAudioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName presenter:(UIViewController *)presenter videoID:(NSString *)vidID;+- (void)trimAudioToHalfLengthAtURL:(NSURL *)inputURL toURL:(NSURL *)outputURL completion:(void (^)(NSError *error))completion;+- (void)mergeVideoURL:(NSURL *)videoURL audioURL:(NSURL *)audioURL fileName:(NSString *)fileName outputExtension:(NSString *)outputExtension durationMs:(unsigned long long)durationMs presenter:(UIViewController *)presenter;+- (void)mergeVideoWithAVFoundationVideoURL:(NSURL *)videoURL audioURL:(NSURL *)audioURL outputURL:(NSURL *)outputURL durationMs:(unsigned long long)durationMs presenter:(UIViewController *)presenter fallbackError:(NSError *)fallbackError;+@end++static const unsigned long long YouModFastDownloadMinimumBytes = 256ULL * 1024ULL;+static const unsigned long long YouModFastDownloadChunkBytes = 4ULL * 1024ULL * 1024ULL;+static const NSUInteger YouModFastDownloadConcurrency = 8;+static const NSUInteger YouModFastDownloadMaxAttempts = 3;++static BOOL YouModHTTPHeadersContainField(NSDictionary *headers, NSString *field) {+ for (id key in headers) {+ if ([key isKindOfClass:NSString.class] && [(NSString *)key caseInsensitiveCompare:field] == NSOrderedSame)+ return YES;+ }+ return NO;+}++static NSString *YouModYouTubeCookiesString(void) {+ NSMutableArray *cookieStrings = [NSMutableArray array];+ for (NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) {+ if ([cookie.domain containsString:@"youtube.com"]) {+ [cookieStrings addObject:[NSString stringWithFormat:@"%@=%@", cookie.name, cookie.value]];+ }+ }+ return [cookieStrings componentsJoinedByString:@"; "];+}++static NSString *YouModNativeUserAgent(void) {+ NSString *device = isPad() ? @"iPad" : @"iPhone";+ return [NSString stringWithFormat:@"com.google.ios.youtube/21.26.4 (%@; CPU OS 18_7 like Mac OS X)", device];+}++static void YouModApplyDownloadHeaders(NSMutableURLRequest *request, NSDictionary *headers) {+ for (id key in headers) {+ id value = headers[key];+ if ([key isKindOfClass:NSString.class] && [value isKindOfClass:NSString.class])+ [request setValue:value forHTTPHeaderField:key];+ }+ if (!YouModHTTPHeadersContainField(headers, @"User-Agent"))+ [request setValue:YouModNativeUserAgent() forHTTPHeaderField:@"User-Agent"];+ if (!YouModHTTPHeadersContainField(headers, @"Origin"))+ [request setValue:@"https://www.youtube.com" forHTTPHeaderField:@"Origin"];+ if (!YouModHTTPHeadersContainField(headers, @"Referer"))+ [request setValue:@"https://www.youtube.com/" forHTTPHeaderField:@"Referer"];+ if (!YouModHTTPHeadersContainField(headers, @"Cookie")) {+ NSString *cookies = YouModYouTubeCookiesString();+ if (cookies.length > 0) [request setValue:cookies forHTTPHeaderField:@"Cookie"];+ }+ extern NSString *YouModGlobalAuthHeader;+ if (YouModGlobalAuthHeader && !YouModHTTPHeadersContainField(headers, @"Authorization")) {+ [request setValue:YouModGlobalAuthHeader forHTTPHeaderField:@"Authorization"];+ }+ [request setValue:@"identity" forHTTPHeaderField:@"Accept-Encoding"];+}++@implementation YouModRangeDownloader++- (instancetype)initWithURL:(NSURL *)url destinationURL:(NSURL *)destinationURL expectedBytes:(unsigned long long)expectedBytes headers:(NSDictionary *)headers progress:(YouModRangeDownloadProgress)progress completion:(YouModFileDownloadCompletion)completion {+ self = [super init];+ if (self) {+ _url = url;+ _destinationURL = destinationURL;+ _httpHeaders = [headers copy];+ _expectedBytes = expectedBytes;+ _progress = [progress copy];+ _completion = [completion copy];+ _pendingChunks = [NSMutableArray array];+ _tasks = [NSMutableSet set];+ _stateQueue = dispatch_queue_create("com.youmod.download.range.state", DISPATCH_QUEUE_SERIAL);+ _fileQueue = dispatch_queue_create("com.youmod.download.range.file", DISPATCH_QUEUE_SERIAL);++ NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];+ configuration.HTTPMaximumConnectionsPerHost = YouModFastDownloadConcurrency;+ configuration.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData;+ configuration.timeoutIntervalForResource = 300;+ NSMutableDictionary *additionalHeaders = [NSMutableDictionary dictionary];+ for (id key in headers) {+ id value = headers[key];+ if ([key isKindOfClass:NSString.class] && [value isKindOfClass:NSString.class])+ additionalHeaders[key] = value;+ }+ if (!YouModHTTPHeadersContainField(additionalHeaders, @"User-Agent"))+ additionalHeaders[@"User-Agent"] = YouModNativeUserAgent();+ if (!YouModHTTPHeadersContainField(additionalHeaders, @"Origin"))+ additionalHeaders[@"Origin"] = @"https://www.youtube.com";+ if (!YouModHTTPHeadersContainField(additionalHeaders, @"Referer"))+ additionalHeaders[@"Referer"] = @"https://www.youtube.com/";+ if (!YouModHTTPHeadersContainField(additionalHeaders, @"Cookie")) {+ NSString *cookies = YouModYouTubeCookiesString();+ if (cookies.length > 0) additionalHeaders[@"Cookie"] = cookies;+ }+ extern NSString *YouModGlobalAuthHeader;+ if (YouModGlobalAuthHeader && !YouModHTTPHeadersContainField(additionalHeaders, @"Authorization")) {+ additionalHeaders[@"Authorization"] = YouModGlobalAuthHeader;+ }+ additionalHeaders[@"Accept-Encoding"] = @"identity";+ configuration.HTTPAdditionalHeaders = additionalHeaders;+ _session = [NSURLSession sessionWithConfiguration:configuration];+ }+ return self;+}++- (NSError *)errorWithCode:(NSInteger)code message:(NSString *)message {+ return [NSError errorWithDomain:@"YouMod" code:code userInfo:@{NSLocalizedDescriptionKey: message ?: @"Download failed"}];+}++- (BOOL)prepareDestinationWithError:(NSError **)error {+ [NSFileManager.defaultManager removeItemAtURL:self.destinationURL error:nil];+ if (![NSFileManager.defaultManager createFileAtPath:self.destinationURL.path contents:nil attributes:nil]) {+ if (error) *error = [self errorWithCode:20 message:@"Cannot create file"];+ return NO;+ }++ self.fileHandle = [NSFileHandle fileHandleForWritingAtPath:self.destinationURL.path];+ if (!self.fileHandle) {+ if (error) *error = [self errorWithCode:21 message:@"Cannot open file"];+ return NO;+ }++ @try {+ [self.fileHandle truncateFileAtOffset:self.expectedBytes];+ } @catch (NSException *exception) {+ if (error) *error = [self errorWithCode:22 message:exception.reason ?: @"Cannot allocate file"];+ return NO;+ }+ return YES;+}++- (void)start {+ dispatch_async(self.stateQueue, ^{+ if (self.expectedBytes == 0) {+ [self finishWithErrorLocked:[self errorWithCode:23 message:@"Unknown stream size"]];+ return;+ }++ NSError *error = nil;+ if (![self prepareDestinationWithError:&error]) {+ [self finishWithErrorLocked:error];+ return;+ }++ unsigned long long chunkSize = self.expectedBytes / 100ULL;+ if (chunkSize < 256ULL * 1024ULL) chunkSize = 256ULL * 1024ULL;+ if (chunkSize > YouModFastDownloadChunkBytes) chunkSize = YouModFastDownloadChunkBytes;++ for (unsigned long long offset = 0; offset < self.expectedBytes; offset += chunkSize) {+ YouModDownloadChunk *chunk = [YouModDownloadChunk new];+ chunk.offset = offset;+ unsigned long long remaining = self.expectedBytes - offset;+ chunk.length = remaining < chunkSize ? remaining : chunkSize;+ [self.pendingChunks addObject:chunk];+ }+ self.totalChunkCount = self.pendingChunks.count;+ [self scheduleChunksLocked];+ });+}++- (void)cancel {+ dispatch_async(self.stateQueue, ^{+ if (self.finished) return;+ self.cancelled = YES;+ self.finished = YES;+ for (NSURLSessionDataTask *task in self.tasks) [task cancel];+ [self.tasks removeAllObjects];+ [self.session invalidateAndCancel];+ dispatch_async(self.fileQueue, ^{+ @try {+ [self.fileHandle closeFile];+ } @catch (__unused NSException *exception) {+ }+ [NSFileManager.defaultManager removeItemAtURL:self.destinationURL error:nil];+ });+ });+}++- (void)scheduleChunksLocked {+ if (self.finished || self.cancelled) return;+ while (self.activeTaskCount < YouModFastDownloadConcurrency && self.pendingChunks.count > 0) {+ YouModDownloadChunk *chunk = self.pendingChunks.firstObject;+ [self.pendingChunks removeObjectAtIndex:0];+ [self startChunkLocked:chunk];+ }++ if (self.activeTaskCount == 0 && self.pendingChunks.count == 0) {+ [self finishSuccessfullyLocked];+ }+}++- (void)startChunkLocked:(YouModDownloadChunk *)chunk {+ unsigned long long end = chunk.offset + chunk.length - 1;+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:self.url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60.0];+ YouModApplyDownloadHeaders(request, self.httpHeaders);+ [request setValue:[NSString stringWithFormat:@"bytes=%llu-%llu", chunk.offset, end] forHTTPHeaderField:@"Range"];++ __weak typeof(self) weakSelf = self;+ __block NSURLSessionDataTask *task = nil;+ task = [self.session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self) return;+ [self completeChunk:chunk task:task data:data response:response error:error];+ }];+ [self.tasks addObject:task];+ self.activeTaskCount++;+ [task resume];+}++- (NSError *)validationErrorForChunk:(YouModDownloadChunk *)chunk data:(NSData *)data response:(NSURLResponse *)response error:(NSError *)error {+ if (error) return error;++ NSHTTPURLResponse *httpResponse = [response isKindOfClass:NSHTTPURLResponse.class] ? (NSHTTPURLResponse *)response : nil;+ NSInteger statusCode = httpResponse.statusCode;+ BOOL statusOK = statusCode == 206 || (self.totalChunkCount == 1 && statusCode == 200);+ if (httpResponse && !statusOK)+ return [self errorWithCode:24 message:@"Range request rejected by server"];++ if (data.length != chunk.length)+ return [self errorWithCode:25 message:@"Incomplete chunk"];++ return nil;+}++- (void)completeChunk:(YouModDownloadChunk *)chunk task:(NSURLSessionDataTask *)task data:(NSData *)data response:(NSURLResponse *)response error:(NSError *)error {+ dispatch_async(self.stateQueue, ^{+ if (self.activeTaskCount > 0) self.activeTaskCount--;+ if (task) [self.tasks removeObject:task];+ if (self.finished || self.cancelled) return;++ NSError *validationError = [self validationErrorForChunk:chunk data:data response:response error:error];+ if (validationError) {+ if (validationError.code == 24) {+ [self finishWithErrorLocked:validationError];+ return;+ }+ if (chunk.attempts + 1 < YouModFastDownloadMaxAttempts) {+ chunk.attempts++;+ [self.pendingChunks insertObject:chunk atIndex:0];+ [self scheduleChunksLocked];+ } else {+ [self finishWithErrorLocked:validationError];+ }+ return;+ }++ NSData *chunkData = [data copy];+ dispatch_async(self.fileQueue, ^{+ NSError *writeError = nil;+ @try {+ [self.fileHandle seekToFileOffset:chunk.offset];+ [self.fileHandle writeData:chunkData];+ } @catch (NSException *exception) {+ writeError = [self errorWithCode:26 message:exception.reason ?: @"Write failed"];+ }++ dispatch_async(self.stateQueue, ^{+ if (self.finished || self.cancelled) return;+ if (writeError) {+ [self finishWithErrorLocked:writeError];+ return;+ }++ self.completedBytes += chunkData.length;+ if (self.progress) {+ unsigned long long completed = self.completedBytes;+ dispatch_async(dispatch_get_main_queue(), ^{+ self.progress(completed);+ });+ }+ [self scheduleChunksLocked];+ });+ });+ });+}++- (void)finishSuccessfullyLocked {+ if (self.finished) return;+ self.finished = YES;+ [self.session finishTasksAndInvalidate];+ dispatch_async(self.fileQueue, ^{+ @try {+ [self.fileHandle closeFile];+ } @catch (__unused NSException *exception) {+ }+ dispatch_async(dispatch_get_main_queue(), ^{+ if (self.completion) self.completion(self.destinationURL, nil);+ });+ });+}++- (void)finishWithErrorLocked:(NSError *)error {+ if (self.finished) return;+ self.finished = YES;+ for (NSURLSessionDataTask *task in self.tasks) [task cancel];+ [self.tasks removeAllObjects];+ [self.session invalidateAndCancel];+ dispatch_async(self.fileQueue, ^{+ @try {+ [self.fileHandle closeFile];+ } @catch (__unused NSException *exception) {+ }+ [NSFileManager.defaultManager removeItemAtURL:self.destinationURL error:nil];+ dispatch_async(dispatch_get_main_queue(), ^{+ if (self.completion) self.completion(nil, error ?: [self errorWithCode:27 message:@"Download failed"]);+ });+ });+}++@end++static __weak YTPlayerViewController *YouModCurrentPlayerViewController;++void YouModDownloadSetCurrentPlayer(YTPlayerViewController *player) {+ YouModCurrentPlayerViewController = player;+}++YTPlayerViewController *YouModDownloadGetCurrentPlayer(void) {+ return YouModCurrentPlayerViewController;+}++static id YouModObjectFromSelector(id object, SEL selector) {+ if (!object) return nil;+ if ([object respondsToSelector:selector]) {+ return ((id (*)(id, SEL))objc_msgSend)(object, selector);+ }+ @try {+ return [object valueForKey:NSStringFromSelector(selector)];+ } @catch (__unused NSException *exception) {+ return nil;+ }+}++static void YouModSendToast(NSString *message) {+ UIView *parent = sbGetNotificationParent();+ [SBSkipNotificationView showInView:parent message:message buttonTitle:nil action:nil duration:3.0];+}++static void YouModSendSuccess(NSString *message) {+ UIView *parent = sbGetNotificationParent();+ [SBSkipNotificationView showSuccessInView:parent message:message duration:3.0];+}++static void YouModSendError(NSString *message) {+ UIView *parent = sbGetNotificationParent();+ [SBSkipNotificationView showErrorInView:parent message:message duration:4.0];+}++static NSString *YouModByteCount(unsigned long long bytes) {+ if (bytes == 0) return nil;+ NSByteCountFormatter *formatter = [NSByteCountFormatter new];+ formatter.countStyle = NSByteCountFormatterCountStyleFile;+ return [formatter stringFromByteCount:(long long)bytes];+}++static NSString *YouModURLStringBypassingThrottle(NSString *urlString) {+ if (urlString.length == 0) return urlString;+ NSURLComponents *components = [NSURLComponents componentsWithString:urlString];+ if (components) {+ NSMutableArray *queryItems = [components.queryItems mutableCopy] ?: [NSMutableArray array];+ NSMutableArray *filtered = [NSMutableArray array];+ for (NSURLQueryItem *item in queryItems) {+ if (![item.name isEqualToString:@"n"])+ [filtered addObject:item];+ }+ BOOL hasRateBypass = NO;+ for (NSURLQueryItem *item in filtered) {+ if ([item.name isEqualToString:@"ratebypass"]) { hasRateBypass = YES; break; }+ }+ if (!hasRateBypass)+ [filtered addObject:[NSURLQueryItem queryItemWithName:@"ratebypass" value:@"yes"]];+ components.queryItems = filtered;+ NSString *result = components.string;+ if (result.length > 0) return result;+ }+ return urlString;+}++static NSString *YouModURLStringWithCPN(NSString *urlString) {+ if (urlString.length == 0) return urlString;+ urlString = YouModURLStringBypassingThrottle(urlString);+ if ([urlString containsString:@"cpn="]) return urlString;+ NSString *cpn = [%c(YTDataUtils) generateClientSideNonce];+ NSString *separator = [urlString containsString:@"?"] ? @"&" : @"?";+ return [NSString stringWithFormat:@"%@%@cpn=%@", urlString, separator, cpn];+}++static NSString *YouModSanitizedFileName(NSString *name) {+ if (name.length == 0) return @"YouTube Video";+ NSMutableCharacterSet *invalid = [NSMutableCharacterSet characterSetWithCharactersInString:@"/\\?%*|\"<>:"];+ [invalid formUnionWithCharacterSet:NSCharacterSet.newlineCharacterSet];+ NSArray *parts = [name componentsSeparatedByCharactersInSet:invalid];+ NSString *clean = [[parts componentsJoinedByString:@" "] stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];+ while ([clean containsString:@" "]) clean = [clean stringByReplacingOccurrencesOfString:@" " withString:@" "];+ if (clean.length > 120) clean = [clean substringToIndex:120];+ return clean.length ? clean : @"YouTube Video";+}++static NSURL *YouModDownloadsDirectoryURL(void) {+ NSURL *documentsURL = [NSFileManager.defaultManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask].firstObject;+ NSURL *downloadsURL = [documentsURL URLByAppendingPathComponent:@"YouMod_Downloads" isDirectory:YES];+ [NSFileManager.defaultManager createDirectoryAtURL:downloadsURL withIntermediateDirectories:YES attributes:nil error:nil];+ return downloadsURL;+}++static NSURL *YouModUniqueFileURL(NSString *fileName, NSString *extension) {+ NSString *safeName = YouModSanitizedFileName(fileName);+ NSURL *directoryURL = YouModDownloadsDirectoryURL();+ NSURL *candidate = [directoryURL URLByAppendingPathComponent:[safeName stringByAppendingPathExtension:extension]];+ NSUInteger index = 2;+ while ([NSFileManager.defaultManager fileExistsAtPath:candidate.path]) {+ NSString *indexed = [NSString stringWithFormat:@"%@ %lu", safeName, (unsigned long)index++];+ candidate = [directoryURL URLByAppendingPathComponent:[indexed stringByAppendingPathExtension:extension]];+ }+ return candidate;+}++static NSURL *YouModTemporaryFileURL(NSString *extension) {+ NSString *name = [[NSUUID UUID].UUIDString stringByAppendingPathExtension:extension];+ return [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:name]];+}++static unsigned long long YouModDurationMsForURL(NSURL *url) {+ AVURLAsset *asset = [AVURLAsset URLAssetWithURL:url options:nil];+ if (!CMTIME_IS_NUMERIC(asset.duration) || !CMTIME_IS_VALID(asset.duration)) return 0;+ Float64 seconds = CMTimeGetSeconds(asset.duration);+ if (!isfinite(seconds) || seconds <= 0.0) return 0;+ return (unsigned long long)llround(seconds * 1000.0);+}++static BOOL YouModCMTimeIsUsable(CMTime time) {+ if (!CMTIME_IS_VALID(time) || !CMTIME_IS_NUMERIC(time) || CMTIME_IS_INDEFINITE(time)) return NO;+ Float64 seconds = CMTimeGetSeconds(time);+ return isfinite(seconds) && seconds > 0.0;+}++static CMTime YouModMinUsableDuration(CMTime first, CMTime second) {+ BOOL firstOK = YouModCMTimeIsUsable(first);+ BOOL secondOK = YouModCMTimeIsUsable(second);+ if (firstOK && secondOK) return CMTIME_COMPARE_INLINE(first, <, second) ? first : second;+ if (firstOK) return first;+ if (secondOK) return second;+ return kCMTimeInvalid;+}++static CMTime YouModExportDuration(AVAsset *videoAsset, AVAsset *audioAsset, unsigned long long expectedDurationMs) {+ CMTime duration = kCMTimeInvalid;+ if (expectedDurationMs > 0)+ duration = CMTimeMakeWithSeconds((double)expectedDurationMs / 1000.0, 600);++ CMTime videoDuration = YouModMinUsableDuration(videoAsset.duration, [[videoAsset tracksWithMediaType:AVMediaTypeVideo] firstObject].timeRange.duration);+ CMTime audioDuration = audioAsset ? YouModMinUsableDuration(audioAsset.duration, [[audioAsset tracksWithMediaType:AVMediaTypeAudio] firstObject].timeRange.duration) : kCMTimeInvalid;+ CMTime mediaDuration = audioAsset ? YouModMinUsableDuration(videoDuration, audioDuration) : videoDuration;++ if (!YouModCMTimeIsUsable(duration)) return mediaDuration;+ if (YouModCMTimeIsUsable(mediaDuration) && CMTIME_COMPARE_INLINE(duration, >, mediaDuration))+ return mediaDuration;+ return duration;+}++static BOOL YouModPathExtensionIsPhotosVideo(NSString *extension) {+ NSString *lower = extension.lowercaseString;+ return [@[@"mp4"] containsObject:lower];+}++static NSString *YouModMimeDetail(NSString *mimeType) {+ NSString *lower = mimeType.lowercaseString;+ if ([lower containsString:@"mp4"]) return @"MP4";+ return mimeType;+}++static NSString *YouModFileExtensionForFormat(YouModMediaFormat *format) {+ NSString *lower = format.mimeType.lowercaseString;+ if ([lower containsString:@"mp4a"]) return @"m4a";+ if ([lower containsString:@"mp4"]) return @"mp4";+ return nil;+}++static BOOL YouModFormatLooksMP4Family(YouModMediaFormat *format) {+ NSString *mime = format.mimeType.lowercaseString;+ NSString *extension = YouModFileExtensionForFormat(format);+ return [mime containsString:@"mp4"] || [mime containsString:@"mp4a"] || [@[@"mp4", @"mp4a"] containsObject:extension];+}++static NSString *YouModMergedVideoOutputExtension(YouModMediaFormat *videoFormat, YouModMediaFormat *audioFormat) {+ if (YouModFormatLooksMP4Family(videoFormat) && YouModFormatLooksMP4Family(audioFormat)) return @"mp4";+ return nil;+}++static BOOL YouModVideoFileCanUseAVFoundation(NSURL *fileURL) {+ return YouModPathExtensionIsPhotosVideo(fileURL.pathExtension);+}++static BOOL YouModVideoFileCanSaveToPhotos(NSURL *fileURL) {+ return YouModPathExtensionIsPhotosVideo(fileURL.pathExtension);+}++static NSString *YouModFormatSubtitle(YouModMediaFormat *format, BOOL video) {+ if (video) {+ NSMutableArray *parts = [NSMutableArray array];+ NSString *detail = YouModMimeDetail(format.mimeType);+ if (detail.length) [parts addObject:detail];+ NSString *size = YouModByteCount(format.contentLength);+ if (size.length) [parts addObject:size];+ return [parts componentsJoinedByString:@" - "];+ }+ NSString *cut = [[format.idp componentsSeparatedByString:@"."] firstObject];+ return cut;+}++static YTIPlayerResponse *YouModPlayerDataForPlayer(YTPlayerViewController *player) {+ YTPlayerResponse *response;+ if ([player respondsToSelector:@selector(contentPlayerResponse)]) {+ response = player.contentPlayerResponse;+ } else {+ response = player.playerResponse;+ }+ YTIPlayerResponse *playerData = response.playerData;+ return playerData;+}++static NSArray *YouModCaptionTracksForPlayer(YTPlayerViewController *player) {+ YTIPlayerResponse *playerData = YouModPlayerDataForPlayer(player);+ YTICaptionsSupportedRenderers *captions = playerData.captions;+ YTIPlayerCaptionsTrackListRenderer *tracklistRenderer = captions.playerCaptionsTracklistRenderer;+ NSArray *tracks = tracklistRenderer.captionTracksArray;+ if (tracks.count > 0) return tracks;+ return nil;+}++static YTIVideoDetails *YouModVideoDetailsForPlayer(YTPlayerViewController *player) {+ YTIPlayerResponse *ires = YouModPlayerDataForPlayer(player);+ return ires.videoDetails;+}++static NSString *YouModAuthorForPlayer(YTPlayerViewController *player) {+ YTIVideoDetails *details = YouModVideoDetailsForPlayer(player);+ return details.author;+}++static NSString *YouModTitleForPlayer(YTPlayerViewController *player) {+ YTIVideoDetails *details = YouModVideoDetailsForPlayer(player);+ return details.title;+}++static NSString *YouModDescriptionForPlayer(YTPlayerViewController *player) {+ YTIVideoDetails *details = YouModVideoDetailsForPlayer(player);+ return details.shortDescription;+}++static NSArray *YouModAdaptiveFormatObjectsForPlayer(YTPlayerViewController *player) {+ YTIPlayerResponse *playerData = YouModPlayerDataForPlayer(player);+ YTIStreamingData *streamingData = playerData.streamingData;+ return streamingData.adaptiveFormatsArray;+}++static YouModMediaFormat *YouModMediaFormatFromStream(YTIFormatStream *stream, BOOL video) {+ NSString *url = stream.URL;+ NSString *mimeType = stream.mimeType;+ NSString *lowerMime = mimeType.lowercaseString;+ BOOL typeMatches = video ? ([lowerMime containsString:@"video/"]) : ([lowerMime containsString:@"audio/"]);+ if (!typeMatches) return nil;++ BOOL mimeLooksMP4 = [lowerMime containsString:@"mp4"] && ([lowerMime containsString:@"avc1"] || ([lowerMime containsString:@"mp4a"] && stream.itag == 140));+ if (mimeType.length && !mimeLooksMP4) return nil;++ YouModMediaFormat *format = [YouModMediaFormat new];+ format.source = stream;+ format.video = video;+ format.urlString = YouModURLStringWithCPN(url);+ format.mimeType = mimeType;+ int height = stream.height;+ if (video && height > 1080) return nil;+ format.resolution = height;+ format.fps = stream.fps;+ format.qualityLabel = stream.qualityLabel;+ if ([stream.qualityLabel hasSuffix:@"HDR"]) return nil;+ if (!video) {+ YTIAudioTrack *audio = stream.audioTrack;+ NSString *audioidp = audio.id_p;+ if (audio.hasId_p) {+ if (INTFORVAL(AudioPreferIndex) == 1 && ![audioidp hasSuffix:@".4"]) return nil;+ if (INTFORVAL(AudioPreferIndex) == 2 && ![audioidp hasPrefix:@"en"]) return nil;+ format.qualityLabel = audio.displayName;+ format.idp = audioidp;+ }+ }+ format.contentLength = stream.contentLength;+ format.durationMs = stream.approxDurationMs;+ format.itag = stream.itag;+ return format;+}++static NSArray <YouModMediaFormat *> *YouModFormatsForPlayer(YTPlayerViewController *player, BOOL video) {+ NSMutableArray *formats = [NSMutableArray array];+ for (YTIFormatStream *stream in YouModAdaptiveFormatObjectsForPlayer(player)) {+ YouModMediaFormat *format = YouModMediaFormatFromStream(stream, video);+ if (format) [formats addObject:format];+ }++ [formats sortUsingComparator:^NSComparisonResult(YouModMediaFormat *left, YouModMediaFormat *right) {+ if (video) {+ NSInteger leftRes = left.resolution;+ NSInteger rightRes = right.resolution;+ if (leftRes != rightRes) return leftRes > rightRes ? NSOrderedAscending : NSOrderedDescending;+ NSInteger leftFPS = left.fps;+ NSInteger rightFPS = right.fps;+ if (leftFPS != rightFPS) return leftFPS > rightFPS ? NSOrderedAscending : NSOrderedDescending;+ }++ BOOL leftMP4 = YouModFormatLooksMP4Family(left);+ BOOL rightMP4 = YouModFormatLooksMP4Family(right);+ if (leftMP4 != rightMP4) return leftMP4 ? NSOrderedAscending : NSOrderedDescending;++ if (left.contentLength != right.contentLength)+ return left.contentLength > right.contentLength ? NSOrderedAscending : NSOrderedDescending;+ return NSOrderedSame;+ }];++ NSMutableArray *unique = [NSMutableArray array];+ NSMutableSet *seen = [NSMutableSet set];+ for (YouModMediaFormat *format in formats) {+ NSInteger fps = format.fps;+ NSString *key = video+ ? [NSString stringWithFormat:@"%@-%ld-%@", format.qualityLabel, (long)fps, YouModMimeDetail(format.mimeType)]+ : [NSString stringWithFormat:@"%@-%@", format.qualityLabel, YouModMimeDetail(format.mimeType)];+ if ([seen containsObject:key]) continue;+ [seen addObject:key];+ [unique addObject:format];+ }+ return unique.copy;+}++static UIViewController *YouModPresenterForSender(UIView *sender, YTPlayerViewController *player) {+ UIViewController *presenter = nil;+ if ([sender respondsToSelector:@selector(_viewControllerForAncestor)])+ presenter = [sender _viewControllerForAncestor];+ if (!presenter) presenter = player;+ return YouModTopViewController(presenter);+}++static YTPlayerViewController *YouModPlayerFromViewController(UIViewController *vc) {+ Class playerClass = NSClassFromString(@"YTPlayerViewController");+ UIViewController *cursor = vc;+ while (cursor) {+ if (playerClass && [cursor isKindOfClass:playerClass]) return (YTPlayerViewController *)cursor;+ id player = YouModObjectFromSelector(cursor, @selector(playerViewController));+ if (playerClass && [player isKindOfClass:playerClass]) return (YTPlayerViewController *)player;+ cursor = cursor.parentViewController;+ }+ return YouModCurrentPlayerViewController;+}++static NSURL *YouModThumbnailURL(YTPlayerViewController *player) {+ if (!player) return nil;+ YTIVideoDetails *details = YouModVideoDetailsForPlayer(player);+ YTIThumbnailDetails *thumbmain = details.thumbnail;+ YTIThumbnailDetails_Thumbnail *bestThumbnail = nil;+ NSUInteger maxPixels = 0;++ for (YTIThumbnailDetails_Thumbnail *thumb in thumbmain.thumbnailsArray) {+ NSUInteger pixels = (NSUInteger)thumb.width * (NSUInteger)thumb.height;+ if (pixels > maxPixels) {+ maxPixels = pixels;+ bestThumbnail = thumb;+ }+ }++ return [NSURL URLWithString:bestThumbnail.URL];+}++static void YouModRequestPhotoAccess(void (^completion)(BOOL granted)) {+ [PHPhotoLibrary requestAuthorizationForAccessLevel:PHAccessLevelAddOnly handler:^(PHAuthorizationStatus status) {+ completion(status == PHAuthorizationStatusAuthorized || status == PHAuthorizationStatusLimited);+ }];+}++static void YouModSaveVideoToPhotos(NSURL *fileURL, UIViewController *presenter, void (^completion)(BOOL success, NSError *error)) {+ YouModRequestPhotoAccess(^(BOOL granted) {+ if (!granted) {+ NSError *error = [NSError errorWithDomain:@"YouMod" code:1 userInfo:@{NSLocalizedDescriptionKey: @"Photos access denied"}];+ completion(NO, error);+ return;+ }+ [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{+ [PHAssetCreationRequest creationRequestForAssetFromVideoAtFileURL:fileURL];+ } completionHandler:^(BOOL success, NSError *error) {+ dispatch_async(dispatch_get_main_queue(), ^{+ completion(success, error);+ });+ }];+ });+}++static void YouModShareItem(id item, UIViewController *presenter) {+ if (!item || !presenter) return;+ UIActivityViewController *activity = [[UIActivityViewController alloc] initWithActivityItems:@[item] applicationActivities:nil];+ if (isPad()) {+ activity.popoverPresentationController.sourceView = presenter.view;+ activity.popoverPresentationController.sourceRect = CGRectMake(presenter.view.bounds.size.width / 2, presenter.view.bounds.size.height, 0, 0);+ activity.popoverPresentationController.permittedArrowDirections = 0;+ } else {+ activity.popoverPresentationController.sourceView = presenter.view;+ }+ [presenter presentViewController:activity animated:YES completion:nil];+}++static void YouModShareFile(NSURL *fileURL, UIViewController *presenter) {+ YouModShareItem(fileURL, presenter);+}++static NSInteger YouModGetPostDownloadAction(void) {+ return INTFORVAL(PostDownloadAction);+}++static void YouModHandlePostDownloadFile(NSURL *fileURL, BOOL isVideo, UIViewController *presenter) {+ if (!fileURL) return;+ NSInteger action = YouModGetPostDownloadAction();++ if (action == PostDownloadActionSaveToPhotos) {+ if (isVideo && YouModVideoFileCanSaveToPhotos(fileURL)) {+ YouModSaveVideoToPhotos(fileURL, presenter, ^(BOOL success, NSError *error) {+ if (success) {+ YouModSendSuccess(LOC(@"SAVED_TO_PHOTOS"));+ } else {+ YouModSendError(error.localizedDescription ?: LOC(@"CANNOT_SAVE_TO_PHOTOS"));+ YouModShareFile(fileURL, presenter);+ }+ });+ } else {+ YouModSendSuccess(LOC(@"DOWNLOAD_COMPLETED"));+ YouModShareFile(fileURL, presenter);+ }+ } else if (action == PostDownloadActionShare) {+ YouModSendSuccess(LOC(@"DOWNLOAD_COMPLETED"));+ YouModShareFile(fileURL, presenter);+ } else if (action == PostDownloadActionAsk) {+ UIView *parent = sbGetNotificationParent();+ [SBSkipNotificationView showDownloadCompleteDialogInView:parent+ message:LOC(@"DOWNLOAD_COMPLETED")+ saveHandler:^{+ if (isVideo && YouModVideoFileCanSaveToPhotos(fileURL)) {+ YouModSaveVideoToPhotos(fileURL, presenter, ^(BOOL success, NSError *error) {+ if (success) {+ YouModSendSuccess(LOC(@"SAVED_TO_PHOTOS"));+ } else {+ YouModSendError(error.localizedDescription ?: LOC(@"CANNOT_SAVE_TO_PHOTOS"));+ YouModShareFile(fileURL, presenter);+ }+ });+ } else {+ YouModSendSuccess(LOC(@"DOWNLOAD_COMPLETED"));+ YouModShareFile(fileURL, presenter);+ }+ } shareHandler:^{+ YouModShareFile(fileURL, presenter);+ } duration:8.0];+ }+}++static void YouModHandlePostDownloadImage(UIImage *image, UIViewController *presenter) {+ if (!image) return;+ NSInteger action = YouModGetPostDownloadAction();++ if (action == PostDownloadActionSaveToPhotos) {+ YouModRequestPhotoAccess(^(BOOL granted) {+ if (!granted) {+ YouModSendError(LOC(@"PHOTO_ACCESS_DENINED"));+ return;+ }+ [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{+ [PHAssetChangeRequest creationRequestForAssetFromImage:image];+ } completionHandler:^(BOOL success, NSError *saveError) {+ dispatch_async(dispatch_get_main_queue(), ^{+ if (success) {+ YouModSendSuccess(LOC(@"SAVED_TO_PHOTOS"));+ } else {+ YouModSendError(saveError.localizedDescription ?: LOC(@"SAVE_FAILED"));+ YouModShareItem(image, presenter);+ }+ });+ }];+ });+ } else if (action == PostDownloadActionShare) {+ YouModSendSuccess(LOC(@"DOWNLOAD_COMPLETED"));+ YouModShareItem(image, presenter);+ } else if (action == PostDownloadActionAsk) {+ UIView *parent = sbGetNotificationParent();+ [SBSkipNotificationView showDownloadCompleteDialogInView:parent+ message:LOC(@"DOWNLOAD_COMPLETED")+ saveHandler:^{+ YouModRequestPhotoAccess(^(BOOL granted) {+ if (!granted) {+ YouModSendError(LOC(@"PHOTO_ACCESS_DENINED"));+ return;+ }+ [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{+ [PHAssetChangeRequest creationRequestForAssetFromImage:image];+ } completionHandler:^(BOOL success, NSError *saveError) {+ dispatch_async(dispatch_get_main_queue(), ^{+ if (success) {+ YouModSendSuccess(LOC(@"SAVED_TO_PHOTOS"));+ } else {+ YouModSendError(saveError.localizedDescription ?: LOC(@"SAVE_FAILED"));+ }+ });+ }];+ });+ } shareHandler:^{+ YouModShareItem(image, presenter);+ } duration:8.0];+ }+}++static void YouModPresentMenu(YTPlayerViewController *player, NSArray <YouModMenuItem *> *items, UIViewController *presenter, UIView *sender) {+ presenter = YouModTopViewController(presenter);+ YTDefaultSheetController *sheet = [%c(YTDefaultSheetController) sheetControllerWithParentResponder:presenter];+ for (YouModMenuItem *item in items) {+ YTActionSheetAction *action;+ if (item.subtitle == nil) {+ action = [%c(YTActionSheetAction) actionWithTitle:item.title iconImage:item.iconImage style:0 handler:^(__unused YTActionSheetAction *action) {+ item.handler();+ }];+ } else {+ action = [%c(YTActionSheetAction) actionWithTitle:item.title subtitle:item.subtitle iconImage:item.iconImage handler:^(__unused YTActionSheetAction *action) {+ item.handler();+ }];+ }+ [sheet addAction:action];+ }+ if (player && player != nil) {+ [sheet addHeaderWithTitle:YouModAuthorForPlayer(player) subtitle:YouModTitleForPlayer(player)];+ }+ if (sender) {+ [sheet presentFromView:sender animated:YES completion:nil];+ } else {+ [sheet presentFromViewController:presenter animated:YES completion:nil];+ }+}++@implementation YouModDownloadCoordinator+++ (instancetype)sharedCoordinator {+ static YouModDownloadCoordinator *coordinator;+ static dispatch_once_t onceToken;+ dispatch_once(&onceToken, ^{+ coordinator = [YouModDownloadCoordinator new];+ });+ return coordinator;+}++- (instancetype)init {+ self = [super init];+ if (self) {+ NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];+ configuration.HTTPAdditionalHeaders = @{+ @"User-Agent": @"Mozilla/5.0",+ @"Origin": @"https://www.youtube.com",+ @"Referer": @"https://www.youtube.com/",+ };+ configuration.HTTPMaximumConnectionsPerHost = YouModFastDownloadConcurrency;+ configuration.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData;+ configuration.timeoutIntervalForResource = 300;+ _session = [NSURLSession sessionWithConfiguration:configuration delegate:self delegateQueue:[NSOperationQueue mainQueue]];+ }+ return self;+}++- (void)showProgressWithTitle:(NSString *)title presenter:(UIViewController *)presenter {+ self.presenter = presenter;+ self.baseProgressTitle = title;+ self.downloadStartTime = [NSDate timeIntervalSinceReferenceDate];++ UIView *pillParent = sbGetNotificationParent();+ __weak typeof(self) weakSelf = self;+ self.progressPill = [YMDownloadProgressView showInView:pillParent+ message:[NSString stringWithFormat:@"%@ - 0%%", title]+ cancelAction:^{+ [weakSelf cancelWithMessage:LOC(@"DOWNLOAD_CANCELLED")];+ }];+}++- (void)updateProgressTitle:(NSString *)title progress:(float)progress {+ NSString *displayTitle = [NSString stringWithFormat:@"%@ - %ld%%", title, (long)lrintf(progress * 100.0f)];+ [self.progressPill updateProgress:progress title:displayTitle subtitle:nil];+}++// SABR progress with a speed + size subtitle. When the total is known (the formats'+// contentLength, in self.totalBytes) the percentage and subtitle track downloaded/total+// like the direct/server path; otherwise they fall back to the segment fraction + a+// downloaded-so-far figure. Reuses the "X.X MB/s · Y.Y MB" style.+- (void)updateSABRProgressTitle:(NSString *)title progress:(float)progress bytesDownloaded:(unsigned long long)bytesDownloaded {+ NSTimeInterval elapsed = [NSDate timeIntervalSinceReferenceDate] - self.downloadStartTime;+ double downloadedMB = (double)bytesDownloaded / 1048576.0;+ double speedMBps = elapsed > 0 ? (downloadedMB / elapsed) : 0;++ NSString *subtitle;+ if (self.totalBytes > 0) {+ // Real percentage from bytes; subtitle shows downloaded / total.+ progress = fminf(fmaxf((float)bytesDownloaded / (float)self.totalBytes, 0.0f), 1.0f);+ double totalMB = (double)self.totalBytes / 1048576.0;+ subtitle = [NSString stringWithFormat:@"%.1f MB/s · %.1f / %.1f MB", speedMBps, downloadedMB, totalMB];+ } else {+ // Total unknown → segment-fraction % + downloaded-so-far.+ subtitle = [NSString stringWithFormat:@"%.1f MB/s · %.1f MB", speedMBps, downloadedMB];+ }++ NSString *displayTitle = [NSString stringWithFormat:@"%@ - %ld%%", title, (long)lrintf(progress * 100.0f)];+ [self.progressPill updateProgress:progress title:displayTitle subtitle:subtitle];+}++- (void)cancelWithMessage:(NSString *)message {+ if (![NSThread isMainThread]) {+ dispatch_async(dispatch_get_main_queue(), ^{+ [self cancelWithMessage:message];+ });+ return;+ }++ [self.task cancel];+ [self.metadataTask cancel];+ [self.rangeDownloader cancel];+ [self.exporter cancelExport];+ [YMSABR cancelCurrent];++ self.task = nil;+ self.metadataTask = nil;+ self.rangeDownloader = nil;+ self.exporter = nil;+ self.fileCompletion = nil;+ self.downloadCompletionBlock = nil;++ self.active = NO;+ self.cancelled = YES;+ if (self.progressPill) { [self.progressPill dismiss]; self.progressPill = nil; }+ [self cleanupTemporaryFiles];+ if (message.length) YouModSendError(message);+}++- (void)cleanupTemporaryFiles {+ if (self.videoTempURL) [NSFileManager.defaultManager removeItemAtURL:self.videoTempURL error:nil];+ if (self.audioTempURL) [NSFileManager.defaultManager removeItemAtURL:self.audioTempURL error:nil];+ if (self.destinationURL) [NSFileManager.defaultManager removeItemAtURL:self.destinationURL error:nil];+ self.videoTempURL = nil;+ self.audioTempURL = nil;+ self.destinationURL = nil;+}++- (void)downloadURL:(NSURL *)url toURL:(NSURL *)destinationURL expectedBytes:(unsigned long long)expectedBytes headers:(NSDictionary *)headers completion:(YouModFileDownloadCompletion)completion {+ self.currentResolvedSizeAddedToTotal = NO;+ self.currentExpectedBytes = expectedBytes;+ self.currentBytes = 0;+ if (expectedBytes == 0) {+ __weak typeof(self) weakSelf = self;+ [self resolveExpectedBytesForURL:url headers:headers completion:^(unsigned long long bytes) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ if (bytes > 0) [self adjustCurrentExpectedBytesIfNeeded:bytes];+ [self beginDownloadURL:url toURL:destinationURL expectedBytes:bytes headers:headers allowFast:YES completion:completion];+ }];+ return;+ }+ [self beginDownloadURL:url toURL:destinationURL expectedBytes:expectedBytes headers:headers allowFast:YES completion:completion];+}++- (void)beginDownloadURL:(NSURL *)url toURL:(NSURL *)destinationURL expectedBytes:(unsigned long long)expectedBytes headers:(NSDictionary *)headers allowFast:(BOOL)allowFast completion:(YouModFileDownloadCompletion)completion {+ self.destinationURL = destinationURL;+ self.currentExpectedBytes = expectedBytes;+ self.currentBytes = 0;+ self.finishedCurrentFile = NO;+ self.fileCompletion = completion;+ [NSFileManager.defaultManager removeItemAtURL:destinationURL error:nil];++ if (self.cancelled) {+ if (completion) completion(nil, [NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:@{NSLocalizedDescriptionKey: LOC(@"DOWNLOAD_CANCELLED")}]);+ return;+ }++ if (allowFast && expectedBytes == 0) allowFast = NO;++ if (allowFast && expectedBytes >= YouModFastDownloadMinimumBytes) {+ __weak typeof(self) weakSelf = self;+ self.rangeDownloader = [[YouModRangeDownloader alloc] initWithURL:url destinationURL:destinationURL expectedBytes:expectedBytes headers:headers progress:^(unsigned long long completedBytes) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ self.currentBytes = completedBytes;+ [self updateDownloadProgressWithCurrentBytes:completedBytes expectedBytes:expectedBytes];+ } completion:^(NSURL *fileURL, NSError *error) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ self.rangeDownloader = nil;+ if (error) {+ [self beginDownloadURL:url toURL:destinationURL expectedBytes:expectedBytes headers:headers allowFast:NO completion:completion];+ return;+ }+ if (completion) completion(fileURL, nil);+ }];+ [self.rangeDownloader start];+ return;+ }++ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60.0];+ YouModApplyDownloadHeaders(request, headers);+ self.task = [self.session downloadTaskWithRequest:request];+ [self.task resume];+}++- (void)resolveExpectedBytesForURL:(NSURL *)url headers:(NSDictionary *)headers completion:(void (^)(unsigned long long bytes))completion {+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:15.0];+ request.HTTPMethod = @"HEAD";+ YouModApplyDownloadHeaders(request, headers);++ __weak typeof(self) weakSelf = self;+ self.metadataTask = [NSURLSession.sharedSession dataTaskWithRequest:request completionHandler:^(__unused NSData *data, NSURLResponse *response, __unused NSError *error) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self) return;++ unsigned long long bytes = 0;+ if (response.expectedContentLength > 0) {+ bytes = (unsigned long long)response.expectedContentLength;+ } else if ([response isKindOfClass:NSHTTPURLResponse.class]) {+ id header = ((NSHTTPURLResponse *)response).allHeaderFields[@"Content-Length"];+ if ([header respondsToSelector:@selector(unsignedLongLongValue)])+ bytes = [header unsignedLongLongValue];+ }++ dispatch_async(dispatch_get_main_queue(), ^{+ self.metadataTask = nil;+ completion(bytes);+ });+ }];+ [self.metadataTask resume];+}++- (void)updateDownloadProgressWithCurrentBytes:(unsigned long long)currentBytes expectedBytes:(unsigned long long)expectedBytes {+ unsigned long long total = self.totalBytes ?: expectedBytes;+ float progress = total ? (float)(self.completedBytes + currentBytes) / (float)total : 0.0f;+ progress = fminf(fmaxf(progress, 0.0f), 1.0f);++ NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate];+ NSTimeInterval elapsed = now - self.downloadStartTime;+ double speedMBps = 0;+ if (elapsed > 0) {+ speedMBps = ((double)(self.completedBytes + currentBytes) / 1048576.0) / elapsed;+ }+ double totalMB = (double)total / 1048576.0;++ NSString *title = [NSString stringWithFormat:@"%@ - %ld%%", self.baseProgressTitle ?: @"Downloading", (long)lrintf(progress * 100.0f)];+ NSString *subtitle;+ if (total > 0) {+ subtitle = [NSString stringWithFormat:@"%.1f MB/s · %.1f MB", speedMBps, totalMB];+ } else {+ subtitle = [NSString stringWithFormat:@"%.1f MB/s", speedMBps];+ }+ [self.progressPill updateProgress:progress title:title subtitle:subtitle];+}++- (void)adjustCurrentExpectedBytesIfNeeded:(unsigned long long)newExpectedBytes {+ unsigned long long oldExpectedBytes = self.currentExpectedBytes;+ if (newExpectedBytes <= oldExpectedBytes) return;++ self.currentExpectedBytes = newExpectedBytes;+ if (oldExpectedBytes > 0) {+ self.totalBytes += newExpectedBytes - oldExpectedBytes;+ } else if (!self.currentResolvedSizeAddedToTotal) {+ self.totalBytes += newExpectedBytes;+ self.currentResolvedSizeAddedToTotal = YES;+ }+}++- (void)startVideoDownloadWithVideoFormat:(YouModMediaFormat *)videoFormat audioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName presenter:(UIViewController *)presenter videoID:(NSString *)vidID {+ if (self.active) {+ YouModSendToast(LOC(@"ALREADY_DOWNLOADING"));+ return;+ }+ [self startDirectVideoDownloadWithVideoFormat:videoFormat audioFormat:audioFormat fileName:fileName presenter:presenter videoID:vidID];+}++- (void)startDirectVideoDownloadWithVideoFormat:(YouModMediaFormat *)videoFormat audioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName presenter:(UIViewController *)presenter videoID:(NSString *)vidID {+ [self cleanupTemporaryFiles];+ // On-device SABR path. Checked first: on modern YouTube the format URLs are empty+ // (media flows via SABR), so the URL check below would otherwise abort.+ if (INTFORVAL(DownloadMethod) == DownloadMethodOnDevice) {+ [self startSABRVideoDownloadWithVideoFormat:videoFormat audioFormat:audioFormat fileName:fileName presenter:presenter];+ return;+ }+ NSURL *videoURL = [NSURL URLWithString:videoFormat.urlString];+ NSURL *audioURL = [NSURL URLWithString:audioFormat.urlString];+ if (!videoURL || !audioURL) {+ YouModSendError(LOC(@"NO_STREAM_URL"));+ return;+ }++ self.active = YES;+ self.cancelled = NO;+ self.completedBytes = 0;+ self.totalBytes = videoFormat.contentLength + audioFormat.contentLength;+ self.videoTempURL = YouModTemporaryFileURL(YouModFileExtensionForFormat(videoFormat));+ self.audioTempURL = YouModTemporaryFileURL(YouModFileExtensionForFormat(audioFormat));+ NSString *outputExtension = YouModMergedVideoOutputExtension(videoFormat, audioFormat);+ if (INTFORVAL(DownloadMethod) == DownloadMethodServer) {+ NSString *resolutionStr = [NSString stringWithFormat:@"%d", videoFormat.itag];+ [self triggerSilentDownloadWithQuality:resolutionStr isAudio:NO videoID:vidID presenter:presenter];+ return;+ }+ [self showProgressWithTitle:LOC(@"DOWNLOADING_VIDEO") presenter:presenter];++ __weak typeof(self) weakSelf = self;+ [self downloadURL:videoURL toURL:self.videoTempURL expectedBytes:videoFormat.contentLength headers:nil completion:^(NSURL *videoFileURL, NSError *videoError) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ if (videoError) {+ [self failWithError:videoError ?: [NSError errorWithDomain:@"YouMod" code:2 userInfo:@{NSLocalizedDescriptionKey: @"Video download failed"}]];+ return;+ }++ self.completedBytes += MAX(videoFormat.contentLength, self.currentBytes);+ [self updateProgressTitle:LOC(@"DOWNLOADING_AUDIO") progress:(self.totalBytes ? (float)self.completedBytes / (float)self.totalBytes : 0.5f)];+ [self downloadURL:audioURL toURL:self.audioTempURL expectedBytes:audioFormat.contentLength headers:nil completion:^(NSURL *audioFileURL, NSError *audioError) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ if (audioError) {+ [self failWithError:audioError ?: [NSError errorWithDomain:@"YouMod" code:3 userInfo:@{NSLocalizedDescriptionKey: @"Audio download failed"}]];+ return;+ }+ unsigned long long durationMs = videoFormat.durationMs ?: audioFormat.durationMs;+ [self mergeVideoURL:videoFileURL audioURL:audioFileURL fileName:fileName outputExtension:outputExtension durationMs:durationMs presenter:presenter];+ }];+ }];+}++// On-device SABR download: fetch the chosen mp4 video + m4a audio itags via the SABR+// engine (which captures/replays the app's own signed request), then hand the two+// elementary files to the existing muxer. Additive — the direct/server paths above+// are untouched.+- (void)startSABRVideoDownloadWithVideoFormat:(YouModMediaFormat *)videoFormat audioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName presenter:(UIViewController *)presenter {+ self.active = YES;+ self.cancelled = NO;+ self.completedBytes = 0;+ // Known total from the formats' contentLength (present even on 21.29 where the+ // stream URL is empty) → the pill can show a real % + total size. 0 if unknown.+ self.totalBytes = videoFormat.contentLength + audioFormat.contentLength;+ [self showProgressWithTitle:LOC(@"DOWNLOADING_VIDEO") presenter:presenter];++ unsigned long long durationMs = videoFormat.durationMs ?: audioFormat.durationMs;+ __weak typeof(self) weakSelf = self;+ [YMSABR downloadVideoItag:videoFormat.itag audioItag:audioFormat.itag+ progress:^(float fraction, unsigned long long bytesDownloaded, BOOL isAudio) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ NSString *title = isAudio ? LOC(@"DOWNLOADING_AUDIO") : LOC(@"DOWNLOADING_VIDEO");+ [self updateSABRProgressTitle:title progress:fraction bytesDownloaded:bytesDownloaded];+ }+ completion:^(NSURL *videoURL, NSURL *audioURL, NSString *err) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ if (err || !videoURL || !audioURL) {+ [self failWithError:[NSError errorWithDomain:@"YouMod" code:20 userInfo:@{NSLocalizedDescriptionKey: err ?: LOC(@"DOWNLOAD_FAILED")}]];+ return;+ }+ self.videoTempURL = videoURL; // so cleanupTemporaryFiles removes them afterwards+ self.audioTempURL = audioURL;+ [self mergeVideoURL:videoURL audioURL:audioURL fileName:fileName outputExtension:@"mp4" durationMs:durationMs presenter:presenter];+ }];+}++// On-device SABR audio-only download: fetch the chosen m4a audio itag via SABR, then+// remux the fragmented-mp4 track into a clean .m4a with AVFoundation (passthrough, no+// re-encode). No half-length trim: SABR delivers a properly segmented, complete track.+- (void)startSABRAudioDownloadWithAudioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName presenter:(UIViewController *)presenter {+ self.active = YES;+ self.cancelled = NO;+ self.completedBytes = 0;+ // Known total from the format's contentLength (see video path). 0 if unknown.+ self.totalBytes = audioFormat.contentLength;+ [self showProgressWithTitle:LOC(@"DOWNLOADING_AUDIO") presenter:presenter];++ NSURL *finalURL = YouModUniqueFileURL(fileName, @"m4a");+ __weak typeof(self) weakSelf = self;+ [YMSABR downloadAudioItag:audioFormat.itag+ progress:^(float fraction, unsigned long long bytesDownloaded) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ [self updateSABRProgressTitle:LOC(@"DOWNLOADING_AUDIO") progress:fraction bytesDownloaded:bytesDownloaded];+ }+ completion:^(NSURL *audioURL, NSString *err) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ if (err || !audioURL) {+ [self failWithError:[NSError errorWithDomain:@"YouMod" code:21 userInfo:@{NSLocalizedDescriptionKey: err ?: LOC(@"DOWNLOAD_FAILED")}]];+ return;+ }+ self.audioTempURL = audioURL; // so cleanupTemporaryFiles removes it afterwards+ [self exportSABRAudioURL:audioURL toURL:finalURL presenter:presenter];+ }];+}++// Remux a SABR audio track (fragmented mp4) to a clean m4a container, full length.+- (void)exportSABRAudioURL:(NSURL *)audioURL toURL:(NSURL *)outputURL presenter:(UIViewController *)presenter {+ [self updateProgressTitle:LOC(@"FINA_VIDEO") progress:0.985f];+ AVURLAsset *asset = [AVURLAsset URLAssetWithURL:audioURL options:nil];+ AVAssetExportSession *exportSession = [AVAssetExportSession exportSessionWithAsset:asset presetName:AVAssetExportPresetAppleM4A];+ if (!exportSession) {+ [self failWithError:[NSError errorWithDomain:@"YouMod" code:22 userInfo:@{NSLocalizedDescriptionKey: LOC(@"DOWNLOAD_FAILED")}]];+ return;+ }+ exportSession.outputURL = outputURL;+ exportSession.outputFileType = AVFileTypeAppleM4A;+ self.exporter = exportSession;++ __weak typeof(self) weakSelf = self;+ [exportSession exportAsynchronouslyWithCompletionHandler:^{+ dispatch_async(dispatch_get_main_queue(), ^{+ __strong typeof(weakSelf) self = weakSelf;+ if (!self) return;+ self.exporter = nil;+ if (self.cancelled || exportSession.status == AVAssetExportSessionStatusCancelled) return;+ if (exportSession.status == AVAssetExportSessionStatusCompleted) {+ [self completeWithFileURL:outputURL isVideo:NO presenter:presenter];+ } else {+ [self failWithError:exportSession.error ?: [NSError errorWithDomain:@"YouMod" code:23 userInfo:@{NSLocalizedDescriptionKey: LOC(@"DOWNLOAD_FAILED")}]];+ }+ });+ }];+}++- (void)startAudioDownloadWithAudioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName presenter:(UIViewController *)presenter videoID:(NSString *)vidID {+ if (self.active) {+ YouModSendToast(LOC(@"ALREADY_DOWNLOADING"));+ return;+ }+ [self startDirectAudioDownloadWithAudioFormat:audioFormat fileName:fileName presenter:presenter videoID:vidID];+}++- (void)startDirectAudioDownloadWithAudioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName presenter:(UIViewController *)presenter videoID:(NSString *)vidID {+ [self cleanupTemporaryFiles];+ // On-device SABR path. Checked first: on modern YouTube the format URLs are empty+ // (media flows via SABR), so the URL check below would otherwise abort.+ if (INTFORVAL(DownloadMethod) == DownloadMethodOnDevice) {+ [self startSABRAudioDownloadWithAudioFormat:audioFormat fileName:fileName presenter:presenter];+ return;+ }+ NSURL *audioURL = [NSURL URLWithString:audioFormat.urlString];+ if (!audioURL) {+ YouModSendError(LOC(@"NO_AUDIO_URL"));+ return;+ }++ self.active = YES;+ self.cancelled = NO;+ self.completedBytes = 0;+ self.totalBytes = audioFormat.contentLength;++ NSURL *finalURL = YouModUniqueFileURL(fileName, @"m4a");+ NSString *tempFileName = [NSString stringWithFormat:@"Temp_%@", fileName];+ NSURL *downloadURL = YouModUniqueFileURL(tempFileName, @"m4a");+ self.audioTempURL = downloadURL;+ if (INTFORVAL(DownloadMethod) == DownloadMethodServer) {+ [self triggerSilentDownloadWithQuality:nil isAudio:YES videoID:vidID presenter:presenter];+ return;+ }++ [self showProgressWithTitle:LOC(@"DOWNLOADING_AUDIO") presenter:presenter];+ __weak typeof(self) weakSelf = self;++ [self downloadURL:audioURL toURL:downloadURL expectedBytes:audioFormat.contentLength headers:nil completion:^(NSURL *fileURL, NSError *error) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) {+ [[NSFileManager defaultManager] removeItemAtURL:downloadURL error:nil];+ return;+ }+ if (error) {+ [[NSFileManager defaultManager] removeItemAtURL:downloadURL error:nil];+ [self failWithError:error ?: [NSError errorWithDomain:@"YouMod" code:4 userInfo:@{NSLocalizedDescriptionKey: @"Audio download failed"}]];+ return;+ }++ [self trimAudioToHalfLengthAtURL:fileURL toURL:finalURL completion:^(NSError *trimError) {+ [[NSFileManager defaultManager] removeItemAtURL:fileURL error:nil];+ if (self.cancelled) return;+ if (trimError) {+ [self failWithError:trimError];+ return;+ }+ [self completeWithFileURL:finalURL isVideo:NO presenter:presenter];+ }];+ }];+}++- (void)trimAudioToHalfLengthAtURL:(NSURL *)inputURL toURL:(NSURL *)outputURL completion:(void (^)(NSError *error))completion {+ [self updateProgressTitle:LOC(@"TRIMMING_AUDIO") progress:0.985f];+ AVURLAsset *asset = [AVURLAsset URLAssetWithURL:inputURL options:nil];++ [asset loadValuesAsynchronouslyForKeys:@[@"duration"] completionHandler:^{+ NSError *error = nil;+ AVKeyValueStatus status = [asset statusOfValueForKey:@"duration" error:&error];+ if (status != AVKeyValueStatusLoaded) {+ dispatch_async(dispatch_get_main_queue(), ^{+ completion(error ?: [NSError errorWithDomain:@"YouMod" code:5 userInfo:@{NSLocalizedDescriptionKey: @"Failed to load audio duration"}]);+ });+ return;+ }++ CMTime totalDuration = asset.duration;+ CMTime halfDuration = CMTimeMultiplyByFloat64(totalDuration, 0.5);+ CMTimeRange exportTimeRange = CMTimeRangeMake(kCMTimeZero, halfDuration);++ AVAssetExportSession *exportSession = [AVAssetExportSession exportSessionWithAsset:asset presetName:AVAssetExportPresetAppleM4A];+ if (!exportSession) {+ dispatch_async(dispatch_get_main_queue(), ^{+ completion([NSError errorWithDomain:@"YouMod" code:6 userInfo:@{NSLocalizedDescriptionKey: @"Failed to create export session"}]);+ });+ return;+ }++ exportSession.outputURL = outputURL;+ exportSession.outputFileType = AVFileTypeAppleM4A;+ exportSession.timeRange = exportTimeRange;++ [exportSession exportAsynchronouslyWithCompletionHandler:^{+ dispatch_async(dispatch_get_main_queue(), ^{+ if (exportSession.status == AVAssetExportSessionStatusCompleted) {+ completion(nil);+ } else {+ completion(exportSession.error ?: [NSError errorWithDomain:@"YouMod" code:7 userInfo:@{NSLocalizedDescriptionKey: @"Audio trim export failed"}]);+ }+ });+ }];+ }];+}++- (void)mergeVideoURL:(NSURL *)videoURL audioURL:(NSURL *)audioURL fileName:(NSString *)fileName outputExtension:(NSString *)outputExtension durationMs:(unsigned long long)durationMs presenter:(UIViewController *)presenter {+ [self updateProgressTitle:LOC(@"MERGING_VID") progress:0.985f];+ NSURL *outputURL = YouModUniqueFileURL(fileName, outputExtension.length ? outputExtension : @"mp4");+ if (durationMs == 0) durationMs = YouModDurationMsForURL(videoURL);++ if (YouModVideoFileCanUseAVFoundation(outputURL)) {+ [self mergeVideoWithAVFoundationVideoURL:videoURL audioURL:audioURL outputURL:outputURL durationMs:durationMs presenter:presenter fallbackError:nil];+ } else {+ [self failWithError:[NSError errorWithDomain:@"YouMod" code:16 userInfo:@{NSLocalizedDescriptionKey: @"Cannot download audio from this stream"}]];+ }+}++- (void)mergeVideoWithAVFoundationVideoURL:(NSURL *)videoURL audioURL:(NSURL *)audioURL outputURL:(NSURL *)outputURL durationMs:(unsigned long long)durationMs presenter:(UIViewController *)presenter fallbackError:(NSError *)fallbackError {+ [self updateProgressTitle:fallbackError ? LOC(@"MERGING_VID_FALLBACK") : LOC(@"MERGING_VID") progress:0.985f];+ AVURLAsset *videoAsset = [AVURLAsset URLAssetWithURL:videoURL options:nil];+ AVURLAsset *audioAsset = [AVURLAsset URLAssetWithURL:audioURL options:nil];+ AVMutableComposition *composition = [AVMutableComposition composition];++ AVAssetTrack *videoTrack = [[videoAsset tracksWithMediaType:AVMediaTypeVideo] firstObject];+ AVAssetTrack *audioTrack = [[audioAsset tracksWithMediaType:AVMediaTypeAudio] firstObject];+ if (!videoTrack || !audioTrack) {+ [self failWithError:fallbackError ?: [NSError errorWithDomain:@"YouMod" code:5 userInfo:@{NSLocalizedDescriptionKey: @"Merge failed"}]];+ return;+ }++ CMTime duration = YouModExportDuration(videoAsset, audioAsset, durationMs);+ if (!YouModCMTimeIsUsable(duration)) {+ [self failWithError:fallbackError ?: [NSError errorWithDomain:@"YouMod" code:9 userInfo:@{NSLocalizedDescriptionKey: @"Cannot determine duration"}]];+ return;+ }+ NSError *insertError = nil;+ AVMutableCompositionTrack *compositionVideo = [composition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid];+ [compositionVideo insertTimeRange:CMTimeRangeMake(kCMTimeZero, duration) ofTrack:videoTrack atTime:kCMTimeZero error:&insertError];+ compositionVideo.preferredTransform = videoTrack.preferredTransform;+ if (insertError) {+ [self failWithError:insertError];+ return;+ }++ AVMutableCompositionTrack *compositionAudio = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid];+ CMTime audioDuration = YouModMinUsableDuration(duration, audioTrack.timeRange.duration);+ [compositionAudio insertTimeRange:CMTimeRangeMake(kCMTimeZero, audioDuration) ofTrack:audioTrack atTime:kCMTimeZero error:&insertError];+ if (insertError) {+ [self failWithError:insertError];+ return;+ }++ AVAssetExportSession *exporter = [[AVAssetExportSession alloc] initWithAsset:composition presetName:AVAssetExportPresetPassthrough];+ exporter.outputURL = outputURL;+ exporter.outputFileType = AVFileTypeMPEG4;+ exporter.shouldOptimizeForNetworkUse = YES;+ self.exporter = exporter;++ __weak typeof(self) weakSelf = self;+ [exporter exportAsynchronouslyWithCompletionHandler:^{+ dispatch_async(dispatch_get_main_queue(), ^{+ __strong typeof(weakSelf) self = weakSelf;+ if (!self) return;+ self.exporter = nil;+ if (self.cancelled || exporter.status == AVAssetExportSessionStatusCancelled) return;+ if (exporter.status == AVAssetExportSessionStatusCompleted) {+ [self completeWithFileURL:outputURL isVideo:YES presenter:presenter];+ } else {+ [self failWithError:exporter.error ?: [NSError errorWithDomain:@"YouMod" code:6 userInfo:@{NSLocalizedDescriptionKey: @"Merge failed"}]];+ }+ });+ }];+}++- (void)completeWithFileURL:(NSURL *)fileURL isVideo:(BOOL)isVideo presenter:(UIViewController *)presenter {+ if (self.cancelled) return;+ self.active = NO;+ [self updateProgressTitle:LOC(@"DOWNLOAD_COMPLETED") progress:1.0f];+ if (self.progressPill) { [self.progressPill dismiss]; self.progressPill = nil; }++ YouModHandlePostDownloadFile(fileURL, isVideo, presenter);+}++- (void)failWithError:(NSError *)error {+ if (self.cancelled) return;+ self.active = NO;+ if (self.progressPill) { [self.progressPill dismiss]; self.progressPill = nil; }+ [self cleanupTemporaryFiles];+ YouModSendError(error.localizedDescription ?: LOC(@"DOWNLOAD_FAILED"));+}++- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite {+ self.currentBytes = (unsigned long long)MAX(totalBytesWritten, 0);+ if (totalBytesExpectedToWrite > 0)+ [self adjustCurrentExpectedBytesIfNeeded:(unsigned long long)totalBytesExpectedToWrite];+ if (self.currentBytes > self.currentExpectedBytes)+ [self adjustCurrentExpectedBytesIfNeeded:self.currentBytes];+ [self updateDownloadProgressWithCurrentBytes:self.currentBytes expectedBytes:self.currentExpectedBytes];+}++- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location {+ if (self.cancelled) return;+ self.finishedCurrentFile = YES;++ NSURL *destURL = self.destinationURL;++ NSError *error = nil;+ [[NSFileManager defaultManager] removeItemAtURL:destURL error:nil];+ [[NSFileManager defaultManager] moveItemAtURL:location toURL:destURL error:&error];++ if (self.downloadCompletionBlock) {+ self.downloadCompletionBlock(error ? nil : destURL, error ? error.localizedDescription : nil);+ self.downloadCompletionBlock = nil;+ } else if (self.fileCompletion) {+ self.fileCompletion(error ? nil : destURL, error);+ self.fileCompletion = nil;+ }+}++- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error {+ if (error && !self.finishedCurrentFile) {+ if (self.downloadCompletionBlock) {+ self.downloadCompletionBlock(nil, error.localizedDescription);+ self.downloadCompletionBlock = nil;+ } else if (self.fileCompletion) {+ self.fileCompletion(nil, error);+ self.fileCompletion = nil;+ }+ }+ // We intentionally don't invalidate the shared session here if it's reused.+}++- (NSString *)serverEndpoint {+ if (INTFORVAL(DownloadServerIndex) == 0) {+ return @"https://appropriatenet2928.tail6a9ca7.ts.net/"; // Europe (@AppropriateNet2928)+ } else if (INTFORVAL(DownloadServerIndex) == 1) {+ return @"https://waterserver.freeddns.org/"; // Thailand - Asia (@Tonwalter888)+ }+ return @"";+}++- (void)triggerSilentDownloadWithQuality:(NSString *)quality isAudio:(BOOL)isAudio videoID:(NSString *)vidID presenter:(UIViewController *)presenter {+ __weak typeof(self) weakSelf = self;+ [self requestDownloadForVideoId:vidID isAudio:isAudio quality:quality presenter:presenter completion:^(NSURL *localURL, NSString *errorMsg) {+ __strong typeof(weakSelf) strongSelf = weakSelf;+ if (!strongSelf || strongSelf.cancelled) return;++ dispatch_async(dispatch_get_main_queue(), ^{+ if (!strongSelf || strongSelf.cancelled) return;+ if (!localURL) {+ [strongSelf cancelWithMessage:errorMsg];+ return;+ }+ [strongSelf completeWithFileURL:localURL isVideo:!isAudio presenter:presenter];+ });+ }];+}++- (void)requestDownloadForVideoId:(NSString *)vId isAudio:(BOOL)isAudio quality:(NSString *)quality presenter:(UIViewController *)presenter completion:(void (^)(NSURL *localURL, NSString *errorMsg))completionBlock {+ [self showProgressWithTitle:LOC(@"CONNECTING_TO_SERVER") presenter:presenter];+ NSString *watchURL = [NSString stringWithFormat:@"https://www.youtube.com/watch?v=%@", vId];+ [self startYTDMDownloadWithWatchURL:watchURL format:isAudio ? @"audio" : @"video" formatId:quality presenter:presenter completion:completionBlock];+}++- (void)startYTDMDownloadWithWatchURL:(NSString *)watchURL format:(NSString *)format formatId:(NSString *)formatId presenter:(UIViewController *)presenter completion:(void (^)(NSURL *localURL, NSString *errorMsg))completionBlock {+ if (!self || self.cancelled) return;+ NSString *urlStr = [[self serverEndpoint] stringByAppendingString:@"/api/download"];+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlStr]];+ [request setHTTPMethod:@"POST"];+ [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];++ NSMutableDictionary *payload = [@{@"url": watchURL, @"format": format} mutableCopy];+ if (formatId) payload[@"format_id"] = formatId;+ request.HTTPBody = [NSJSONSerialization dataWithJSONObject:payload options:0 error:nil];++ [[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {+ if (!self || self.cancelled) return;+ if (error || !data) { completionBlock(nil, @"Server unreachable."); return; }+ NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];++ if (json[@"job_id"]) {+ BOOL isAudioDl = [format isEqualToString:@"audio"];+ [self pollJobStatus:json[@"job_id"] isAudio:isAudioDl presenter:presenter completion:completionBlock];+ }+ else {+ completionBlock(nil, json[@"error"] ?: @"Job init failed.");+ }+ }] resume];+}++- (void)pollJobStatus:(NSString *)jobId isAudio:(BOOL)isAudio presenter:(UIViewController *)presenter completion:(void (^)(NSURL *localURL, NSString *errorMsg))completionBlock {+ if (!self || self.cancelled) return;++ NSString *urlStr = [NSString stringWithFormat:@"%@/api/status/%@", [self serverEndpoint], jobId];+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlStr]];++ [[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {+ if (!self || self.cancelled) return;+ if (error || !data) {+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{+ [self pollJobStatus:jobId isAudio:isAudio presenter:presenter completion:completionBlock];+ });+ return;+ }++ NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];+ NSString *status = json[@"status"];++ if ([status isEqualToString:@"done"]) {+ NSString *singleFileName = json[@"filename"];++ if (!singleFileName || singleFileName.length == 0) {+ singleFileName = isAudio ? @"downloaded_file.mp3" : @"downloaded_file.mp4";+ }++ [self downloadSingleFile:singleFileName isAudio:isAudio forJobId:jobId presenter:presenter completion:completionBlock];++ } else if ([status isEqualToString:@"error"]) {+ completionBlock(nil, json[@"error"] ?: @"Error.");+ } else {+ dispatch_async(dispatch_get_main_queue(), ^{+ [self updateProgressTitle:LOC(@"DOWNLOADING_TO_SERVER") progress:0.0f];+ });+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{+ [self pollJobStatus:jobId isAudio:isAudio presenter:presenter completion:completionBlock];+ });+ }+ }] resume];+}++- (void)downloadSingleFile:(NSString *)filename isAudio:(BOOL)isAudio forJobId:(NSString *)jobId presenter:(UIViewController *)presenter completion:(void (^)(NSURL *localURL, NSString *errorMsg))completionBlock {+ if (!self || self.cancelled) return;++ self.downloadCompletionBlock = completionBlock;++ NSString *tempPath = [NSTemporaryDirectory() stringByAppendingPathComponent:filename];+ self.destinationURL = [NSURL fileURLWithPath:tempPath];++ self.finishedCurrentFile = NO;+ self.currentBytes = 0;+ self.currentExpectedBytes = 0;+ self.baseProgressTitle = isAudio ? LOC(@"DOWNLOADING_AUDIO") : LOC(@"DOWNLOADING_VIDEO");++ dispatch_async(dispatch_get_main_queue(), ^{+ [self updateProgressTitle:self.baseProgressTitle progress:0.0f];+ });++ NSString *urlString = [NSString stringWithFormat:@"%@/api/file/%@", [self serverEndpoint], jobId];++ self.task = [self.session downloadTaskWithURL:[NSURL URLWithString:urlString]];+ self.task.taskDescription = filename;++ [self.task resume];+}++@end++static void YouModShowThumbnailViewer(YTPlayerViewController *player, UIViewController *presenter) {+ NSURL *thumbnailURL = YouModThumbnailURL(player);+ if (!thumbnailURL) {+ YouModSendError(LOC(@"NO_THUMBNAIL_FOUND"));+ return;+ }++ [[NSURLSession.sharedSession dataTaskWithURL:thumbnailURL completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {+ UIImage *image = data ? [UIImage imageWithData:data] : nil;+ dispatch_async(dispatch_get_main_queue(), ^{+ if (!image || error) {+ YouModSendError(error.localizedDescription ?: LOC(@"THUMBNAIL_FAILED"));+ return;+ }++ YouModThumbnailViewController *viewerVC = [[YouModThumbnailViewController alloc] init];+ viewerVC.thumbnailImage = image;+ viewerVC.modalPresentationStyle = UIModalPresentationFormSheet;+ viewerVC.modalTransitionStyle = UIModalTransitionStyleCoverVertical;++ [presenter presentViewController:viewerVC animated:YES completion:nil];+ });+ }] resume];+}++static void YouModCopyThumbnail(YTPlayerViewController *player, UIViewController *presenter) {+ NSURL *thumbnailURL = YouModThumbnailURL(player);+ if (!thumbnailURL) {+ YouModSendError(LOC(@"NO_THUMBNAIL_FOUND"));+ return;+ }++ YouModSendToast(LOC(@"DOWNLOADING_THUMBNAIL"));+ [[NSURLSession.sharedSession dataTaskWithURL:thumbnailURL completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {+ UIImage *image = data ? [UIImage imageWithData:data] : nil;+ dispatch_async(dispatch_get_main_queue(), ^{+ if (!image || error) {+ YouModSendError(error.localizedDescription ?: LOC(@"THUMBNAIL_FAILED"));+ return;+ }+ [[UIPasteboard generalPasteboard] setImage:image];+ YouModSendSuccess(LOC(@"COPIED_TO_CLIPBOARD"));+ });+ }] resume];+}++static void YouModDownloadThumbnail(YTPlayerViewController *player, UIViewController *presenter) {+ NSURL *thumbnailURL = YouModThumbnailURL(player);+ if (!thumbnailURL) {+ YouModSendError(LOC(@"NO_THUMBNAIL_FOUND"));+ return;+ }++ YouModSendToast(LOC(@"DOWNLOADING_THUMBNAIL"));+ [[NSURLSession.sharedSession dataTaskWithURL:thumbnailURL completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {+ UIImage *image = data ? [UIImage imageWithData:data] : nil;+ dispatch_async(dispatch_get_main_queue(), ^{+ if (!image || error) {+ YouModSendError(error.localizedDescription ?: LOC(@"THUMBNAIL_FAILED"));+ return;+ }+ YouModHandlePostDownloadImage(image, presenter);+ });+ }] resume];+}++static void YouModCopyTextToPasteboard(NSString *text, NSString *successKey) {+ UIPasteboard.generalPasteboard.string = text;+ YouModSendSuccess(LOC(successKey));+}++static void YouModCopyImageToPasteboard(UIImage *image, NSString *successKey) {+ UIPasteboard.generalPasteboard.image = image;+ YouModSendSuccess(LOC(successKey));+}++static void YouModShowCopyVideoInfoSheet(YTPlayerViewController *player, UIViewController *presenter, UIView *sender) {+ NSString *author = YouModAuthorForPlayer(player);+ NSString *title = YouModTitleForPlayer(player);+ NSString *description = YouModDescriptionForPlayer(player);+ NSString *all = [NSString stringWithFormat:@"%@ - %@\n%@", author, title, description];++ NSMutableArray *items = [NSMutableArray array];+ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"COPY_ALL_VID_INFO") subtitle:nil icon:YouModYTIconImage(250, NO, nil) handler:^{+ YouModCopyTextToPasteboard(all, @"COPIED_VID_INFO");+ }]];+ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"COPY_AUTHOR") subtitle:nil icon:YouModYTIconImage(250, NO, nil) handler:^{+ YouModCopyTextToPasteboard(author, @"COPIED_AUTHOR");+ }]];+ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"COPY_TITLE") subtitle:nil icon:YouModYTIconImage(250, NO, nil) handler:^{+ YouModCopyTextToPasteboard(title, @"COPIED_TITLE");+ }]];+ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"COPY_DESCRIPTION") subtitle:nil icon:YouModYTIconImage(250, NO, nil) handler:^{+ YouModCopyTextToPasteboard(description, @"COPIED_DESCRIPTION");+ }]];++ YouModPresentMenu(nil, items, presenter, sender);+}++static void YouModShowAudioTrackSelectionSheet(YTPlayerViewController *player, UIViewController *presenter, UIView *sender, NSString *fileName, BOOL downloadVideo, YouModMediaFormat *videoFormat) {+ NSArray <YouModMediaFormat *> *audioFormats = YouModFormatsForPlayer(player, NO);+ if (audioFormats.count == 0) {+ YouModSendError(LOC(@"NO_AUDIO_STREAM_FOUND"));+ return;+ }++ // Skip the audio-track chooser for a single format, or the server path (which+ // can't fetch a chosen track). Direct and on-device SABR both honor the choice.+ if (audioFormats.count == 1 || INTFORVAL(DownloadMethod) == DownloadMethodServer || INTFORVAL(DownloadMethod) == DownloadMethodOnDevice) {+ YouModMediaFormat *selectedFormat = audioFormats.firstObject;+ if (downloadVideo) {+ [[YouModDownloadCoordinator sharedCoordinator] startVideoDownloadWithVideoFormat:videoFormat audioFormat:selectedFormat fileName:fileName presenter:presenter videoID:player.currentVideoID];+ } else {+ [[YouModDownloadCoordinator sharedCoordinator] startAudioDownloadWithAudioFormat:selectedFormat fileName:fileName presenter:presenter videoID:player.currentVideoID];+ }+ return;+ }++ NSMutableArray *items = [NSMutableArray array];+ for (YouModMediaFormat *format in audioFormats) {+ NSString *rowTitle = format.qualityLabel;+ NSString *subtitle = YouModFormatSubtitle(format, NO);+ [items addObject:[YouModMenuItem itemWithTitle:rowTitle subtitle:subtitle icon:YouModYTIconImage(906, NO, nil) handler:^{+ if (downloadVideo) {+ [[YouModDownloadCoordinator sharedCoordinator] startVideoDownloadWithVideoFormat:videoFormat audioFormat:format fileName:fileName presenter:presenter videoID:player.currentVideoID];+ } else {+ [[YouModDownloadCoordinator sharedCoordinator] startAudioDownloadWithAudioFormat:format fileName:fileName presenter:presenter videoID:player.currentVideoID];+ }+ }]];+ }++ YouModPresentMenu(nil, items, presenter, sender);+}++static void YouModShowVideoQualitySheet(YTPlayerViewController *player, UIViewController *presenter, UIView *sender, BOOL isShorts) {+ NSArray <YouModMediaFormat *> *videoFormats = YouModFormatsForPlayer(player, YES);+ NSString *title = YouModTitleForPlayer(player);++ if (videoFormats.count == 0) {+ YouModSendError(LOC(@"NO_VID_AUDIO_STREAM_FOUND"));+ return;+ }++ NSMutableArray *items = [NSMutableArray array];+ for (YouModMediaFormat *format in videoFormats) {+ NSString *rowTitle = format.qualityLabel;+ NSString *subtitle = YouModFormatSubtitle(format, YES);+ if (isShorts) {+ [items addObject:[YouModMenuItem itemWithTitle:rowTitle subtitle:subtitle icon:YouModYTIconImage(769, NO, nil) handler:^{+ YouModShowAudioTrackSelectionSheet(player, presenter, sender, title, YES, format);+ }]];+ } else {+ [items addObject:[YouModMenuItem itemWithTitle:rowTitle subtitle:subtitle icon:YouModYTIconImage(658, NO, nil) handler:^{+ YouModShowAudioTrackSelectionSheet(player, presenter, sender, title, YES, format);+ }]];+ }+ }+ YouModPresentMenu(nil, items, presenter, sender);+}++static void YouModStartDownloadAudio(YTPlayerViewController *player, UIViewController *presenter, UIView *sender) {+ NSString *title = YouModTitleForPlayer(player);+ YouModShowAudioTrackSelectionSheet(player, presenter, sender, title, NO, nil);+}++static void YouModShowCaptionsSheet(YTPlayerViewController *player, UIViewController *presenter, UIView *sender) {+ NSArray *tracks = YouModCaptionTracksForPlayer(player);+ if (tracks.count == 0) {+ YouModSendError(LOC(@"NO_CAPTIONS"));+ return;+ }++ NSMutableArray *items = [NSMutableArray array];+ for (YTICaptionTrackEntry *track in tracks) {+ NSString *baseURL = track.baseURL;+ if (baseURL.length == 0) continue;++ NSString *languageCode = track.languageCode;+ YTIFormattedString *nameObj = track.name;+ NSString *nameStr = nameObj.dropdownOptionTitle;++ [items addObject:[YouModMenuItem itemWithTitle:nameStr subtitle:languageCode icon:YouModYTIconImage(50, NO, nil) handler:^{+ NSString *vttURL = [baseURL stringByAppendingString:@"&fmt=vtt"];+ NSURL *url = [NSURL URLWithString:vttURL];+ if (!url) {+ YouModSendError(LOC(@"NO_CAPTIONS_URL"));+ return;+ }+ YouModSendToast(LOC(@"DOWNLOADING_CAPTIONS"));+ [[NSURLSession.sharedSession dataTaskWithURL:url completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {+ if (error || data.length == 0) {+ dispatch_async(dispatch_get_main_queue(), ^{+ YouModSendError(LOC(@"CAPTIONS_FAILED"));+ });+ return;+ }++ NSString *title = YouModTitleForPlayer(player);+ NSString *filename = [NSString stringWithFormat:@"%@.%@", title, languageCode];+ NSURL *tempURL = YouModUniqueFileURL(filename, @"vtt");++ NSError *writeError = nil;+ BOOL writeSuccess = [data writeToURL:tempURL options:NSDataWritingAtomic error:&writeError];++ dispatch_async(dispatch_get_main_queue(), ^{+ if (writeSuccess) {+ YouModSendSuccess(LOC(@"DOWNLOAD_COMPLETED"));+ YouModShareFile(tempURL, presenter);+ } else {+ YouModSendError(writeError.localizedDescription ?: LOC(@"CAPTIONS_FAILED"));+ }+ });+ }] resume];+ }]];+ }++ if (items.count == 0) {+ YouModSendError(LOC(@"NO_CAPTIONS_URL"));+ return;+ }++ YouModPresentMenu(nil, items, presenter, sender);+}++static void YouModShowThumbnailSheet(YTPlayerViewController *player, UIViewController *presenter, UIView *sender) {+ NSMutableArray *items = [NSMutableArray array];++ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"SAVE_THUMBNAIL") subtitle:nil icon:YouModYTIconImage(57, NO, nil) handler:^{+ YouModDownloadThumbnail(player, presenter);+ }]];+ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"SHOW_THUMBNAIL") subtitle:nil icon:YouModYTIconImage(208, NO, nil) handler:^{+ YouModShowThumbnailViewer(player, presenter);+ }]];+ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"COPY_THUMBNAIL") subtitle:nil icon:YouModYTIconImage(250, NO, nil) handler:^{+ YouModCopyThumbnail(player, presenter);+ }]];++ YouModPresentMenu(nil, items, presenter, sender);+}++static void YouModShowDownloadManager(YTPlayerViewController *player, UIViewController *presenter, UIView *sender, BOOL isShorts) {+ if (!player) {+ YouModSendError(LOC(@"OPEN_VID_BEFORE"));+ return;+ }+ NSMutableArray *items = [NSMutableArray array];+ YTSingleVideoController *sgvidcon = player.activeVideo;+ YTSingleVideo *sgvid = sgvidcon.singleVideo;++ if (!sgvid.isLivePlayback) {+ if (isShorts) {+ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"DOWNLOAD_SHORTS") subtitle:nil icon:YouModYTIconImage(769, NO, nil) handler:^{+ YouModShowVideoQualitySheet(player, presenter, sender, YES);+ }]];+ } else {+ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"DOWNLOAD_VIDEO") subtitle:nil icon:YouModYTIconImage(658, NO, nil) handler:^{+ YouModShowVideoQualitySheet(player, presenter, sender, NO);+ }]];+ }+ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"DOWNLOAD_AUDIO") subtitle:nil icon:YouModYTIconImage(21, NO, nil) handler:^{+ YouModStartDownloadAudio(player, presenter, sender);+ }]];+ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"DOWNLOAD_CAPTIONS") subtitle:nil icon:YouModYTIconImage(50, NO, nil) handler:^{+ YouModShowCaptionsSheet(player, presenter, sender);+ }]];+ }+ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"THUMBNAIL_OPTIONS") subtitle:nil icon:YouModYTIconImage(367, NO, nil) handler:^{+ YouModShowThumbnailSheet(player, presenter, sender);+ }]];+ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"COPY_VID_INFO") subtitle:nil icon:YouModYTIconImage(250, NO, nil) handler:^{+ YouModShowCopyVideoInfoSheet(player, presenter, sender);+ }]];+ YouModPresentMenu(player, items, presenter, sender);+}++%hook YTPlayerViewController++- (void)viewDidAppear:(BOOL)animated {+ %orig;+ YouModCurrentPlayerViewController = self;+}++- (void)viewWillDisappear:(BOOL)animated {+ %orig;+ if (YouModCurrentPlayerViewController == self)+ YouModCurrentPlayerViewController = nil;+}++%end++NSString *YouModGlobalAuthHeader = nil;++%hook SSOAuthorization+- (id)accessToken {+ id token = %orig;+ if ([token isKindOfClass:[NSString class]] && [(NSString *)token length] > 0) {+ YouModGlobalAuthHeader = [NSString stringWithFormat:@"Bearer %@", token];+ }+ return token;+}+%end++%hook SSOAuthorizationImpl+- (id)accessToken {+ id token = %orig;+ if ([token isKindOfClass:[NSString class]] && [(NSString *)token length] > 0) {+ YouModGlobalAuthHeader = [NSString stringWithFormat:@"Bearer %@", token];+ }+ return token;+}+%end++%hook GNPSSOAuthorizationService+- (id)authToken {+ id token = %orig;+ if ([token isKindOfClass:[NSString class]] && [(NSString *)token length] > 0) {+ YouModGlobalAuthHeader = [NSString stringWithFormat:@"Bearer %@", token];+ }+ return token;+}+%end++void YouModConfigureDownloadButton(_ASDisplayView *view) {+ if (!IS_ENABLED(DownloadManager)) return;+ if (objc_getAssociatedObject(view, @selector(YouModDownloadButtonTapped:))) return;++ if ([view.accessibilityIdentifier isEqualToString:@"id.ui.add_to.offline.button"]) {+ view.userInteractionEnabled = YES;+ UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:view action:@selector(YouModDownloadButtonTapped:)];+ tap.cancelsTouchesInView = YES;+ tap.delaysTouchesBegan = YES;+ tap.delaysTouchesEnded = YES;+ [view addGestureRecognizer:tap];+ objc_setAssociatedObject(view, @selector(YouModDownloadButtonTapped:), @YES, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ }+}++static void YouModShowTranslationDialog(NSString *text, UIViewController *presenter) {+ if (!text || text.length == 0 || !presenter) return;++ YouModTranslationViewController *vc = [[YouModTranslationViewController alloc] init];+ vc.originalText = text;++ UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];++ if (@available(iOS 15.0, *)) {+ UISheetPresentationController *sheet = nav.sheetPresentationController;+ if (sheet) {+ sheet.detents = @[+ [UISheetPresentationControllerDetent mediumDetent],+ [UISheetPresentationControllerDetent largeDetent]+ ];+ sheet.prefersGrabberVisible = YES;+ sheet.preferredCornerRadius = 24.0;+ }+ } else {+ // Fallback for iOS 14+ nav.modalPresentationStyle = UIModalPresentationFormSheet;+ }+ [presenter presentViewController:nav animated:YES completion:nil];+}++static NSString *YouModExtractCommentText(UIView *cellView) {+ if (!cellView) return @"";++ NSString *resultText = @"";+ NSMutableArray<UIView *> *queue = [NSMutableArray arrayWithObject:cellView];+ Class asDisplayClass = NSClassFromString(@"_ASDisplayView");+ Class elmTextExClass = NSClassFromString(@"ELMExpandableTextNode");+ Class elmTextClass = NSClassFromString(@"ELMTextNode");++ while (queue.count > 0) {+ UIView *current = queue.firstObject;+ [queue removeObjectAtIndex:0];++ if (asDisplayClass && [current isKindOfClass:asDisplayClass]) {+ ASDisplayNode *node = [current performSelector:@selector(keepalive_node)];++ BOOL isExpandableText = node && elmTextExClass && [node isKindOfClass:elmTextExClass];+ BOOL isText = node && elmTextClass && [node isKindOfClass:elmTextClass];+ BOOL isCommentLabel = [current.accessibilityIdentifier isEqualToString:@"id.comment.content.label"];++ if (isText || isExpandableText || isCommentLabel) {+ resultText = current.accessibilityLabel ?: @"";+ break;+ }++ for (id obj in node.yogaChildren) {+ if ([obj isKindOfClass:elmTextClass] && [[obj description] containsString:@"id.comment.content.label"]) {+ NSAttributedString *text = [obj valueForKey:@"_attributedText"];+ resultText = text.string;+ break;+ }+ }+ }++ [queue addObjectsFromArray:current.subviews];+ }++ return resultText;+}++static UIImage *YouModRenderViewToImage(_ASDisplayView *view) {+ if (!view || view.bounds.size.width <= 0 || view.bounds.size.height <= 0) return nil;++ UIColor *realBgColor = isDarkMode(view) ? [%c(YTColor) black3] : [%c(YTColor) white1];+ UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, [UIScreen mainScreen].scale);+ CGContextRef context = UIGraphicsGetCurrentContext();+ [realBgColor setFill];+ CGContextFillRect(context, view.bounds);+ [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];++ UIImage *image = UIGraphicsGetImageFromCurrentImageContext();+ UIGraphicsEndImageContext();+ return image;+}++/*+static UIImage *YouModExtractPostImage(UIView *cellView) {+ NSMutableArray<UIView *> *queue = [NSMutableArray arrayWithObject:cellView];+ Class asDisplayClass = NSClassFromString(@"_ASDisplayView");+ Class imageZoomNodeClass = NSClassFromString(@"YTImageZoomNode");+ UIView *targetViewForRender = nil;++ while (queue.count > 0) {+ UIView *current = queue.firstObject;+ [queue removeObjectAtIndex:0];++ if (asDisplayClass && [current isKindOfClass:asDisplayClass]) {+ id node = [current performSelector:@selector(keepalive_node)];++ if (imageZoomNodeClass && [node isKindOfClass:imageZoomNodeClass]) {+ if (!targetViewForRender) {+ targetViewForRender = current;+ }+ }+ }++ @synchronized (current) {+ [queue addObjectsFromArray:current.subviews];+ }+ }++ if (targetViewForRender && targetViewForRender.bounds.size.width > 0 && targetViewForRender.bounds.size.height > 0) {+ UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:targetViewForRender.bounds.size];+ return [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) {+ [targetViewForRender.layer renderInContext:rendererContext.CGContext];+ }];+ }++ return nil;+}+*/++%hook _ASDisplayView++- (void)didMoveToWindow {+ %orig;+ if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_cell"] && IS_ENABLED(DownloadComment)) {+ BOOL hasGesture = NO;+ for (UIGestureRecognizer *g in self.gestureRecognizers) {+ if ([g.name isEqualToString:@"YouModCommentLongPress"]) {+ hasGesture = YES;+ break;+ }+ }++ if (!hasGesture) {+ UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(YouModHandleCommentLongPress:)];+ longPress.name = @"YouModCommentLongPress";+ longPress.minimumPressDuration = 0.3;+ [self addGestureRecognizer:longPress];+ }+ } else if ([self.accessibilityIdentifier isEqualToString:@"id.ui.backstage.original_post"] && IS_ENABLED(DownloadPost)) {+ BOOL hasGesture = NO;+ for (UIGestureRecognizer *g in self.gestureRecognizers) {+ if ([g.name isEqualToString:@"YouModPostLongPress"]) {+ hasGesture = YES;+ break;+ }+ }++ if (!hasGesture) {+ UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(YouModHandlePostLongPress:)];+ longPress.name = @"YouModPostLongPress";+ longPress.minimumPressDuration = 0.3;+ [self addGestureRecognizer:longPress];+ }+ }+}++%new+- (void)YouModHandleCommentLongPress:(UILongPressGestureRecognizer *)sender {+ if (sender.state != UIGestureRecognizerStateBegan) return;++ NSMutableArray *items = [NSMutableArray array];+ NSString *commentText = YouModExtractCommentText(self);++ if (commentText && commentText.length > 0) {+ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"TRANSLATE_COMMENT") subtitle:nil icon:YouModYTIconImage(897, NO, nil) handler:^{+ UIViewController *presenter = YouModPresenterForSender(self, nil);+ YouModShowTranslationDialog(commentText, presenter);+ }]];++ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"COPY_COMMENT_TEXT") subtitle:nil icon:YouModYTIconImage(243, NO, nil) handler:^{+ YouModCopyTextToPasteboard(commentText, @"COPIED_TO_CLIPBOARD");+ }]];+ }++ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"SAVE_COMMENT_IMAGE") subtitle:nil icon:YouModYTIconImage(367, NO, nil) handler:^{+ UIImage *image = YouModRenderViewToImage(self);+ if (image) {+ UIViewController *p = YouModPresenterForSender(self, nil);+ YouModHandlePostDownloadImage(image, p);+ }+ }]];++ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"COPY_COMMENT_IMAGE") subtitle:nil icon:YouModYTIconImage(208, NO, nil) handler:^{+ UIImage *image = YouModRenderViewToImage(self);+ if (image) {+ YouModCopyImageToPasteboard(image, @"COPIED_TO_CLIPBOARD");+ }+ }]];++ UIViewController *presenter = YouModPresenterForSender(self, nil);+ if (!presenter) return;++ YouModPresentMenu(nil, items, presenter, self);+}++%new+- (void)YouModHandlePostLongPress:(UILongPressGestureRecognizer *)sender {+ if (sender.state != UIGestureRecognizerStateBegan) return;++ NSMutableArray *items = [NSMutableArray array];+ NSString *commentText = YouModExtractCommentText(self);++ if (commentText && commentText.length > 0) {+ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"TRANSLATE_POST") subtitle:nil icon:YouModYTIconImage(897, NO, nil) handler:^{+ UIViewController *presenter = YouModPresenterForSender(self, nil);+ YouModShowTranslationDialog(commentText, presenter);+ }]];++ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"COPY_POST_TEXT") subtitle:nil icon:YouModYTIconImage(243, NO, nil) handler:^{+ YouModCopyTextToPasteboard(commentText, @"COPIED_TO_CLIPBOARD");+ }]];+ }++ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"SAVE_POST_IMAGE") subtitle:nil icon:YouModYTIconImage(367, NO, nil) handler:^{+ UIImage *image = YouModRenderViewToImage(self);+ if (image) {+ UIViewController *p = YouModPresenterForSender(self, nil);+ YouModHandlePostDownloadImage(image, p);+ }+ }]];++ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"COPY_POST_IMAGE") subtitle:nil icon:YouModYTIconImage(208, NO, nil) handler:^{+ UIImage *image = YouModRenderViewToImage(self);+ if (image) {+ YouModCopyImageToPasteboard(image, @"COPIED_TO_CLIPBOARD");+ }+ }]];++ /*+ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"SAVE_CURRENT_IMAGE") subtitle:nil icon:YouModYTIconImage(367, YES, [UIColor systemPurpleColor]) handler:^{+ UIImage *image = YouModExtractPostImage(self);+ if (image) {+ UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);+ YouModSendSuccess(LOC(@"SAVED_TO_PHOTOS"));+ }+ }]];++ [items addObject:[YouModMenuItem itemWithTitle:LOC(@"COPY_CURRENT_IMAGE") subtitle:nil icon:YouModYTIconImage(208, YES, [UIColor systemPurpleColor]) handler:^{+ UIImage *image = YouModExtractPostImage(self);+ if (image) {+ YouModCopyImageToPasteboard(image, @"COPIED_TO_CLIPBOARD");+ }+ }]];+ */++ UIViewController *presenter = YouModPresenterForSender(self, nil);+ if (!presenter) return;++ YouModPresentMenu(nil, items, presenter, self);+}++%new+- (void)YouModDownloadButtonTapped:(UITapGestureRecognizer *)sender {+ if (sender.state != UIGestureRecognizerStateEnded) return;+ UIViewController *presenter = YouModPresenterForSender(self, YouModCurrentPlayerViewController);+ YTPlayerViewController *player = YouModPlayerFromViewController(presenter);+ YouModShowDownloadManager(player, presenter, self, NO);+}++%end++%hook YTReelWatchPlaybackOverlayView++- (void)layoutSubviews {+ %orig;+ if (!IS_ENABLED(AddDownloadToShorts)) return;+ YTQTMButton *downloadBtn = (YTQTMButton *)[self viewWithTag:1501];+ if (!downloadBtn) {+ UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:20 weight:UIImageSymbolWeightMedium];+ UIImage *icon = [[UIImage systemImageNamed:@"arrow.down.circle" withConfiguration:config] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];+ downloadBtn = [%c(YTQTMButton) iconButton];+ [downloadBtn setImage:icon forState:UIControlStateNormal];+ downloadBtn.tintColor = [UIColor whiteColor];+ downloadBtn.exclusiveTouch = YES;+ downloadBtn.tag = 1501;+ [downloadBtn addTarget:self action:@selector(didTapYouModShortsDownload:) forControlEvents:UIControlEventTouchUpInside];+ [downloadBtn enableNewTouchFeedback];+ [self addSubview:downloadBtn];+ }+ CGFloat btnWidth = 64.0;+ CGFloat btnHeight = 60.0;+ YTReelElementAsyncComponentView *pov = nil;+ @try {+ pov = [self valueForKey:@"_playerOverlayView"];+ } @catch (...) {}+ YTReelElementAsyncComponentView *actionBar = [self valueForKey:@"_actionBarComponentView"];+ CGFloat X = actionBar.frame.origin.x;+ CGFloat Y = 0.0;+ if (pov == nil) {+ Y = actionBar.frame.origin.y - 76.0;+ btnHeight = btnHeight + 16.0;+ } else {+ Y = pov.frame.origin.y - 60.0;+ }+ downloadBtn.frame = CGRectMake(X, Y, btnWidth, btnHeight);+ [self bringSubviewToFront:downloadBtn];+}++%new+- (void)didTapYouModShortsDownload:(YTQTMButton *)button {+ YTShortsPlayerViewController *shortsPlayerView = (YTShortsPlayerViewController *)self._viewControllerForAncestor;+ YTPlayerViewController *player = (YTPlayerViewController *)shortsPlayerView.childViewControllers[0];+ UIViewController *presenter = YouModPresenterForSender(button, player);+ YouModShowDownloadManager(player, presenter, button, YES);+}++%end++%ctor {+ %init;+ YMOverlayButtonSpec *download = [[YMOverlayButtonSpec alloc] init];+ download.identifier = @"download.video";+ download.symbolName = @"arrow.down.circle";+ download.settingsSymbolName = @"arrow.down.circle";+ download.displayName = LOC(@"DOWNLOAD_BUTTON");+ download.tintColor = [UIColor whiteColor];+ download.sortOrder = 200;+ download.isVisible = ^BOOL(YTPlayerViewController *player) {+ return YMIsOverlayButtonEnabled(@"download.video");+ };+ download.onTap = ^(YTPlayerViewController *player, UIButton *button) {+ UIViewController *presenter = YouModPresenterForSender(button, player ?: YouModCurrentPlayerViewController);+ YTPlayerViewController *resolved = YouModPlayerFromViewController(presenter) ?: player ?: YouModCurrentPlayerViewController;+ YouModShowDownloadManager(resolved, presenter, button, NO);+ };+ YMRegisterOverlayButton(download);+}diff --git a/vendor/YouMod/Files/Download_FFmpeg.txt b/vendor/YouMod/Files/Download_FFmpeg.txtnew file mode 100644index 0000000..eccd24a--- /dev/null+++ b/vendor/YouMod/Files/Download_FFmpeg.txt@@ -0,0 +1,2390 @@+// HUGE thanks to @daisuke1227 for implementing all of this+#import "Headers.h"+#import <AVFoundation/AVFoundation.h>+#import <Photos/Photos.h>+#import <math.h>+#import <objc/message.h>+#import <objc/runtime.h>+#import <dlfcn.h>+#import <stdarg.h>+#import <stdlib.h>+#import <YouTubeHeader/YTDefaultSheetController.h>+#import <YouTubeHeader/YTIFormatStream.h>+#import <YouTubeHeader/YTIPlayerResponse.h>+#import <YouTubeHeader/YTPlayerResponse.h>+#import <YouTubeHeader/YTIVideoDetails.h>++@interface YTDefaultSheetController (YouModDownload)++ (instancetype)sheetControllerWithParentResponder:(id)parentResponder;+- (void)addAction:(YTActionSheetAction *)action;+- (void)presentFromView:(UIView *)view animated:(BOOL)animated completion:(void (^)(void))completion;+- (void)presentFromViewController:(UIViewController *)vc animated:(BOOL)animated completion:(void (^)(void))completion;+@end++@interface YTPlayerViewController (YouModDownload)+- (YTPlayerResponse *)contentPlayerResponse;+@end++@interface YTIPlayerResponse (YouModDownload)+- (id)streamingData;+@end++@interface YTIStreamingData : NSObject+- (NSArray *)adaptiveFormatsArray;+@end++@interface YTIFormatStream (YouModDownload)+- (NSString *)mimeType;+- (BOOL)hasContentLength;+- (unsigned long long)contentLength;+- (unsigned long long)approxDurationMs;+@end++@interface YTIVideoDetails (YouModDownload)+- (NSString *)title;+- (NSString *)author;+- (NSString *)shortDescription;+@end++static UIImage *YouModIconImage(NSInteger iconType) {+ YTIIcon *icon = [%c(YTIIcon) new];+ icon.iconType = iconType;+ UIImage *image = [icon iconImageWithColor:[UIColor labelColor]];+ return [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];+}++@interface YouModMenuItem : NSObject+@property (nonatomic, copy) NSString *title;+@property (nonatomic, copy) NSString *subtitle;+@property (nonatomic, strong) UIImage *iconImage;+@property (nonatomic, copy) void (^handler)(void);++ (instancetype)itemWithTitle:(NSString *)title subtitle:(NSString *)subtitle handler:(void (^)(void))handler;++ (instancetype)itemWithTitle:(NSString *)title subtitle:(NSString *)subtitle icon:(UIImage *)icon handler:(void (^)(void))handler;+@end++@implementation YouModMenuItem++ (instancetype)itemWithTitle:(NSString *)title subtitle:(NSString *)subtitle handler:(void (^)(void))handler {+ return [self itemWithTitle:title subtitle:subtitle icon:nil handler:handler];+}++ (instancetype)itemWithTitle:(NSString *)title subtitle:(NSString *)subtitle icon:(UIImage *)icon handler:(void (^)(void))handler {+ YouModMenuItem *item = [YouModMenuItem new];+ item.title = title;+ item.subtitle = subtitle;+ item.iconImage = icon;+ item.handler = handler;+ return item;+}+@end++@interface YouModMediaFormat : NSObject+@property (nonatomic, strong) id source;+@property (nonatomic, copy) NSString *urlString;+@property (nonatomic, copy) NSString *qualityLabel;+@property (nonatomic, copy) NSString *mimeType;+@property (nonatomic, copy) NSDictionary *httpHeaders;+@property (nonatomic, assign) unsigned long long contentLength;+@property (nonatomic, assign) unsigned long long durationMs;+@property (nonatomic, assign) NSInteger fps;+@property (nonatomic, assign) BOOL video;+@property (nonatomic, copy) NSString *languageCode;+@property (nonatomic, copy) NSString *languageName;+@property (nonatomic, assign) BOOL drcAudio;+@end++@implementation YouModMediaFormat+@end++@interface YouModAudioOutputFormat : NSObject+@property (nonatomic, copy) NSString *identifier;+@property (nonatomic, copy) NSString *title;+@property (nonatomic, copy) NSString *subtitle;+@property (nonatomic, copy) NSString *fileExtension;+@property (nonatomic, copy) NSArray <NSString *> *ffmpegArguments;+@property (nonatomic, assign) BOOL passthroughWhenCompatible;+@property (nonatomic, assign) BOOL supported;+@end++@implementation YouModAudioOutputFormat+@end++typedef void (^YouModFileDownloadCompletion)(NSURL *fileURL, NSError *error);+typedef void (^YouModMergeCompletion)(BOOL success, NSError *error);+typedef void (^YouModRangeDownloadProgress)(unsigned long long completedBytes);++@interface YouModDownloadChunk : NSObject+@property (nonatomic, assign) unsigned long long offset;+@property (nonatomic, assign) unsigned long long length;+@property (nonatomic, assign) NSUInteger attempts;+@end++@implementation YouModDownloadChunk+@end++@interface YouModRangeDownloader : NSObject+@property (nonatomic, strong) NSURL *url;+@property (nonatomic, strong) NSURL *destinationURL;+@property (nonatomic, copy) NSDictionary *httpHeaders;+@property (nonatomic, assign) unsigned long long expectedBytes;+@property (nonatomic, copy) YouModRangeDownloadProgress progress;+@property (nonatomic, copy) YouModFileDownloadCompletion completion;+@property (nonatomic, strong) NSURLSession *session;+@property (nonatomic, strong) NSFileHandle *fileHandle;+@property (nonatomic, strong) NSMutableArray <YouModDownloadChunk *> *pendingChunks;+@property (nonatomic, strong) NSMutableSet <NSURLSessionDataTask *> *tasks;+@property (nonatomic, strong) dispatch_queue_t stateQueue;+@property (nonatomic, strong) dispatch_queue_t fileQueue;+@property (nonatomic, assign) NSUInteger activeTaskCount;+@property (nonatomic, assign) NSUInteger totalChunkCount;+@property (nonatomic, assign) unsigned long long completedBytes;+@property (nonatomic, assign) BOOL cancelled;+@property (nonatomic, assign) BOOL finished;+- (instancetype)initWithURL:(NSURL *)url destinationURL:(NSURL *)destinationURL expectedBytes:(unsigned long long)expectedBytes headers:(NSDictionary *)headers progress:(YouModRangeDownloadProgress)progress completion:(YouModFileDownloadCompletion)completion;+- (void)start;+- (void)cancel;+@end++@interface YouModDownloadCoordinator : NSObject <NSURLSessionDownloadDelegate>+@property (nonatomic, strong) NSURLSession *session;+@property (nonatomic, strong) NSURLSessionDownloadTask *task;+@property (nonatomic, strong) NSURLSessionDataTask *metadataTask;+@property (nonatomic, strong) YouModRangeDownloader *rangeDownloader;+@property (nonatomic, strong) UIAlertController *progressAlert;+@property (nonatomic, strong) UIProgressView *progressView;+@property (nonatomic, weak) UIViewController *presenter;+@property (nonatomic, copy) YouModFileDownloadCompletion fileCompletion;+@property (nonatomic, strong) NSURL *destinationURL;+@property (nonatomic, strong) NSURL *videoTempURL;+@property (nonatomic, strong) NSURL *audioTempURL;+@property (nonatomic, assign) unsigned long long completedBytes;+@property (nonatomic, assign) unsigned long long totalBytes;+@property (nonatomic, assign) unsigned long long currentBytes;+@property (nonatomic, assign) unsigned long long currentExpectedBytes;+@property (nonatomic, assign) BOOL currentResolvedSizeAddedToTotal;+@property (nonatomic, assign) BOOL active;+@property (nonatomic, assign) BOOL finishedCurrentFile;+@property (nonatomic, assign) BOOL cancelled;+@property (nonatomic, copy) NSString *baseProgressTitle;+@property (nonatomic, assign) NSTimeInterval downloadStartTime;++ (instancetype)sharedCoordinator;+- (void)startVideoDownloadWithVideoFormat:(YouModMediaFormat *)videoFormat audioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName videoID:(NSString *)videoID presenter:(UIViewController *)presenter;+- (void)startAudioDownloadWithAudioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName videoID:(NSString *)videoID presenter:(UIViewController *)presenter;+- (void)startAudioDownloadWithAudioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName videoID:(NSString *)videoID outputFormat:(YouModAudioOutputFormat *)outputFormat presenter:(UIViewController *)presenter;+- (void)startDirectVideoDownloadWithVideoFormat:(YouModMediaFormat *)videoFormat audioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName videoID:(NSString *)videoID presenter:(UIViewController *)presenter;+- (void)startDirectSingleVideoDownloadWithFormat:(YouModMediaFormat *)format fileName:(NSString *)fileName videoID:(NSString *)videoID presenter:(UIViewController *)presenter;+- (void)startDirectAudioDownloadWithAudioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName videoID:(NSString *)videoID presenter:(UIViewController *)presenter;+- (void)startDirectAudioDownloadWithAudioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName videoID:(NSString *)videoID outputFormat:(YouModAudioOutputFormat *)outputFormat presenter:(UIViewController *)presenter;+- (void)mergeVideoURL:(NSURL *)videoURL audioURL:(NSURL *)audioURL fileName:(NSString *)fileName outputExtension:(NSString *)outputExtension durationMs:(unsigned long long)durationMs presenter:(UIViewController *)presenter;+- (void)mergeVideoWithAVFoundationVideoURL:(NSURL *)videoURL audioURL:(NSURL *)audioURL outputURL:(NSURL *)outputURL durationMs:(unsigned long long)durationMs presenter:(UIViewController *)presenter fallbackError:(NSError *)fallbackError;+- (void)trimSingleVideoURL:(NSURL *)inputURL outputURL:(NSURL *)outputURL durationMs:(unsigned long long)durationMs presenter:(UIViewController *)presenter;+- (void)convertAudioURL:(NSURL *)inputURL outputURL:(NSURL *)outputURL outputFormat:(YouModAudioOutputFormat *)outputFormat durationMs:(unsigned long long)durationMs presenter:(UIViewController *)presenter;+@end++static const unsigned long long YouModFastDownloadMinimumBytes = 256ULL * 1024ULL;+static const unsigned long long YouModFastDownloadChunkBytes = 4ULL * 1024ULL * 1024ULL;+static const NSUInteger YouModFastDownloadConcurrency = 8;+static const NSUInteger YouModFastDownloadMaxAttempts = 3;++static BOOL YouModHTTPHeadersContainField(NSDictionary *headers, NSString *field) {+ for (id key in headers) {+ if ([key isKindOfClass:NSString.class] && [(NSString *)key caseInsensitiveCompare:field] == NSOrderedSame)+ return YES;+ }+ return NO;+}++static NSString *YouModYouTubeCookiesString(void) {+ NSMutableArray *cookieStrings = [NSMutableArray array];+ for (NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) {+ if ([cookie.domain containsString:@"youtube.com"]) {+ [cookieStrings addObject:[NSString stringWithFormat:@"%@=%@", cookie.name, cookie.value]];+ }+ }+ return [cookieStrings componentsJoinedByString:@"; "];+}++static NSString *YouModNativeUserAgent(void) {+ NSString *version = @"21.18.4";+ NSString *sysVersion = [[UIDevice currentDevice].systemVersion stringByReplacingOccurrencesOfString:@"." withString:@"_"] ?: @"18_7";+ return [NSString stringWithFormat:@"com.google.ios.youtube/%@ (iPhone; CPU iPhone OS %@ like Mac OS X)", version, sysVersion];+}++static void YouModApplyDownloadHeaders(NSMutableURLRequest *request, NSDictionary *headers) {+ for (id key in headers) {+ id value = headers[key];+ if ([key isKindOfClass:NSString.class] && [value isKindOfClass:NSString.class])+ [request setValue:value forHTTPHeaderField:key];+ }+ if (!YouModHTTPHeadersContainField(headers, @"User-Agent"))+ [request setValue:YouModNativeUserAgent() forHTTPHeaderField:@"User-Agent"];+ if (!YouModHTTPHeadersContainField(headers, @"Origin"))+ [request setValue:@"https://www.youtube.com" forHTTPHeaderField:@"Origin"];+ if (!YouModHTTPHeadersContainField(headers, @"Referer"))+ [request setValue:@"https://www.youtube.com/" forHTTPHeaderField:@"Referer"];+ if (!YouModHTTPHeadersContainField(headers, @"Cookie")) {+ NSString *cookies = YouModYouTubeCookiesString();+ if (cookies.length > 0) [request setValue:cookies forHTTPHeaderField:@"Cookie"];+ }+ extern NSString *YouModGlobalAuthHeader;+ if (YouModGlobalAuthHeader && !YouModHTTPHeadersContainField(headers, @"Authorization")) {+ [request setValue:YouModGlobalAuthHeader forHTTPHeaderField:@"Authorization"];+ }+ [request setValue:@"identity" forHTTPHeaderField:@"Accept-Encoding"];+}++@implementation YouModRangeDownloader++- (instancetype)initWithURL:(NSURL *)url destinationURL:(NSURL *)destinationURL expectedBytes:(unsigned long long)expectedBytes headers:(NSDictionary *)headers progress:(YouModRangeDownloadProgress)progress completion:(YouModFileDownloadCompletion)completion {+ self = [super init];+ if (self) {+ _url = url;+ _destinationURL = destinationURL;+ _httpHeaders = [headers copy];+ _expectedBytes = expectedBytes;+ _progress = [progress copy];+ _completion = [completion copy];+ _pendingChunks = [NSMutableArray array];+ _tasks = [NSMutableSet set];+ _stateQueue = dispatch_queue_create("com.youmod.download.range.state", DISPATCH_QUEUE_SERIAL);+ _fileQueue = dispatch_queue_create("com.youmod.download.range.file", DISPATCH_QUEUE_SERIAL);++ NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];+ configuration.HTTPMaximumConnectionsPerHost = YouModFastDownloadConcurrency;+ configuration.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData;+ configuration.timeoutIntervalForResource = 300;+ NSMutableDictionary *additionalHeaders = [NSMutableDictionary dictionary];+ for (id key in headers) {+ id value = headers[key];+ if ([key isKindOfClass:NSString.class] && [value isKindOfClass:NSString.class])+ additionalHeaders[key] = value;+ }+ if (!YouModHTTPHeadersContainField(additionalHeaders, @"User-Agent"))+ additionalHeaders[@"User-Agent"] = YouModNativeUserAgent();+ if (!YouModHTTPHeadersContainField(additionalHeaders, @"Origin"))+ additionalHeaders[@"Origin"] = @"https://www.youtube.com";+ if (!YouModHTTPHeadersContainField(additionalHeaders, @"Referer"))+ additionalHeaders[@"Referer"] = @"https://www.youtube.com/";+ if (!YouModHTTPHeadersContainField(additionalHeaders, @"Cookie")) {+ NSString *cookies = YouModYouTubeCookiesString();+ if (cookies.length > 0) additionalHeaders[@"Cookie"] = cookies;+ }+ extern NSString *YouModGlobalAuthHeader;+ if (YouModGlobalAuthHeader && !YouModHTTPHeadersContainField(additionalHeaders, @"Authorization")) {+ additionalHeaders[@"Authorization"] = YouModGlobalAuthHeader;+ }+ additionalHeaders[@"Accept-Encoding"] = @"identity";+ configuration.HTTPAdditionalHeaders = additionalHeaders;+ _session = [NSURLSession sessionWithConfiguration:configuration];+ }+ return self;+}++- (NSError *)errorWithCode:(NSInteger)code message:(NSString *)message {+ return [NSError errorWithDomain:@"YouMod" code:code userInfo:@{NSLocalizedDescriptionKey: message ?: @"Download failed"}];+}++- (BOOL)prepareDestinationWithError:(NSError **)error {+ [NSFileManager.defaultManager removeItemAtURL:self.destinationURL error:nil];+ if (![NSFileManager.defaultManager createFileAtPath:self.destinationURL.path contents:nil attributes:nil]) {+ if (error) *error = [self errorWithCode:20 message:@"Cannot create file"];+ return NO;+ }++ self.fileHandle = [NSFileHandle fileHandleForWritingAtPath:self.destinationURL.path];+ if (!self.fileHandle) {+ if (error) *error = [self errorWithCode:21 message:@"Cannot open file"];+ return NO;+ }++ @try {+ [self.fileHandle truncateFileAtOffset:self.expectedBytes];+ } @catch (NSException *exception) {+ if (error) *error = [self errorWithCode:22 message:exception.reason ?: @"Cannot allocate file"];+ return NO;+ }+ return YES;+}++- (void)start {+ dispatch_async(self.stateQueue, ^{+ if (self.expectedBytes == 0) {+ [self finishWithErrorLocked:[self errorWithCode:23 message:@"Unknown stream size"]];+ return;+ }++ NSError *error = nil;+ if (![self prepareDestinationWithError:&error]) {+ [self finishWithErrorLocked:error];+ return;+ }++ unsigned long long chunkSize = self.expectedBytes / YouModFastDownloadConcurrency;+ if (chunkSize < 256ULL * 1024ULL) chunkSize = 256ULL * 1024ULL;+ if (chunkSize > YouModFastDownloadChunkBytes) chunkSize = YouModFastDownloadChunkBytes;++ for (unsigned long long offset = 0; offset < self.expectedBytes; offset += chunkSize) {+ YouModDownloadChunk *chunk = [YouModDownloadChunk new];+ chunk.offset = offset;+ unsigned long long remaining = self.expectedBytes - offset;+ chunk.length = remaining < chunkSize ? remaining : chunkSize;+ [self.pendingChunks addObject:chunk];+ }+ self.totalChunkCount = self.pendingChunks.count;+ [self scheduleChunksLocked];+ });+}++- (void)cancel {+ dispatch_async(self.stateQueue, ^{+ if (self.finished) return;+ self.cancelled = YES;+ self.finished = YES;+ for (NSURLSessionDataTask *task in self.tasks) [task cancel];+ [self.tasks removeAllObjects];+ [self.session invalidateAndCancel];+ dispatch_async(self.fileQueue, ^{+ @try {+ [self.fileHandle closeFile];+ } @catch (__unused NSException *exception) {+ }+ [NSFileManager.defaultManager removeItemAtURL:self.destinationURL error:nil];+ });+ });+}++- (void)scheduleChunksLocked {+ if (self.finished || self.cancelled) return;+ while (self.activeTaskCount < YouModFastDownloadConcurrency && self.pendingChunks.count > 0) {+ YouModDownloadChunk *chunk = self.pendingChunks.firstObject;+ [self.pendingChunks removeObjectAtIndex:0];+ [self startChunkLocked:chunk];+ }++ if (self.activeTaskCount == 0 && self.pendingChunks.count == 0) {+ [self finishSuccessfullyLocked];+ }+}++- (void)startChunkLocked:(YouModDownloadChunk *)chunk {+ unsigned long long end = chunk.offset + chunk.length - 1;+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:self.url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60.0];+ YouModApplyDownloadHeaders(request, self.httpHeaders);+ [request setValue:[NSString stringWithFormat:@"bytes=%llu-%llu", chunk.offset, end] forHTTPHeaderField:@"Range"];++ __weak typeof(self) weakSelf = self;+ __block NSURLSessionDataTask *task = nil;+ task = [self.session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self) return;+ [self completeChunk:chunk task:task data:data response:response error:error];+ }];+ [self.tasks addObject:task];+ self.activeTaskCount++;+ [task resume];+}++- (NSError *)validationErrorForChunk:(YouModDownloadChunk *)chunk data:(NSData *)data response:(NSURLResponse *)response error:(NSError *)error {+ if (error) return error;++ NSHTTPURLResponse *httpResponse = [response isKindOfClass:NSHTTPURLResponse.class] ? (NSHTTPURLResponse *)response : nil;+ NSInteger statusCode = httpResponse.statusCode;+ BOOL statusOK = statusCode == 206 || (self.totalChunkCount == 1 && statusCode == 200);+ if (httpResponse && !statusOK)+ return [self errorWithCode:24 message:@"Range request rejected by server"];++ if (data.length != chunk.length)+ return [self errorWithCode:25 message:@"Incomplete chunk"];++ return nil;+}++- (void)completeChunk:(YouModDownloadChunk *)chunk task:(NSURLSessionDataTask *)task data:(NSData *)data response:(NSURLResponse *)response error:(NSError *)error {+ dispatch_async(self.stateQueue, ^{+ if (self.activeTaskCount > 0) self.activeTaskCount--;+ if (task) [self.tasks removeObject:task];+ if (self.finished || self.cancelled) return;++ NSError *validationError = [self validationErrorForChunk:chunk data:data response:response error:error];+ if (validationError) {+ if (validationError.code == 24) {+ [self finishWithErrorLocked:validationError];+ return;+ }+ if (chunk.attempts + 1 < YouModFastDownloadMaxAttempts) {+ chunk.attempts++;+ [self.pendingChunks insertObject:chunk atIndex:0];+ [self scheduleChunksLocked];+ } else {+ [self finishWithErrorLocked:validationError];+ }+ return;+ }++ NSData *chunkData = [data copy];+ dispatch_async(self.fileQueue, ^{+ NSError *writeError = nil;+ @try {+ [self.fileHandle seekToFileOffset:chunk.offset];+ [self.fileHandle writeData:chunkData];+ } @catch (NSException *exception) {+ writeError = [self errorWithCode:26 message:exception.reason ?: @"Write failed"];+ }++ dispatch_async(self.stateQueue, ^{+ if (self.finished || self.cancelled) return;+ if (writeError) {+ [self finishWithErrorLocked:writeError];+ return;+ }++ self.completedBytes += chunkData.length;+ if (self.progress) {+ unsigned long long completed = self.completedBytes;+ dispatch_async(dispatch_get_main_queue(), ^{+ self.progress(completed);+ });+ }+ [self scheduleChunksLocked];+ });+ });+ });+}++- (void)finishSuccessfullyLocked {+ if (self.finished) return;+ self.finished = YES;+ [self.session finishTasksAndInvalidate];+ dispatch_async(self.fileQueue, ^{+ @try {+ [self.fileHandle closeFile];+ } @catch (__unused NSException *exception) {+ }+ dispatch_async(dispatch_get_main_queue(), ^{+ if (self.completion) self.completion(self.destinationURL, nil);+ });+ });+}++- (void)finishWithErrorLocked:(NSError *)error {+ if (self.finished) return;+ self.finished = YES;+ for (NSURLSessionDataTask *task in self.tasks) [task cancel];+ [self.tasks removeAllObjects];+ [self.session invalidateAndCancel];+ dispatch_async(self.fileQueue, ^{+ @try {+ [self.fileHandle closeFile];+ } @catch (__unused NSException *exception) {+ }+ [NSFileManager.defaultManager removeItemAtURL:self.destinationURL error:nil];+ dispatch_async(dispatch_get_main_queue(), ^{+ if (self.completion) self.completion(nil, error ?: [self errorWithCode:27 message:@"Download failed"]);+ });+ });+}++@end++static __weak YTPlayerViewController *YouModCurrentPlayerViewController;++void YouModDownloadSetCurrentPlayer(YTPlayerViewController *player) {+ YouModCurrentPlayerViewController = player;+}++static NSString *YouModStringFromSelector(id object, SEL selector) {+ if (!object) return nil;+ id value = nil;+ if ([object respondsToSelector:selector]) {+ value = ((id (*)(id, SEL))objc_msgSend)(object, selector);+ } else {+ @try {+ value = [object valueForKey:NSStringFromSelector(selector)];+ } @catch (__unused NSException *exception) {+ value = nil;+ }+ }+ if ([value isKindOfClass:NSString.class]) return value;+ if ([value isKindOfClass:NSURL.class]) return [(NSURL *)value absoluteString];+ if ([value respondsToSelector:@selector(stringValue)]) return [value stringValue];+ return [value respondsToSelector:@selector(description)] ? [value description] : nil;+}++static id YouModObjectFromSelector(id object, SEL selector) {+ if (!object) return nil;+ if ([object respondsToSelector:selector]) {+ return ((id (*)(id, SEL))objc_msgSend)(object, selector);+ }+ @try {+ return [object valueForKey:NSStringFromSelector(selector)];+ } @catch (__unused NSException *exception) {+ return nil;+ }+}++static unsigned long long YouModUnsignedLongLongFromSelector(id object, SEL selector) {+ if (!object) return 0;+ if ([object respondsToSelector:selector]) {+ return ((unsigned long long (*)(id, SEL))objc_msgSend)(object, selector);+ }+ @try {+ id value = [object valueForKey:NSStringFromSelector(selector)];+ if ([value respondsToSelector:@selector(unsignedLongLongValue)])+ return [value unsignedLongLongValue];+ } @catch (__unused NSException *exception) {+ }+ return 0;+}++static BOOL YouModBoolFromSelector(id object, SEL selector) {+ if (!object) return NO;+ if ([object respondsToSelector:selector]) {+ return ((BOOL (*)(id, SEL))objc_msgSend)(object, selector);+ }+ @try {+ id value = [object valueForKey:NSStringFromSelector(selector)];+ if ([value respondsToSelector:@selector(boolValue)])+ return [value boolValue];+ } @catch (__unused NSException *exception) {+ }+ return NO;+}++static NSInteger YouModIntegerFromSelector(id object, SEL selector) {+ if (!object) return 0;+ if ([object respondsToSelector:selector]) {+ return ((NSInteger (*)(id, SEL))objc_msgSend)(object, selector);+ }+ @try {+ id value = [object valueForKey:NSStringFromSelector(selector)];+ if ([value respondsToSelector:@selector(integerValue)])+ return [value integerValue];+ } @catch (__unused NSException *exception) {+ }+ return 0;+}++static UIViewController *YouModTopViewController(UIViewController *root) {+ if (!root) {+ UIWindow *keyWindow = nil;+ for (UIWindow *window in UIApplication.sharedApplication.windows) {+ if (window.isKeyWindow) {+ keyWindow = window;+ break;+ }+ }+ root = keyWindow.rootViewController;+ }+ while (root.presentedViewController) root = root.presentedViewController;+ if ([root isKindOfClass:UINavigationController.class])+ return YouModTopViewController(((UINavigationController *)root).topViewController);+ if ([root isKindOfClass:UITabBarController.class])+ return YouModTopViewController(((UITabBarController *)root).selectedViewController);+ return root;+}++static void YouModSendToast(NSString *message, id responder) {+ Class toastClass = NSClassFromString(@"YTToastResponderEvent");+ id event = [toastClass eventWithMessage:message firstResponder:responder ?: YouModTopViewController(nil)];+ if ([event respondsToSelector:@selector(send)]) {+ [event send];+ return;+ }++ UIViewController *presenter = YouModTopViewController([responder isKindOfClass:UIViewController.class] ? responder : nil);+ if (!presenter) return;+ UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:message preferredStyle:UIAlertControllerStyleAlert];+ [presenter presentViewController:alert animated:YES completion:^{+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{+ [alert dismissViewControllerAnimated:YES completion:nil];+ });+ }];+}++static NSString *YouModByteCount(unsigned long long bytes) {+ if (bytes == 0) return nil;+ NSByteCountFormatter *formatter = [NSByteCountFormatter new];+ formatter.countStyle = NSByteCountFormatterCountStyleFile;+ return [formatter stringFromByteCount:(long long)bytes];+}++static NSString *YouModGenerateCPN(void) {+ static NSString *const alphabet = @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";+ NSMutableString *nonce = [NSMutableString stringWithCapacity:16];+ for (NSUInteger i = 0; i < 16; i++)+ [nonce appendFormat:@"%C", [alphabet characterAtIndex:arc4random_uniform((uint32_t)alphabet.length)]];+ return nonce;+}++static NSString *YouModURLStringBypassingThrottle(NSString *urlString) {+ if (urlString.length == 0) return urlString;+ NSURLComponents *components = [NSURLComponents componentsWithString:urlString];+ if (components) {+ NSMutableArray *queryItems = [components.queryItems mutableCopy] ?: [NSMutableArray array];+ NSMutableArray *filtered = [NSMutableArray array];+ for (NSURLQueryItem *item in queryItems) {+ if (![item.name isEqualToString:@"n"])+ [filtered addObject:item];+ }+ BOOL hasRateBypass = NO;+ for (NSURLQueryItem *item in filtered) {+ if ([item.name isEqualToString:@"ratebypass"]) { hasRateBypass = YES; break; }+ }+ if (!hasRateBypass)+ [filtered addObject:[NSURLQueryItem queryItemWithName:@"ratebypass" value:@"yes"]];+ components.queryItems = filtered;+ NSString *result = components.string;+ if (result.length > 0) return result;+ }+ return urlString;+}++static NSString *YouModURLStringWithCPN(NSString *urlString) {+ if (urlString.length == 0) return urlString;+ urlString = YouModURLStringBypassingThrottle(urlString);+ if ([urlString containsString:@"cpn="]) return urlString;+ Class ytDataUtils = NSClassFromString(@"YTDataUtils");+ NSString *cpn = ((id (*)(Class, SEL))objc_msgSend)(ytDataUtils, @selector(generateClientSideNonce));+ if (![cpn isKindOfClass:NSString.class] || cpn.length == 0)+ cpn = YouModGenerateCPN();+ NSString *separator = [urlString containsString:@"?"] ? @"&" : @"?";+ return [NSString stringWithFormat:@"%@%@cpn=%@", urlString, separator, cpn];+}++static NSString *YouModSanitizedFileName(NSString *name) {+ if (name.length == 0) return @"YouTube Video";+ NSMutableCharacterSet *invalid = [NSMutableCharacterSet characterSetWithCharactersInString:@"/\\?%*|\"<>:"];+ [invalid formUnionWithCharacterSet:NSCharacterSet.newlineCharacterSet];+ NSArray *parts = [name componentsSeparatedByCharactersInSet:invalid];+ NSString *clean = [[parts componentsJoinedByString:@" "] stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];+ while ([clean containsString:@" "]) clean = [clean stringByReplacingOccurrencesOfString:@" " withString:@" "];+ if (clean.length > 120) clean = [clean substringToIndex:120];+ return clean.length ? clean : @"YouTube Video";+}++static NSURL *YouModDownloadsDirectoryURL(void) {+ NSURL *documentsURL = [NSFileManager.defaultManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask].firstObject;+ NSURL *downloadsURL = [documentsURL URLByAppendingPathComponent:@"YouMod Downloads" isDirectory:YES];+ [NSFileManager.defaultManager createDirectoryAtURL:downloadsURL withIntermediateDirectories:YES attributes:nil error:nil];+ return downloadsURL;+}++static NSString *YouModLastDownloadDiagnostic;++static NSURL *YouModDiagnosticLogURL(void) {+ return [YouModDownloadsDirectoryURL() URLByAppendingPathComponent:@"youmod-download-diagnostics.txt"];+}++static void YouModRecordDownloadDiagnostic(NSString *context, NSString *details) {+ if (context.length == 0 && details.length == 0) return;++ NSDateFormatter *formatter = [NSDateFormatter new];+ formatter.locale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"];+ formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss ZZZZZ";+ NSString *timestamp = [formatter stringFromDate:NSDate.date];+ NSString *entry = [NSString stringWithFormat:@"[%@]\n%@\n%@\n\n", timestamp ?: @"", context ?: @"", details ?: @""];+ YouModLastDownloadDiagnostic = entry;++ NSURL *logURL = YouModDiagnosticLogURL();+ NSData *data = [entry dataUsingEncoding:NSUTF8StringEncoding];+ if (![NSFileManager.defaultManager fileExistsAtPath:logURL.path])+ [NSFileManager.defaultManager createFileAtPath:logURL.path contents:nil attributes:nil];++ NSFileHandle *handle = [NSFileHandle fileHandleForWritingAtPath:logURL.path];+ if (!handle) return;+ @try {+ [handle seekToEndOfFile];+ [handle writeData:data];+ [handle closeFile];+ } @catch (__unused NSException *exception) {+ }+}++static NSString *YouModDownloadDiagnosticText(void) {+ if (YouModLastDownloadDiagnostic.length) return YouModLastDownloadDiagnostic;+ NSString *log = [NSString stringWithContentsOfURL:YouModDiagnosticLogURL() encoding:NSUTF8StringEncoding error:nil];+ if (log.length == 0) return nil;+ NSUInteger maxLength = 12000;+ return log.length > maxLength ? [log substringFromIndex:log.length - maxLength] : log;+}++static void YouModCopyDownloadDiagnostics(UIViewController *presenter) {+ NSString *diagnostic = YouModDownloadDiagnosticText();+ if (diagnostic.length == 0) {+ YouModSendToast(@"No download diagnostics yet.", presenter);+ return;+ }+ UIPasteboard.generalPasteboard.string = diagnostic;+ YouModSendToast(@"Copied download diagnostics", presenter);+}++static NSURL *YouModUniqueFileURL(NSString *fileName, NSString *extension) {+ NSString *safeName = YouModSanitizedFileName(fileName);+ NSURL *directoryURL = YouModDownloadsDirectoryURL();+ NSURL *candidate = [directoryURL URLByAppendingPathComponent:[safeName stringByAppendingPathExtension:extension]];+ NSUInteger index = 2;+ while ([NSFileManager.defaultManager fileExistsAtPath:candidate.path]) {+ NSString *indexed = [NSString stringWithFormat:@"%@ %lu", safeName, (unsigned long)index++];+ candidate = [directoryURL URLByAppendingPathComponent:[indexed stringByAppendingPathExtension:extension]];+ }+ return candidate;+}++static NSURL *YouModTemporaryFileURL(NSString *extension) {+ NSString *name = [[NSUUID UUID].UUIDString stringByAppendingPathExtension:extension];+ return [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:name]];+}++static NSInteger YouModResolutionFromQuality(NSString *quality);+static NSInteger YouModFPSFromQuality(NSString *quality);+static NSInteger YouModNormalizedFPS(NSInteger fps);+static NSInteger YouModDisplayHeightForVideoHeight(NSInteger height);+static NSString *YouModQualityLabel(NSInteger height, NSInteger fps, NSString *fallback);+static BOOL YouModFFmpegKitAvailable(void);++static unsigned long long YouModDurationMsForURL(NSURL *url) {+ AVURLAsset *asset = [AVURLAsset URLAssetWithURL:url options:nil];+ if (!CMTIME_IS_NUMERIC(asset.duration) || !CMTIME_IS_VALID(asset.duration)) return 0;+ Float64 seconds = CMTimeGetSeconds(asset.duration);+ if (!isfinite(seconds) || seconds <= 0.0) return 0;+ return (unsigned long long)llround(seconds * 1000.0);+}++static NSString *YouModDurationSecondsArgument(unsigned long long durationMs) {+ return [NSString stringWithFormat:@"%.3f", (double)durationMs / 1000.0];+}++static BOOL YouModCMTimeIsUsable(CMTime time) {+ if (!CMTIME_IS_VALID(time) || !CMTIME_IS_NUMERIC(time) || CMTIME_IS_INDEFINITE(time)) return NO;+ Float64 seconds = CMTimeGetSeconds(time);+ return isfinite(seconds) && seconds > 0.0;+}++static CMTime YouModMinUsableDuration(CMTime first, CMTime second) {+ BOOL firstOK = YouModCMTimeIsUsable(first);+ BOOL secondOK = YouModCMTimeIsUsable(second);+ if (firstOK && secondOK) return CMTIME_COMPARE_INLINE(first, <, second) ? first : second;+ if (firstOK) return first;+ if (secondOK) return second;+ return kCMTimeInvalid;+}++static CMTime YouModExportDuration(AVAsset *videoAsset, AVAsset *audioAsset, unsigned long long expectedDurationMs) {+ CMTime duration = kCMTimeInvalid;+ if (expectedDurationMs > 0)+ duration = CMTimeMakeWithSeconds((double)expectedDurationMs / 1000.0, 600);++ CMTime videoDuration = YouModMinUsableDuration(videoAsset.duration, [[videoAsset tracksWithMediaType:AVMediaTypeVideo] firstObject].timeRange.duration);+ CMTime audioDuration = audioAsset ? YouModMinUsableDuration(audioAsset.duration, [[audioAsset tracksWithMediaType:AVMediaTypeAudio] firstObject].timeRange.duration) : kCMTimeInvalid;+ CMTime mediaDuration = audioAsset ? YouModMinUsableDuration(videoDuration, audioDuration) : videoDuration;++ if (!YouModCMTimeIsUsable(duration)) return mediaDuration;+ if (YouModCMTimeIsUsable(mediaDuration) && CMTIME_COMPARE_INLINE(duration, >, mediaDuration))+ return mediaDuration;+ return duration;+}++static NSMutableArray <NSString *> *YouModFFmpegKitLoadEntries(void) {+ static NSMutableArray <NSString *> *entries = nil;+ static dispatch_once_t onceToken;+ dispatch_once(&onceToken, ^{+ entries = [NSMutableArray array];+ });+ return entries;+}++static void YouModAppendFFmpegKitLoadEntry(NSString *format, ...) {+ if (format.length == 0) return;++ va_list arguments;+ va_start(arguments, format);+ NSString *entry = [[NSString alloc] initWithFormat:format arguments:arguments];+ va_end(arguments);+ if (entry.length == 0) return;++ NSMutableArray <NSString *> *entries = YouModFFmpegKitLoadEntries();+ @synchronized(entries) {+ [entries addObject:entry];+ if (entries.count > 220)+ [entries removeObjectsInRange:NSMakeRange(0, entries.count - 220)];+ }+}++static NSArray <NSString *> *YouModFFmpegKitSearchDirectories(void) {+ NSMutableOrderedSet <NSString *> *directories = [NSMutableOrderedSet orderedSet];++ // Path to YouMod.bundle/Frameworks inside the main app bundle+ NSString *bundlePath = [[NSBundle.mainBundle resourcePath] stringByAppendingPathComponent:@"YouMod.bundle"];+ NSString *frameworksInsideBundle = [bundlePath stringByAppendingPathComponent:@"Frameworks"];++ // Safety check: only add if the directory actually exists+ BOOL isDir = NO;+ if ([[NSFileManager defaultManager] fileExistsAtPath:frameworksInsideBundle isDirectory:&isDir] && isDir) {+ [directories addObject:frameworksInsideBundle];+ }++ return directories.array;+}++static void YouModDlopenPath(NSString *path, BOOL requireExistingFile) {+ if (path.length == 0) return;+ if (requireExistingFile && ![NSFileManager.defaultManager fileExistsAtPath:path]) {+ YouModAppendFFmpegKitLoadEntry(@"missing %@", path);+ return;+ }++ dlerror();+ void *handle = dlopen(path.fileSystemRepresentation, RTLD_NOW | RTLD_GLOBAL);+ const char *error = dlerror();+ if (handle) {+ YouModAppendFFmpegKitLoadEntry(@"loaded %@", path);+ } else {+ YouModAppendFFmpegKitLoadEntry(@"failed %@\n dlerror=%@", path, error ? [NSString stringWithUTF8String:error] : @"unknown");+ }+}++static void YouModDlopenPathIfPresent(NSString *path) {+ YouModDlopenPath(path, YES);+}++static void YouModLoadFrameworkBinary(NSString *directory, NSString *frameworkName, NSString *binaryName) {+ if (directory.length == 0 || frameworkName.length == 0 || binaryName.length == 0) return;+ YouModDlopenPathIfPresent([[directory stringByAppendingPathComponent:[frameworkName stringByAppendingString:@".framework"]] stringByAppendingPathComponent:binaryName]);+ YouModDlopenPathIfPresent([[directory stringByAppendingPathComponent:[frameworkName stringByAppendingString:@".framework"]] stringByAppendingPathComponent:frameworkName]);+}++static void YouModLoadFFmpegKitIfNeeded(void) {+ static BOOL attempted = NO;+ if (NSClassFromString(@"FFmpegKit")) return;+ if (attempted) return;+ attempted = YES;++ YouModAppendFFmpegKitLoadEntry(@"[YouMod] Starting bundled FFmpegKit load...");++ // Order is important: load dependencies (avutil, etc.) before the main toolkit+ NSArray <NSArray <NSString *> *> *frameworks = @[+ @[@"libavutil", @"libavutil"],+ @[@"libswresample", @"libswresample"],+ @[@"libswscale", @"libswscale"],+ @[@"libavcodec", @"libavcodec"],+ @[@"libavformat", @"libavformat"],+ @[@"libavfilter", @"libavfilter"],+ @[@"libavdevice", @"libavdevice"],+ @[@"ffmpegkit", @"ffmpegkit"],+ @[@"FFmpegKit", @"FFmpegKit"],+ ];++ NSArray *searchDirs = YouModFFmpegKitSearchDirectories();+ if (searchDirs.count == 0) {+ YouModAppendFFmpegKitLoadEntry(@"[YouMod] Error: Bundled Frameworks directory not found.");+ return;+ }++ // Only iterate through our controlled bundle directory+ for (NSString *directory in searchDirs) {+ for (NSArray <NSString *> *framework in frameworks) {+ // This helper uses dlopen on the direct path within our bundle+ YouModLoadFrameworkBinary(directory, framework.firstObject, framework.lastObject);+ }++ if (NSClassFromString(@"FFmpegKit")) {+ YouModAppendFFmpegKitLoadEntry(@"[YouMod] Success: FFmpegKit loaded from bundle.");+ return;+ }+ }++ YouModAppendFFmpegKitLoadEntry(@"[YouMod] Critical: FFmpegKit could not be found in YouMod.bundle.");+}++static Class YouModFFmpegKitClass(void) {+ Class ffmpegKitClass = NSClassFromString(@"FFmpegKit");+ if (!ffmpegKitClass) {+ YouModLoadFFmpegKitIfNeeded();+ ffmpegKitClass = NSClassFromString(@"FFmpegKit");+ }+ return ffmpegKitClass;+}++static BOOL YouModFFmpegKitAvailable(void) {+ Class ffmpegKitClass = YouModFFmpegKitClass();+ return ffmpegKitClass && [ffmpegKitClass respondsToSelector:@selector(executeWithArgumentsAsync:withCompleteCallback:withLogCallback:withStatisticsCallback:)];+}++static NSString *YouModFFmpegKitDiagnosticText(YouModAudioOutputFormat *outputFormat, YouModMediaFormat *sourceFormat, NSString *videoID) {+ YouModLoadFFmpegKitIfNeeded();++ Class ffmpegKitClass = NSClassFromString(@"FFmpegKit");+ SEL executeSelector = @selector(executeWithArgumentsAsync:withCompleteCallback:withLogCallback:withStatisticsCallback:);+ NSMutableArray <NSString *> *lines = [NSMutableArray array];+ NSBundle *mainBundle = NSBundle.mainBundle;+ NSString *resourcePath = mainBundle.resourcePath ?: @"";+ NSString *privateFrameworksPath = mainBundle.privateFrameworksPath ?: @"";+ NSString *executablePath = mainBundle.executablePath ?: @"";+ NSString *bundlePath = [resourcePath stringByAppendingPathComponent:@"YouMod.bundle"];+ NSString *packageFrameworkPath = [resourcePath stringByAppendingPathComponent:@"YouMod.bundle/Frameworks"];++ [lines addObject:@"FFmpegKit lookup"];+ [lines addObject:[NSString stringWithFormat:@"videoID=%@", videoID ?: @""]];+ [lines addObject:[NSString stringWithFormat:@"requestedFormat=%@ (%@)", outputFormat.title ?: @"", outputFormat.identifier ?: @""]];+ [lines addObject:[NSString stringWithFormat:@"sourceMime=%@", sourceFormat.mimeType ?: @""]];+ [lines addObject:[NSString stringWithFormat:@"sourceQuality=%@", sourceFormat.qualityLabel ?: @""]];+ [lines addObject:[NSString stringWithFormat:@"sourceBytes=%llu", sourceFormat.contentLength]];+ [lines addObject:[NSString stringWithFormat:@"mainBundle=%@", mainBundle.bundlePath ?: @""]];+ [lines addObject:[NSString stringWithFormat:@"resourcePath=%@", resourcePath]];+ [lines addObject:[NSString stringWithFormat:@"privateFrameworksPath=%@", privateFrameworksPath]];+ [lines addObject:[NSString stringWithFormat:@"executablePath=%@", executablePath]];+ [lines addObject:[NSString stringWithFormat:@"YouMod.bundle exists=%@", [NSFileManager.defaultManager fileExistsAtPath:bundlePath] ? @"YES" : @"NO"]];+ [lines addObject:[NSString stringWithFormat:@"YouMod.bundle/Frameworks exists=%@", [NSFileManager.defaultManager fileExistsAtPath:packageFrameworkPath] ? @"YES" : @"NO"]];+ [lines addObject:[NSString stringWithFormat:@"FFmpegKit class=%@", ffmpegKitClass ? @"YES" : @"NO"]];+ [lines addObject:[NSString stringWithFormat:@"FFmpegKit execute selector=%@", [ffmpegKitClass respondsToSelector:executeSelector] ? @"YES" : @"NO"]];+ [lines addObject:[NSString stringWithFormat:@"ReturnCode class=%@", NSClassFromString(@"ReturnCode") ? @"YES" : @"NO"]];+ [lines addObject:@"searchDirectories:"];+ for (NSString *directory in YouModFFmpegKitSearchDirectories()) {+ BOOL isDirectory = NO;+ BOOL exists = [NSFileManager.defaultManager fileExistsAtPath:directory isDirectory:&isDirectory];+ [lines addObject:[NSString stringWithFormat:@" %@ exists=%@ directory=%@", directory, exists ? @"YES" : @"NO", isDirectory ? @"YES" : @"NO"]];+ }++ NSMutableArray <NSString *> *entries = YouModFFmpegKitLoadEntries();+ [lines addObject:@"dlopenAttempts:"];+ @synchronized(entries) {+ [lines addObjectsFromArray:entries];+ }+ return [lines componentsJoinedByString:@"\n"];+}++static void YouModCancelFFmpegKit(void) {+ Class ffmpegKitClass = YouModFFmpegKitClass();+ if ([ffmpegKitClass respondsToSelector:@selector(cancel)])+ ((void (*)(Class, SEL))objc_msgSend)(ffmpegKitClass, @selector(cancel));+}++static NSError *YouModFFmpegErrorFromSession(id session) {+ NSString *failure = YouModStringFromSelector(session, @selector(getFailStackTrace));+ NSString *message = failure.length ? failure : @"FFmpeg failed";+ return [NSError errorWithDomain:@"YouMod" code:7 userInfo:@{NSLocalizedDescriptionKey: message}];+}++static BOOL YouModPathExtensionIsPhotosVideo(NSString *extension) {+ NSString *lower = extension.lowercaseString ?: @"";+ return [@[@"mp4", @"m4v", @"mov"] containsObject:lower];+}++static BOOL YouModStartFFmpegKitMerge(NSURL *videoURL, NSURL *audioURL, NSURL *outputURL, unsigned long long durationMs, void (^progress)(float progress), YouModMergeCompletion completion) {+ Class ffmpegKitClass = YouModFFmpegKitClass();+ SEL executeSelector = @selector(executeWithArgumentsAsync:withCompleteCallback:withLogCallback:withStatisticsCallback:);+ if (![ffmpegKitClass respondsToSelector:executeSelector]) return NO;++ NSMutableArray *arguments = [@[+ @"-y",+ @"-i", videoURL.path,+ @"-i", audioURL.path,+ @"-map", @"0:v:0",+ @"-map", @"1:a:0",+ ] mutableCopy];+ if (durationMs > 0)+ [arguments addObjectsFromArray:@[@"-t", YouModDurationSecondsArgument(durationMs)]];+ [arguments addObjectsFromArray:@[+ @"-c", @"copy",+ @"-shortest",+ @"-avoid_negative_ts", @"make_zero",+ ]];+ if (YouModPathExtensionIsPhotosVideo(outputURL.pathExtension))+ [arguments addObjectsFromArray:@[@"-movflags", @"+faststart"]];+ [arguments addObject:outputURL.path];++ id completeBlock = [^(id session) {+ Class returnCodeClass = NSClassFromString(@"ReturnCode");+ id returnCode = YouModObjectFromSelector(session, @selector(getReturnCode));+ BOOL success = NO;+ if ([returnCodeClass respondsToSelector:@selector(isSuccess:)])+ success = ((BOOL (*)(Class, SEL, id))objc_msgSend)(returnCodeClass, @selector(isSuccess:), returnCode);++ NSError *error = success ? nil : YouModFFmpegErrorFromSession(session);+ dispatch_async(dispatch_get_main_queue(), ^{+ if (success && [NSFileManager.defaultManager fileExistsAtPath:outputURL.path]) {+ completion(YES, nil);+ } else {+ completion(NO, error ?: [NSError errorWithDomain:@"YouMod" code:7 userInfo:@{NSLocalizedDescriptionKey: @"Merge failed"}]);+ }+ });+ } copy];++ id statisticsBlock = durationMs ? [^(id statistics) {+ if (!progress || ![statistics respondsToSelector:@selector(getTime)]) return;+ double timeMs = ((double (*)(id, SEL))objc_msgSend)(statistics, @selector(getTime));+ if (!isfinite(timeMs) || timeMs <= 0.0) return;+ float mergeProgress = 0.985f + (0.01f * fminf((float)(timeMs / (double)durationMs), 1.0f));+ dispatch_async(dispatch_get_main_queue(), ^{+ progress(mergeProgress);+ });+ } copy] : nil;++ ((id (*)(Class, SEL, NSArray *, id, id, id))objc_msgSend)(ffmpegKitClass, executeSelector, arguments, completeBlock, nil, statisticsBlock);+ return YES;+}++static BOOL YouModStartFFmpegKitAudioConvert(NSURL *inputURL, NSURL *outputURL, YouModAudioOutputFormat *outputFormat, unsigned long long durationMs, void (^progress)(float progress), YouModMergeCompletion completion) {+ Class ffmpegKitClass = YouModFFmpegKitClass();+ SEL executeSelector = @selector(executeWithArgumentsAsync:withCompleteCallback:withLogCallback:withStatisticsCallback:);+ if (![ffmpegKitClass respondsToSelector:executeSelector] || outputFormat.ffmpegArguments.count == 0) return NO;++ NSMutableArray *arguments = [@[@"-y", @"-i", inputURL.path] mutableCopy];+ [arguments addObjectsFromArray:outputFormat.ffmpegArguments];+ [arguments addObject:outputURL.path];++ id completeBlock = [^(id session) {+ Class returnCodeClass = NSClassFromString(@"ReturnCode");+ id returnCode = YouModObjectFromSelector(session, @selector(getReturnCode));+ BOOL success = NO;+ if ([returnCodeClass respondsToSelector:@selector(isSuccess:)])+ success = ((BOOL (*)(Class, SEL, id))objc_msgSend)(returnCodeClass, @selector(isSuccess:), returnCode);++ NSError *error = success ? nil : YouModFFmpegErrorFromSession(session);+ dispatch_async(dispatch_get_main_queue(), ^{+ if (success && [NSFileManager.defaultManager fileExistsAtPath:outputURL.path]) {+ completion(YES, nil);+ } else {+ completion(NO, error ?: [NSError errorWithDomain:@"YouMod" code:13 userInfo:@{NSLocalizedDescriptionKey: @"Conversion failed"}]);+ }+ });+ } copy];++ id statisticsBlock = durationMs ? [^(id statistics) {+ if (!progress || ![statistics respondsToSelector:@selector(getTime)]) return;+ double timeMs = ((double (*)(id, SEL))objc_msgSend)(statistics, @selector(getTime));+ if (!isfinite(timeMs) || timeMs <= 0.0) return;+ float convertProgress = 0.985f + (0.01f * fminf((float)(timeMs / (double)durationMs), 1.0f));+ dispatch_async(dispatch_get_main_queue(), ^{+ progress(convertProgress);+ });+ } copy] : nil;++ ((id (*)(Class, SEL, NSArray *, id, id, id))objc_msgSend)(ffmpegKitClass, executeSelector, arguments, completeBlock, nil, statisticsBlock);+ return YES;+}++static NSString *YouModMimeDetail(NSString *mimeType) {+ NSString *lower = mimeType.lowercaseString ?: @"";+ if ([lower containsString:@"mp4"]) return @"MP4";+ if ([lower containsString:@"webm"]) return @"WebM";+ if ([lower containsString:@"mp3"]) return @"MP3";+ if ([lower containsString:@"aac"]) return @"AAC";+ return mimeType.length ? mimeType : @"Stream";+}++static NSString *YouModFileExtensionForFormat(YouModMediaFormat *format, NSString *fallbackExtension) {+ NSString *lower = format.mimeType.lowercaseString ?: @"";+ if ([lower containsString:@"webm"]) return @"webm";+ if ([lower containsString:@"matroska"]) return @"mkv";+ if ([lower containsString:@"quicktime"]) return @"mov";+ if ([lower containsString:@"m4a"]) return @"m4a";+ if ([lower containsString:@"mp4"]) return @"mp4";+ return fallbackExtension ?: @"mp4";+}++static BOOL YouModFormatLooksMP4Family(YouModMediaFormat *format) {+ NSString *mime = format.mimeType.lowercaseString ?: @"";+ NSString *extension = YouModFileExtensionForFormat(format, @"").lowercaseString ?: @"";+ return [mime containsString:@"mp4"] || [mime containsString:@"m4a"] || [mime containsString:@"quicktime"] || [@[@"mp4", @"m4a", @"m4v", @"mov"] containsObject:extension];+}++static BOOL YouModFormatLooksWebM(YouModMediaFormat *format) {+ NSString *mime = format.mimeType.lowercaseString ?: @"";+ NSString *extension = YouModFileExtensionForFormat(format, @"").lowercaseString ?: @"";+ return [mime containsString:@"webm"] || [extension isEqualToString:@"webm"];+}++static NSString *YouModMergedVideoOutputExtension(YouModMediaFormat *videoFormat, YouModMediaFormat *audioFormat) {+ if (YouModFormatLooksMP4Family(videoFormat) && YouModFormatLooksMP4Family(audioFormat)) return @"mp4";+ if (YouModFormatLooksWebM(videoFormat) && YouModFormatLooksWebM(audioFormat)) return @"webm";+ return @"mkv";+}++static BOOL YouModVideoFileCanUseAVFoundation(NSURL *fileURL) {+ return YouModPathExtensionIsPhotosVideo(fileURL.pathExtension);+}++static BOOL YouModVideoFileCanSaveToPhotos(NSURL *fileURL) {+ return YouModPathExtensionIsPhotosVideo(fileURL.pathExtension);+}++static YouModAudioOutputFormat *YouModAudioOutputFormatMake(NSString *identifier, NSString *title, NSString *subtitle, NSString *fileExtension, NSArray <NSString *> *ffmpegArguments, BOOL passthroughWhenCompatible, BOOL supported) {+ YouModAudioOutputFormat *format = [YouModAudioOutputFormat new];+ format.identifier = identifier;+ format.title = title;+ format.subtitle = subtitle;+ format.fileExtension = fileExtension;+ format.ffmpegArguments = ffmpegArguments;+ format.passthroughWhenCompatible = passthroughWhenCompatible;+ format.supported = supported;+ return format;+}++static NSArray <YouModAudioOutputFormat *> *YouModAudioOutputFormats(void) {+ static NSArray <YouModAudioOutputFormat *> *formats = nil;+ static dispatch_once_t onceToken;+ dispatch_once(&onceToken, ^{+ formats = @[+ YouModAudioOutputFormatMake(@"m4a", @"M4A", @"AAC container, passthrough when possible", @"m4a", @[@"-map", @"0:a:0", @"-vn", @"-c:a", @"aac", @"-b:a", @"192k", @"-movflags", @"+faststart"], YES, YES),+ YouModAudioOutputFormatMake(@"aac", @"AAC", @"Lossy (192k)", @"aac", @[@"-map", @"0:a:0", @"-vn", @"-c:a", @"aac", @"-b:a", @"192k", @"-f", @"adts"], YES, YES),+ YouModAudioOutputFormatMake(@"mp3", @"MP3", @"Lossy, widely compatible", @"mp3", @[@"-map", @"0:a:0", @"-vn", @"-c:a", @"libmp3lame", @"-q:a", @"2"], NO, YES),+ YouModAudioOutputFormatMake(@"opus", @"Opus", @"Lossy, small file size", @"opus", @[@"-map", @"0:a:0", @"-vn", @"-c:a", @"libopus", @"-b:a", @"160k", @"-vbr", @"on"], NO, YES),+ YouModAudioOutputFormatMake(@"ogg", @"OGG", @"Vorbis lossy", @"ogg", @[@"-map", @"0:a:0", @"-vn", @"-c:a", @"libvorbis", @"-q:a", @"6"], NO, YES),+ YouModAudioOutputFormatMake(@"flac", @"FLAC", @"Lossless compressed", @"flac", @[@"-map", @"0:a:0", @"-vn", @"-c:a", @"flac", @"-compression_level", @"8"], NO, YES),+ YouModAudioOutputFormatMake(@"alac", @"ALAC", @"Apple lossless (M4A)", @"m4a", @[@"-map", @"0:a:0", @"-vn", @"-c:a", @"alac", @"-movflags", @"+faststart"], NO, YES),+ YouModAudioOutputFormatMake(@"wav", @"WAV", @"Uncompressed PCM", @"wav", @[@"-map", @"0:a:0", @"-vn", @"-c:a", @"pcm_s24le"], NO, YES),+ YouModAudioOutputFormatMake(@"aiff", @"AIFF", @"Apple PCM", @"aiff", @[@"-map", @"0:a:0", @"-vn", @"-c:a", @"pcm_s24be"], NO, YES),+ ];+ });+ return formats;+}++static YouModAudioOutputFormat *YouModDefaultAudioOutputFormat(void) {+ return [YouModAudioOutputFormats() firstObject];+}++static BOOL YouModAudioOutputFormatCanPassthrough(YouModAudioOutputFormat *outputFormat, YouModMediaFormat *sourceFormat) {+ if (!outputFormat.passthroughWhenCompatible) return NO;+ NSString *identifier = outputFormat.identifier.lowercaseString ?: @"";+ NSString *mime = sourceFormat.mimeType.lowercaseString ?: @"";+ NSString *extension = YouModFileExtensionForFormat(sourceFormat, @"").lowercaseString ?: @"";+ if ([identifier isEqualToString:@"m4a"] || [identifier isEqualToString:@"aac"])+ return [extension isEqualToString:@"m4a"] || [mime containsString:@"mp4"] || [mime containsString:@"m4a"];+ return NO;+}++static NSString *YouModAudioOutputFileExtension(YouModAudioOutputFormat *outputFormat, YouModMediaFormat *sourceFormat, BOOL passthrough) {+ NSString *identifier = outputFormat.identifier.lowercaseString ?: @"";+ NSString *mime = sourceFormat.mimeType.lowercaseString ?: @"";+ if (passthrough && ([identifier isEqualToString:@"m4a"] || [identifier isEqualToString:@"aac"]) && ([mime containsString:@"mp4"] || [mime containsString:@"m4a"]))+ return @"m4a";+ return outputFormat.fileExtension ?: YouModFileExtensionForFormat(sourceFormat, @"m4a");+}++static NSString *YouModAudioOutputSubtitle(YouModAudioOutputFormat *outputFormat) {+ return [NSString stringWithFormat:@"%@", outputFormat.subtitle];+}++static NSString *YouModFormatSubtitle(YouModMediaFormat *format) {+ NSMutableArray *parts = [NSMutableArray array];+ NSString *language = format.languageName.length ? format.languageName : format.languageCode;+ if (language.length) [parts addObject:language];+ if (format.drcAudio) [parts addObject:@"DRC"];+ NSString *detail = YouModMimeDetail(format.mimeType);+ if (detail.length) [parts addObject:detail];+ NSString *size = YouModByteCount(format.contentLength);+ if (size.length) [parts addObject:size];+ return [parts componentsJoinedByString:@" - "];+}++static NSString *YouModVideoIDForPlayer(YTPlayerViewController *player) {+ NSString *videoID = [player contentVideoID];+ if (videoID.length == 0)+ videoID = [player currentVideoID];+ return videoID;+}++static NSArray *YouModPlayerResponsesForPlayer(YTPlayerViewController *player) {+ NSMutableArray *responses = [NSMutableArray array];+ id response = YouModObjectFromSelector(player, @selector(contentPlayerResponse));+ if (response) [responses addObject:response];++ id activeVideo = YouModObjectFromSelector(player, @selector(activeVideo));+ response = YouModObjectFromSelector(activeVideo, @selector(contentPlayerResponse));+ if (response && ![responses containsObject:response]) [responses addObject:response];+ return responses.copy;+}++// Where is this going to?+static NSArray *YouModCaptionTracksForPlayer(YTPlayerViewController *player) {+ for (id response in YouModPlayerResponsesForPlayer(player)) {+ id playerData = YouModObjectFromSelector(response, @selector(playerData)) ?: response;+ id captions = YouModObjectFromSelector(playerData, @selector(captions));+ id tracklistRenderer = YouModObjectFromSelector(captions, @selector(playerCaptionsTracklistRenderer));+ NSArray *tracks = YouModObjectFromSelector(tracklistRenderer, @selector(captionTracksArray));+ if (tracks.count > 0) return tracks;+ }+ return nil;+}++static id YouModPlayerDataForPlayer(YTPlayerViewController *player) {+ id response = YouModPlayerResponsesForPlayer(player).firstObject;+ id playerData = YouModObjectFromSelector(response, @selector(playerData));+ return playerData ?: response;+}++static NSString *YouModTitleForPlayer(YTPlayerViewController *player) {+ id playerData = YouModPlayerDataForPlayer(player);+ id details = YouModObjectFromSelector(playerData, @selector(videoDetails));+ NSString *title = YouModStringFromSelector(details, @selector(title));+ NSString *author = YouModStringFromSelector(details, @selector(author));+ if (author.length && title.length) {+ return [NSString stringWithFormat:@"%@ - %@", author, title];+ } else if (title.length) {+ return title;+ }+ NSString *videoID = YouModVideoIDForPlayer(player);+ return videoID.length ? [NSString stringWithFormat:@"YouTube %@", videoID] : @"YouTube Video";+}++static NSArray *YouModAdaptiveFormatObjectsForPlayer(YTPlayerViewController *player) {+ NSMutableArray *formats = [NSMutableArray array];+ NSMutableSet *seenPointers = [NSMutableSet set];++ void (^appendFormats)(NSArray *) = ^(NSArray *candidateFormats) {+ if (![candidateFormats isKindOfClass:NSArray.class]) return;+ for (id format in candidateFormats) {+ NSString *key = [NSString stringWithFormat:@"%p", format];+ if ([seenPointers containsObject:key]) continue;+ [seenPointers addObject:key];+ [formats addObject:format];+ }+ };++ id activeVideo = YouModObjectFromSelector(player, @selector(activeVideo));+ id streamingData = YouModObjectFromSelector(activeVideo, @selector(streamingData));+ appendFormats(YouModObjectFromSelector(streamingData, @selector(adaptiveStreams)));+ appendFormats(YouModObjectFromSelector(activeVideo, @selector(selectableVideoFormats)));++ for (id response in YouModPlayerResponsesForPlayer(player)) {+ id playerData = YouModObjectFromSelector(response, @selector(playerData)) ?: response;+ id responseStreamingData = YouModObjectFromSelector(playerData, @selector(streamingData));+ appendFormats(YouModObjectFromSelector(responseStreamingData, @selector(adaptiveFormatsArray)));+ }++ return formats.copy;+}++static YouModMediaFormat *YouModMediaFormatFromStream(id stream, BOOL video) {+ id formatStream = YouModObjectFromSelector(stream, @selector(formatStream));+ NSString *url = YouModStringFromSelector(stream, @selector(URL));+ if (url.length == 0) url = YouModStringFromSelector(formatStream, @selector(URL));+ if (url.length == 0) url = YouModStringFromSelector(stream, @selector(url));+ if (url.length == 0) url = YouModStringFromSelector(formatStream, @selector(url));+ if (url.length == 0) return nil;++ NSString *mimeType = YouModStringFromSelector(stream, @selector(mimeType));+ if (mimeType.length == 0) mimeType = YouModStringFromSelector(formatStream, @selector(mimeType));+ NSString *lowerMime = mimeType.lowercaseString ?: @"";+ BOOL streamSaysVideo = YouModBoolFromSelector(stream, @selector(isVideo)) || YouModBoolFromSelector(formatStream, @selector(isVideo));+ BOOL streamSaysAudio = YouModBoolFromSelector(stream, @selector(isAudio)) || YouModBoolFromSelector(formatStream, @selector(isAudio));+ NSInteger itag = YouModIntegerFromSelector(stream, @selector(itag));+ if (itag == 0) itag = YouModIntegerFromSelector(formatStream, @selector(itag));++ NSSet *mp4VideoItags = [NSSet setWithObjects:@18, @22, @37, @38, @59, @78, @133, @134, @135, @136, @137, @160, @212, @264, @266, @298, @299, nil];+ NSSet *m4aAudioItags = [NSSet setWithObjects:@139, @140, @141, @256, @258, @325, @328, nil];+ BOOL itagMatches = video ? [mp4VideoItags containsObject:@(itag)] : [m4aAudioItags containsObject:@(itag)];+ BOOL typeMatches = video ? ([lowerMime containsString:@"video/"] || streamSaysVideo || itagMatches) : ([lowerMime containsString:@"audio/"] || streamSaysAudio || itagMatches);+ if (!typeMatches) return nil;++ BOOL mimeLooksMP4 = [lowerMime containsString:@"mp4"] || [lowerMime containsString:@"m4a"];+ BOOL canRemuxWithFFmpeg = YouModFFmpegKitAvailable();+ if (mimeType.length && !mimeLooksMP4 && !itagMatches && !canRemuxWithFFmpeg) return nil;++ YouModMediaFormat *format = [YouModMediaFormat new];+ format.source = stream;+ format.video = video;+ format.urlString = YouModURLStringWithCPN(url);+ format.mimeType = mimeType.length ? mimeType : (video ? @"video/mp4" : @"audio/mp4");+ NSInteger height = YouModIntegerFromSelector(stream, @selector(height));+ if (height == 0) height = YouModIntegerFromSelector(formatStream, @selector(height));+ NSInteger fps = YouModIntegerFromSelector(stream, @selector(fps));+ if (fps == 0) fps = YouModIntegerFromSelector(formatStream, @selector(fps));+ if (fps == 0) fps = YouModIntegerFromSelector(stream, @selector(framesPerSecond));+ if (fps == 0) fps = YouModIntegerFromSelector(formatStream, @selector(framesPerSecond));+ if (fps == 0) fps = YouModIntegerFromSelector(stream, @selector(frameRate));+ if (fps == 0) fps = YouModIntegerFromSelector(formatStream, @selector(frameRate));+ fps = YouModNormalizedFPS(fps);+ format.fps = fps;+ format.qualityLabel = YouModStringFromSelector(stream, @selector(qualityLabel));+ if (format.qualityLabel.length == 0) format.qualityLabel = YouModStringFromSelector(formatStream, @selector(qualityLabel));+ if (video) {+ NSInteger labelHeight = YouModResolutionFromQuality(format.qualityLabel);+ NSInteger labelFPS = YouModFPSFromQuality(format.qualityLabel);+ if (labelHeight == 960) format.qualityLabel = YouModQualityLabel(labelHeight, fps ?: labelFPS, nil);+ else if (labelFPS == 0 && fps > 0) format.qualityLabel = YouModQualityLabel(height, fps, format.qualityLabel);+ if (format.qualityLabel.length == 0) format.qualityLabel = YouModQualityLabel(height, fps, nil);+ }+ if (format.qualityLabel.length == 0 && !video) format.qualityLabel = @"Audio";+ if (!video) {+ NSString *languageCode = YouModStringFromSelector(stream, @selector(languageCode));+ if (languageCode.length == 0) languageCode = YouModStringFromSelector(formatStream, @selector(languageCode));+ if (languageCode.length == 0) languageCode = YouModStringFromSelector(stream, @selector(language));+ if (languageCode.length == 0) languageCode = YouModStringFromSelector(formatStream, @selector(language));+ format.languageCode = languageCode;++ NSString *languageName = YouModStringFromSelector(stream, @selector(languageName));+ if (languageName.length == 0) languageName = YouModStringFromSelector(formatStream, @selector(languageName));+ if (languageName.length == 0) languageName = YouModStringFromSelector(stream, @selector(displayName));+ if (languageName.length == 0) languageName = YouModStringFromSelector(formatStream, @selector(displayName));+ format.languageName = languageName.length ? languageName : languageCode;++ NSMutableArray *audioTraits = [NSMutableArray array];+ for (NSString *value in @[+ mimeType ?: @"",+ format.qualityLabel ?: @"",+ YouModStringFromSelector(stream, @selector(audioTrack)) ?: @"",+ YouModStringFromSelector(formatStream, @selector(audioTrack)) ?: @"",+ YouModStringFromSelector(stream, @selector(audioTrackType)) ?: @"",+ YouModStringFromSelector(formatStream, @selector(audioTrackType)) ?: @"",+ YouModStringFromSelector(stream, @selector(audioTrackDisplayName)) ?: @"",+ YouModStringFromSelector(formatStream, @selector(audioTrackDisplayName)) ?: @"",+ ]) {+ if (value.length) [audioTraits addObject:value];+ }+ format.drcAudio = [[audioTraits componentsJoinedByString:@" "] localizedCaseInsensitiveContainsString:@"drc"];+ }+ if (YouModBoolFromSelector(stream, @selector(hasContentLength)) || [stream respondsToSelector:@selector(contentLength)])+ format.contentLength = YouModUnsignedLongLongFromSelector(stream, @selector(contentLength));+ if (format.contentLength == 0 && (YouModBoolFromSelector(formatStream, @selector(hasContentLength)) || [formatStream respondsToSelector:@selector(contentLength)]))+ format.contentLength = YouModUnsignedLongLongFromSelector(formatStream, @selector(contentLength));+ format.durationMs = YouModUnsignedLongLongFromSelector(stream, @selector(approxDurationMs));+ if (format.durationMs == 0) format.durationMs = YouModUnsignedLongLongFromSelector(formatStream, @selector(approxDurationMs));++ NSMutableDictionary *headers = [NSMutableDictionary dictionary];+ NSDictionary *streamHeaders = YouModObjectFromSelector(stream, @selector(httpHeaders));+ if (![streamHeaders isKindOfClass:NSDictionary.class]) streamHeaders = YouModObjectFromSelector(formatStream, @selector(httpHeaders));+ if (![streamHeaders isKindOfClass:NSDictionary.class]) streamHeaders = YouModObjectFromSelector(stream, @selector(headers));+ if (![streamHeaders isKindOfClass:NSDictionary.class]) streamHeaders = YouModObjectFromSelector(formatStream, @selector(headers));+ if ([streamHeaders isKindOfClass:NSDictionary.class]) {+ for (id key in streamHeaders) {+ id value = streamHeaders[key];+ if ([key isKindOfClass:NSString.class] && [value isKindOfClass:NSString.class])+ headers[key] = value;+ }+ }+ if (!YouModHTTPHeadersContainField(headers, @"Origin"))+ headers[@"Origin"] = @"https://www.youtube.com";+ if (!YouModHTTPHeadersContainField(headers, @"Referer"))+ headers[@"Referer"] = @"https://www.youtube.com/";+ format.httpHeaders = headers;+ return format;+}++static NSInteger YouModResolutionFromQuality(NSString *quality) {+ NSScanner *scanner = [NSScanner scannerWithString:quality ?: @""];+ NSInteger value = 0;+ [scanner scanInteger:&value];+ return value;+}++static NSInteger YouModFPSFromQuality(NSString *quality) {+ NSString *lower = quality.lowercaseString ?: @"";+ NSRange pRange = [lower rangeOfString:@"p"];+ if (pRange.location != NSNotFound && pRange.location + 1 < lower.length) {+ NSString *afterP = [lower substringFromIndex:pRange.location + 1];+ NSScanner *scanner = [NSScanner scannerWithString:afterP];+ NSInteger fps = 0;+ if ([scanner scanInteger:&fps] && fps > 0) return fps;+ }+ if ([lower containsString:@"60fps"] || [lower containsString:@"60 fps"]) return 60;+ if ([lower containsString:@"30fps"] || [lower containsString:@"30 fps"]) return 30;+ return 0;+}++static NSInteger YouModNormalizedFPS(NSInteger fps) {+ if (fps >= 50 && fps <= 61) return 60;+ if (fps >= 24 && fps <= 31) return 30;+ return fps;+}++static NSInteger YouModDisplayHeightForVideoHeight(NSInteger height) {+ if (height >= 900 && height < 1080) return 1080;+ return height;+}++static NSString *YouModQualityLabel(NSInteger height, NSInteger fps, NSString *fallback) {+ height = YouModDisplayHeightForVideoHeight(height);+ fps = YouModNormalizedFPS(fps);+ if (height > 0 && fps > 0) return [NSString stringWithFormat:@"%ldp%ld", (long)height, (long)fps];+ if (height > 0) return [NSString stringWithFormat:@"%ldp", (long)height];+ if (fallback.length && fps > 0 && ![fallback.lowercaseString containsString:@"fps"])+ return [NSString stringWithFormat:@"%@ %ldfps", fallback, (long)fps];+ return fallback;+}++static NSArray <YouModMediaFormat *> *YouModFormatsForPlayer(YTPlayerViewController *player, BOOL video) {+ NSMutableArray *formats = [NSMutableArray array];+ for (id stream in YouModAdaptiveFormatObjectsForPlayer(player)) {+ YouModMediaFormat *format = YouModMediaFormatFromStream(stream, video);+ if (format) [formats addObject:format];+ }++ [formats sortUsingComparator:^NSComparisonResult(YouModMediaFormat *left, YouModMediaFormat *right) {+ if (video) {+ NSInteger leftRes = YouModResolutionFromQuality(left.qualityLabel);+ NSInteger rightRes = YouModResolutionFromQuality(right.qualityLabel);+ if (leftRes != rightRes) return leftRes > rightRes ? NSOrderedAscending : NSOrderedDescending;+ NSInteger leftFPS = left.fps ?: YouModFPSFromQuality(left.qualityLabel);+ NSInteger rightFPS = right.fps ?: YouModFPSFromQuality(right.qualityLabel);+ if (leftFPS != rightFPS) return leftFPS > rightFPS ? NSOrderedAscending : NSOrderedDescending;+ }++ BOOL leftMP4 = YouModFormatLooksMP4Family(left);+ BOOL rightMP4 = YouModFormatLooksMP4Family(right);+ if (leftMP4 != rightMP4) return leftMP4 ? NSOrderedAscending : NSOrderedDescending;++ if (!video && IS_ENABLED(DownloadPreferDRCAudio) && left.drcAudio != right.drcAudio)+ return left.drcAudio ? NSOrderedAscending : NSOrderedDescending;+ if (left.contentLength != right.contentLength)+ return left.contentLength > right.contentLength ? NSOrderedAscending : NSOrderedDescending;+ return NSOrderedSame;+ }];++ NSMutableArray *unique = [NSMutableArray array];+ NSMutableSet *seen = [NSMutableSet set];+ for (YouModMediaFormat *format in formats) {+ NSInteger fps = format.fps ?: YouModFPSFromQuality(format.qualityLabel);+ NSString *key = video+ ? [NSString stringWithFormat:@"%@-%ld-%@", format.qualityLabel ?: @"", (long)fps, YouModMimeDetail(format.mimeType)]+ : [NSString stringWithFormat:@"%@-%@-%@-%@", format.qualityLabel ?: @"", format.languageCode ?: @"", format.drcAudio ? @"drc" : @"std", YouModMimeDetail(format.mimeType)];+ if ([seen containsObject:key]) continue;+ [seen addObject:key];+ [unique addObject:format];+ }+ return unique.copy;+}++static YouModMediaFormat *YouModBestAudioFormatForPlayer(YTPlayerViewController *player) {+ NSArray <YouModMediaFormat *> *audioFormats = YouModFormatsForPlayer(player, NO);+ return audioFormats.firstObject;+}++static UIViewController *YouModPresenterForSender(UIView *sender, YTPlayerViewController *player) {+ UIViewController *presenter = nil;+ if ([sender respondsToSelector:@selector(_viewControllerForAncestor)])+ presenter = [sender _viewControllerForAncestor];+ if (!presenter) presenter = player;+ return YouModTopViewController(presenter);+}++static YTPlayerViewController *YouModPlayerFromViewController(UIViewController *vc) {+ Class playerClass = NSClassFromString(@"YTPlayerViewController");+ UIViewController *cursor = vc;+ while (cursor) {+ if (playerClass && [cursor isKindOfClass:playerClass]) return (YTPlayerViewController *)cursor;+ id player = YouModObjectFromSelector(cursor, @selector(playerViewController));+ if (playerClass && [player isKindOfClass:playerClass]) return (YTPlayerViewController *)player;+ cursor = cursor.parentViewController;+ }+ return YouModCurrentPlayerViewController;+}++static NSURL *YouModThumbnailURLForVideoID(NSString *videoID) {+ if (videoID.length == 0) return nil;+ NSString *urlString = [NSString stringWithFormat:@"https://i.ytimg.com/vi/%@/maxresdefault.jpg", videoID];+ return [NSURL URLWithString:urlString];+}++static void YouModRequestPhotoAccess(void (^completion)(BOOL granted)) {+ if (@available(iOS 14.0, *)) {+ [PHPhotoLibrary requestAuthorizationForAccessLevel:PHAccessLevelAddOnly handler:^(PHAuthorizationStatus status) {+ completion(status == PHAuthorizationStatusAuthorized || status == PHAuthorizationStatusLimited);+ }];+ } else {+ [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {+ completion(status == PHAuthorizationStatusAuthorized);+ }];+ }+}++static void YouModSaveVideoToPhotos(NSURL *fileURL, UIViewController *presenter, void (^completion)(BOOL success, NSError *error)) {+ YouModRequestPhotoAccess(^(BOOL granted) {+ if (!granted) {+ NSError *error = [NSError errorWithDomain:@"YouMod" code:1 userInfo:@{NSLocalizedDescriptionKey: @"Photos access denied"}];+ completion(NO, error);+ return;+ }+ [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{+ [PHAssetCreationRequest creationRequestForAssetFromVideoAtFileURL:fileURL];+ } completionHandler:^(BOOL success, NSError *error) {+ dispatch_async(dispatch_get_main_queue(), ^{+ completion(success, error);+ });+ }];+ });+}++static void YouModShareFile(NSURL *fileURL, UIViewController *presenter) {+ if (!fileURL || !presenter) return;+ UIActivityViewController *activity = [[UIActivityViewController alloc] initWithActivityItems:@[fileURL] applicationActivities:nil];+ // Fix for iPad and specific presentation alignment+ if (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {+ activity.popoverPresentationController.sourceView = presenter.view;+ // Position at the bottom center of the screen+ activity.popoverPresentationController.sourceRect = CGRectMake(presenter.view.bounds.size.width / 2, presenter.view.bounds.size.height, 0, 0);+ activity.popoverPresentationController.permittedArrowDirections = 0; // No arrow pointing to a button+ } else {+ // On iPhone, UIActivityViewController naturally comes from the bottom center+ activity.popoverPresentationController.sourceView = presenter.view;+ }+ [presenter presentViewController:activity animated:YES completion:nil];+}++static void YouModPresentMenu(NSString *title, NSArray <YouModMenuItem *> *items, UIViewController *presenter, UIView *sender) {+ presenter = YouModTopViewController(presenter);+ Class sheetClass = NSClassFromString(@"YTDefaultSheetController");+ if (sheetClass && [sheetClass respondsToSelector:@selector(sheetControllerWithParentResponder:)]) {+ YTDefaultSheetController *sheet = [sheetClass sheetControllerWithParentResponder:presenter];+ Class actionClass = NSClassFromString(@"YTActionSheetAction");+ for (YouModMenuItem *item in items) {+ id action = nil;+ if ([actionClass respondsToSelector:@selector(actionWithTitle:subtitle:iconImage:handler:)]) {+ action = ((id (*)(Class, SEL, NSString *, NSString *, UIImage *, id))objc_msgSend)(actionClass, @selector(actionWithTitle:subtitle:iconImage:handler:), item.title, item.subtitle, item.iconImage, ^(__unused id action) {+ if (item.handler) item.handler();+ });+ } else {+ action = ((id (*)(Class, SEL, NSString *, NSInteger, id))objc_msgSend)(actionClass, @selector(actionWithTitle:style:handler:), item.title, 0, ^(__unused id action) {+ if (item.handler) item.handler();+ });+ }+ if (action) [sheet addAction:action];+ }+ if (sender && [sheet respondsToSelector:@selector(presentFromView:animated:completion:)])+ [sheet presentFromView:sender animated:YES completion:nil];+ else+ [sheet presentFromViewController:presenter animated:YES completion:nil];+ return;+ }++ UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleActionSheet];+ for (YouModMenuItem *item in items) {+ NSString *rowTitle = item.subtitle.length ? [NSString stringWithFormat:@"%@\n%@", item.title, item.subtitle] : item.title;+ [alert addAction:[UIAlertAction actionWithTitle:rowTitle style:UIAlertActionStyleDefault handler:^(__unused UIAlertAction *action) {+ if (item.handler) item.handler();+ }]];+ }+ [alert addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];+ alert.popoverPresentationController.sourceView = sender ?: presenter.view;+ [presenter presentViewController:alert animated:YES completion:nil];+}++@implementation YouModDownloadCoordinator+++ (instancetype)sharedCoordinator {+ static YouModDownloadCoordinator *coordinator;+ static dispatch_once_t onceToken;+ dispatch_once(&onceToken, ^{+ coordinator = [YouModDownloadCoordinator new];+ });+ return coordinator;+}++- (instancetype)init {+ self = [super init];+ if (self) {+ NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];+ configuration.HTTPAdditionalHeaders = @{+ @"User-Agent": @"Mozilla/5.0",+ @"Origin": @"https://www.youtube.com",+ @"Referer": @"https://www.youtube.com/",+ };+ configuration.HTTPMaximumConnectionsPerHost = YouModFastDownloadConcurrency;+ configuration.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData;+ configuration.timeoutIntervalForResource = 300;+ _session = [NSURLSession sessionWithConfiguration:configuration delegate:self delegateQueue:[NSOperationQueue mainQueue]];+ }+ return self;+}++- (void)showProgressWithTitle:(NSString *)title presenter:(UIViewController *)presenter {+ self.presenter = presenter;+ self.baseProgressTitle = title;+ self.downloadStartTime = [NSDate timeIntervalSinceReferenceDate];+ self.progressAlert = [UIAlertController alertControllerWithTitle:[NSString stringWithFormat:@"%@ - 0%%", title] message:@"\n" preferredStyle:UIAlertControllerStyleAlert];+ self.progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];+ self.progressView.progress = 0.0;+ self.progressView.translatesAutoresizingMaskIntoConstraints = NO;+ [self.progressAlert.view addSubview:self.progressView];+ [NSLayoutConstraint activateConstraints:@[+ [self.progressView.leadingAnchor constraintEqualToAnchor:self.progressAlert.view.leadingAnchor constant:24.0],+ [self.progressView.trailingAnchor constraintEqualToAnchor:self.progressAlert.view.trailingAnchor constant:-24.0],+ [self.progressView.bottomAnchor constraintEqualToAnchor:self.progressAlert.view.bottomAnchor constant:-56.0],+ ]];+ __weak typeof(self) weakSelf = self;+ [self.progressAlert addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(__unused UIAlertAction *action) {+ [weakSelf cancelWithMessage:@"Download cancelled"];+ }]];+ [presenter presentViewController:self.progressAlert animated:YES completion:nil];+}++- (void)updateProgressTitle:(NSString *)title progress:(float)progress {+ self.progressAlert.title = [NSString stringWithFormat:@"%@ - %ld%%", title, (long)lrintf(progress * 100.0f)];+ self.progressAlert.message = @"\n";+ [self.progressView setProgress:progress animated:YES];+}++- (void)cancelWithMessage:(NSString *)message {+ [self.task cancel];+ [self.metadataTask cancel];+ [self.rangeDownloader cancel];+ YouModCancelFFmpegKit();+ self.task = nil;+ self.metadataTask = nil;+ self.rangeDownloader = nil;+ self.fileCompletion = nil;+ self.active = NO;+ self.cancelled = YES;+ [self cleanupTemporaryFiles];+ if (message.length) YouModSendToast(message, self.presenter);+}++- (void)cleanupTemporaryFiles {+ if (self.videoTempURL) [NSFileManager.defaultManager removeItemAtURL:self.videoTempURL error:nil];+ if (self.audioTempURL) [NSFileManager.defaultManager removeItemAtURL:self.audioTempURL error:nil];+ self.videoTempURL = nil;+ self.audioTempURL = nil;+}++- (void)downloadURL:(NSURL *)url toURL:(NSURL *)destinationURL expectedBytes:(unsigned long long)expectedBytes headers:(NSDictionary *)headers completion:(YouModFileDownloadCompletion)completion {+ self.currentResolvedSizeAddedToTotal = NO;+ self.currentExpectedBytes = expectedBytes;+ self.currentBytes = 0;+ if (expectedBytes == 0) {+ __weak typeof(self) weakSelf = self;+ [self resolveExpectedBytesForURL:url headers:headers completion:^(unsigned long long bytes) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ if (bytes > 0) [self adjustCurrentExpectedBytesIfNeeded:bytes];+ [self beginDownloadURL:url toURL:destinationURL expectedBytes:bytes headers:headers allowFast:YES completion:completion];+ }];+ return;+ }+ [self beginDownloadURL:url toURL:destinationURL expectedBytes:expectedBytes headers:headers allowFast:YES completion:completion];+}++- (void)beginDownloadURL:(NSURL *)url toURL:(NSURL *)destinationURL expectedBytes:(unsigned long long)expectedBytes headers:(NSDictionary *)headers allowFast:(BOOL)allowFast completion:(YouModFileDownloadCompletion)completion {+ self.destinationURL = destinationURL;+ self.currentExpectedBytes = expectedBytes;+ self.currentBytes = 0;+ self.finishedCurrentFile = NO;+ self.fileCompletion = completion;+ [NSFileManager.defaultManager removeItemAtURL:destinationURL error:nil];++ if (allowFast && expectedBytes == 0) allowFast = NO;++ if (allowFast && expectedBytes >= YouModFastDownloadMinimumBytes) {+ __weak typeof(self) weakSelf = self;+ self.rangeDownloader = [[YouModRangeDownloader alloc] initWithURL:url destinationURL:destinationURL expectedBytes:expectedBytes headers:headers progress:^(unsigned long long completedBytes) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ self.currentBytes = completedBytes;+ [self updateDownloadProgressWithCurrentBytes:completedBytes expectedBytes:expectedBytes];+ } completion:^(NSURL *fileURL, NSError *error) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ self.rangeDownloader = nil;+ if (error) {+ [self beginDownloadURL:url toURL:destinationURL expectedBytes:expectedBytes headers:headers allowFast:NO completion:completion];+ return;+ }+ if (completion) completion(fileURL, nil);+ }];+ [self.rangeDownloader start];+ return;+ }++ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60.0];+ YouModApplyDownloadHeaders(request, headers);+ self.task = [self.session downloadTaskWithRequest:request];+ [self.task resume];+}++- (void)resolveExpectedBytesForURL:(NSURL *)url headers:(NSDictionary *)headers completion:(void (^)(unsigned long long bytes))completion {+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:15.0];+ request.HTTPMethod = @"HEAD";+ YouModApplyDownloadHeaders(request, headers);++ __weak typeof(self) weakSelf = self;+ self.metadataTask = [NSURLSession.sharedSession dataTaskWithRequest:request completionHandler:^(__unused NSData *data, NSURLResponse *response, __unused NSError *error) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self) return;++ unsigned long long bytes = 0;+ if (response.expectedContentLength > 0) {+ bytes = (unsigned long long)response.expectedContentLength;+ } else if ([response isKindOfClass:NSHTTPURLResponse.class]) {+ id header = ((NSHTTPURLResponse *)response).allHeaderFields[@"Content-Length"];+ if ([header respondsToSelector:@selector(unsignedLongLongValue)])+ bytes = [header unsignedLongLongValue];+ }++ dispatch_async(dispatch_get_main_queue(), ^{+ self.metadataTask = nil;+ completion(bytes);+ });+ }];+ [self.metadataTask resume];+}++- (void)updateDownloadProgressWithCurrentBytes:(unsigned long long)currentBytes expectedBytes:(unsigned long long)expectedBytes {+ unsigned long long total = self.totalBytes ?: expectedBytes;+ float progress = total ? (float)(self.completedBytes + currentBytes) / (float)total : 0.0f;+ progress = fminf(fmaxf(progress, 0.0f), 0.985f);++ NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate];+ NSTimeInterval elapsed = now - self.downloadStartTime;+ double speedMBps = 0;+ if (elapsed > 0) {+ speedMBps = ((double)(self.completedBytes + currentBytes) / 1048576.0) / elapsed;+ }+ double totalMB = (double)total / 1048576.0;++ self.progressAlert.title = [NSString stringWithFormat:@"%@ - %ld%%", self.baseProgressTitle ?: @"Downloading", (long)lrintf(progress * 100.0f)];+ if (total > 0) {+ self.progressAlert.message = [NSString stringWithFormat:@"%.1f MB/s - %.1f MB\n", speedMBps, totalMB];+ } else {+ self.progressAlert.message = [NSString stringWithFormat:@"%.1f MB/s\n", speedMBps];+ }+ [self.progressView setProgress:progress animated:YES];+}++- (void)adjustCurrentExpectedBytesIfNeeded:(unsigned long long)newExpectedBytes {+ unsigned long long oldExpectedBytes = self.currentExpectedBytes;+ if (newExpectedBytes <= oldExpectedBytes) return;++ self.currentExpectedBytes = newExpectedBytes;+ if (oldExpectedBytes > 0) {+ self.totalBytes += newExpectedBytes - oldExpectedBytes;+ } else if (!self.currentResolvedSizeAddedToTotal) {+ self.totalBytes += newExpectedBytes;+ self.currentResolvedSizeAddedToTotal = YES;+ }+}++- (void)startVideoDownloadWithVideoFormat:(YouModMediaFormat *)videoFormat audioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName videoID:(NSString *)videoID presenter:(UIViewController *)presenter {+ if (self.active) {+ YouModSendToast(@"Already downloading", presenter);+ return;+ }+ [self startDirectVideoDownloadWithVideoFormat:videoFormat audioFormat:audioFormat fileName:fileName videoID:videoID presenter:presenter];+}++- (void)startDirectVideoDownloadWithVideoFormat:(YouModMediaFormat *)videoFormat audioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName videoID:(NSString *)videoID presenter:(UIViewController *)presenter {+ NSURL *videoURL = [NSURL URLWithString:videoFormat.urlString];+ NSURL *audioURL = [NSURL URLWithString:audioFormat.urlString];+ if (!videoURL || !audioURL) {+ YouModSendToast(@"No stream URL found", presenter);+ return;+ }++ self.active = YES;+ self.cancelled = NO;+ self.completedBytes = 0;+ self.totalBytes = videoFormat.contentLength + audioFormat.contentLength;+ self.videoTempURL = YouModTemporaryFileURL(YouModFileExtensionForFormat(videoFormat, @"mp4"));+ self.audioTempURL = YouModTemporaryFileURL(YouModFileExtensionForFormat(audioFormat, @"m4a"));+ NSString *outputExtension = YouModMergedVideoOutputExtension(videoFormat, audioFormat);+ [self showProgressWithTitle:@"Downloading video" presenter:presenter];++ __weak typeof(self) weakSelf = self;+ [self downloadURL:videoURL toURL:self.videoTempURL expectedBytes:videoFormat.contentLength headers:videoFormat.httpHeaders completion:^(NSURL *videoFileURL, NSError *videoError) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || videoError) {+ [self failWithError:videoError ?: [NSError errorWithDomain:@"YouMod" code:2 userInfo:@{NSLocalizedDescriptionKey: @"Video download failed"}]];+ return;+ }++ self.completedBytes += MAX(videoFormat.contentLength, self.currentBytes);+ [self updateProgressTitle:@"Downloading audio" progress:(self.totalBytes ? (float)self.completedBytes / (float)self.totalBytes : 0.5f)];+ [self downloadURL:audioURL toURL:self.audioTempURL expectedBytes:audioFormat.contentLength headers:audioFormat.httpHeaders completion:^(NSURL *audioFileURL, NSError *audioError) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || audioError) {+ [self failWithError:audioError ?: [NSError errorWithDomain:@"YouMod" code:3 userInfo:@{NSLocalizedDescriptionKey: @"Audio download failed"}]];+ return;+ }+ unsigned long long durationMs = videoFormat.durationMs ?: audioFormat.durationMs;+ [self mergeVideoURL:videoFileURL audioURL:audioFileURL fileName:fileName outputExtension:outputExtension durationMs:durationMs presenter:presenter];+ }];+ }];+}++- (void)startDirectSingleVideoDownloadWithFormat:(YouModMediaFormat *)format fileName:(NSString *)fileName videoID:(NSString *)videoID presenter:(UIViewController *)presenter {+ NSURL *videoURL = [NSURL URLWithString:format.urlString];+ if (!videoURL) {+ YouModSendToast(@"No stream URL found", presenter);+ return;+ }++ self.active = YES;+ self.cancelled = NO;+ self.completedBytes = 0;+ self.totalBytes = format.contentLength;+ NSString *extension = YouModFileExtensionForFormat(format, @"mp4");+ BOOL canFinalizeWithAVFoundation = format.durationMs > 0 && YouModPathExtensionIsPhotosVideo(extension);+ NSURL *finalURL = YouModUniqueFileURL(fileName, extension);+ NSURL *downloadURL = canFinalizeWithAVFoundation ? YouModTemporaryFileURL(extension) : finalURL;+ self.videoTempURL = canFinalizeWithAVFoundation ? downloadURL : nil;+ [self showProgressWithTitle:@"Downloading video" presenter:presenter];++ __weak typeof(self) weakSelf = self;+ [self downloadURL:videoURL toURL:downloadURL expectedBytes:format.contentLength headers:format.httpHeaders completion:^(NSURL *fileURL, NSError *error) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || error) {+ [self failWithError:error ?: [NSError errorWithDomain:@"YouMod" code:8 userInfo:@{NSLocalizedDescriptionKey: @"Video download failed"}]];+ return;+ }+ if (canFinalizeWithAVFoundation) {+ [self trimSingleVideoURL:fileURL outputURL:finalURL durationMs:format.durationMs presenter:presenter];+ return;+ }+ [self completeWithFileURL:fileURL isVideo:YES presenter:presenter];+ }];+}++- (void)startAudioDownloadWithAudioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName videoID:(NSString *)videoID presenter:(UIViewController *)presenter {+ [self startAudioDownloadWithAudioFormat:audioFormat fileName:fileName videoID:videoID outputFormat:nil presenter:presenter];+}++- (void)startAudioDownloadWithAudioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName videoID:(NSString *)videoID outputFormat:(YouModAudioOutputFormat *)outputFormat presenter:(UIViewController *)presenter {+ if (self.active) {+ YouModSendToast(@"Already downloading", presenter);+ return;+ }+ [self startDirectAudioDownloadWithAudioFormat:audioFormat fileName:fileName videoID:videoID outputFormat:outputFormat presenter:presenter];+}++- (void)startDirectAudioDownloadWithAudioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName videoID:(NSString *)videoID presenter:(UIViewController *)presenter {+ [self startDirectAudioDownloadWithAudioFormat:audioFormat fileName:fileName videoID:videoID outputFormat:nil presenter:presenter];+}++- (void)startDirectAudioDownloadWithAudioFormat:(YouModMediaFormat *)audioFormat fileName:(NSString *)fileName videoID:(NSString *)videoID outputFormat:(YouModAudioOutputFormat *)outputFormat presenter:(UIViewController *)presenter {+ NSURL *audioURL = [NSURL URLWithString:audioFormat.urlString];+ if (!audioURL) {+ YouModSendToast(@"No audio URL found", presenter);+ return;+ }+ outputFormat = outputFormat ?: YouModDefaultAudioOutputFormat();+ if (!outputFormat.supported) {+ YouModSendToast([NSString stringWithFormat:@"%@ not supported", outputFormat.title ?: @"Format"], presenter);+ return;+ }++ self.active = YES;+ self.cancelled = NO;+ self.completedBytes = 0;+ self.totalBytes = audioFormat.contentLength;+ BOOL passthrough = YouModAudioOutputFormatCanPassthrough(outputFormat, audioFormat);+ if (!passthrough && !YouModFFmpegKitAvailable()) {+ self.active = NO;+ NSString *details = YouModFFmpegKitDiagnosticText(outputFormat, audioFormat, videoID);+ YouModRecordDownloadDiagnostic(@"FFmpegKit unavailable for audio conversion", details);+ NSString *diagnostic = YouModDownloadDiagnosticText();+ if (diagnostic.length) {+ UIPasteboard.generalPasteboard.string = diagnostic;+ YouModSendToast(@"FFmpegKit not loaded, diagnostics copied", presenter);+ } else {+ YouModSendToast([NSString stringWithFormat:@"FFmpegKit required for %@", outputFormat.title ?: @"this format"], presenter);+ }+ return;+ }++ NSURL *finalURL = YouModUniqueFileURL(fileName, YouModAudioOutputFileExtension(outputFormat, audioFormat, passthrough));+ NSURL *downloadURL = passthrough ? finalURL : YouModTemporaryFileURL(YouModFileExtensionForFormat(audioFormat, @"m4a"));+ self.audioTempURL = passthrough ? nil : downloadURL;+ [self showProgressWithTitle:@"Downloading audio" presenter:presenter];++ __weak typeof(self) weakSelf = self;+ [self downloadURL:audioURL toURL:downloadURL expectedBytes:audioFormat.contentLength headers:audioFormat.httpHeaders completion:^(NSURL *fileURL, NSError *error) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || error) {+ [self failWithError:error ?: [NSError errorWithDomain:@"YouMod" code:4 userInfo:@{NSLocalizedDescriptionKey: @"Audio download failed"}]];+ return;+ }+ if (!passthrough) {+ unsigned long long durationMs = audioFormat.durationMs ?: YouModDurationMsForURL(fileURL);+ [self convertAudioURL:fileURL outputURL:finalURL outputFormat:outputFormat durationMs:durationMs presenter:presenter];+ return;+ }+ [self completeWithFileURL:fileURL isVideo:NO presenter:presenter];+ }];+}++- (void)convertAudioURL:(NSURL *)inputURL outputURL:(NSURL *)outputURL outputFormat:(YouModAudioOutputFormat *)outputFormat durationMs:(unsigned long long)durationMs presenter:(UIViewController *)presenter {+ [self updateProgressTitle:[NSString stringWithFormat:@"Converting to %@", outputFormat.title ?: @"audio"] progress:0.985f];+ [NSFileManager.defaultManager removeItemAtURL:outputURL error:nil];++ __weak typeof(self) weakSelf = self;+ BOOL started = YouModStartFFmpegKitAudioConvert(inputURL, outputURL, outputFormat, durationMs, ^(float progress) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ [self updateProgressTitle:[NSString stringWithFormat:@"Converting to %@", outputFormat.title ?: @"audio"] progress:progress];+ }, ^(BOOL success, NSError *error) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ if (success) {+ [self completeWithFileURL:outputURL isVideo:NO presenter:presenter];+ return;+ }+ [self failWithError:error ?: [NSError errorWithDomain:@"YouMod" code:14 userInfo:@{NSLocalizedDescriptionKey: @"Conversion failed"}]];+ });++ if (!started) {+ [self failWithError:[NSError errorWithDomain:@"YouMod" code:15 userInfo:@{NSLocalizedDescriptionKey: @"Format unavailable"}]];+ }+}++- (void)mergeVideoURL:(NSURL *)videoURL audioURL:(NSURL *)audioURL fileName:(NSString *)fileName outputExtension:(NSString *)outputExtension durationMs:(unsigned long long)durationMs presenter:(UIViewController *)presenter {+ [self updateProgressTitle:@"Merging video" progress:0.985f];+ NSURL *outputURL = YouModUniqueFileURL(fileName, outputExtension.length ? outputExtension : @"mp4");+ if (durationMs == 0) durationMs = YouModDurationMsForURL(videoURL);++ if (YouModFFmpegKitAvailable()) {+ __weak typeof(self) weakSelf = self;+ BOOL started = YouModStartFFmpegKitMerge(videoURL, audioURL, outputURL, durationMs, ^(float progress) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ [self updateProgressTitle:@"Merging video" progress:progress];+ }, ^(BOOL success, NSError *error) {+ __strong typeof(weakSelf) self = weakSelf;+ if (!self || self.cancelled) return;+ if (success) {+ [self completeWithFileURL:outputURL isVideo:YES presenter:presenter];+ return;+ }++ [NSFileManager.defaultManager removeItemAtURL:outputURL error:nil];+ if (YouModVideoFileCanUseAVFoundation(outputURL)) {+ [self mergeVideoWithAVFoundationVideoURL:videoURL audioURL:audioURL outputURL:outputURL durationMs:durationMs presenter:presenter fallbackError:error];+ } else {+ [self failWithError:error ?: [NSError errorWithDomain:@"YouMod" code:16 userInfo:@{NSLocalizedDescriptionKey: @"FFmpegKit required for this stream"}]];+ }+ });+ if (started) return;+ }++ if (YouModVideoFileCanUseAVFoundation(outputURL)) {+ [self mergeVideoWithAVFoundationVideoURL:videoURL audioURL:audioURL outputURL:outputURL durationMs:durationMs presenter:presenter fallbackError:nil];+ } else {+ [self failWithError:[NSError errorWithDomain:@"YouMod" code:16 userInfo:@{NSLocalizedDescriptionKey: @"FFmpegKit required for this stream"}]];+ }+}++- (void)mergeVideoWithAVFoundationVideoURL:(NSURL *)videoURL audioURL:(NSURL *)audioURL outputURL:(NSURL *)outputURL durationMs:(unsigned long long)durationMs presenter:(UIViewController *)presenter fallbackError:(NSError *)fallbackError {+ [self updateProgressTitle:fallbackError ? @"Merging video with fallback" : @"Merging video" progress:0.985f];+ AVURLAsset *videoAsset = [AVURLAsset URLAssetWithURL:videoURL options:nil];+ AVURLAsset *audioAsset = [AVURLAsset URLAssetWithURL:audioURL options:nil];+ AVMutableComposition *composition = [AVMutableComposition composition];++ AVAssetTrack *videoTrack = [[videoAsset tracksWithMediaType:AVMediaTypeVideo] firstObject];+ AVAssetTrack *audioTrack = [[audioAsset tracksWithMediaType:AVMediaTypeAudio] firstObject];+ if (!videoTrack || !audioTrack) {+ [self failWithError:fallbackError ?: [NSError errorWithDomain:@"YouMod" code:5 userInfo:@{NSLocalizedDescriptionKey: @"Merge failed"}]];+ return;+ }++ CMTime duration = YouModExportDuration(videoAsset, audioAsset, durationMs);+ if (!YouModCMTimeIsUsable(duration)) {+ [self failWithError:fallbackError ?: [NSError errorWithDomain:@"YouMod" code:9 userInfo:@{NSLocalizedDescriptionKey: @"Cannot determine duration"}]];+ return;+ }+ NSError *insertError = nil;+ AVMutableCompositionTrack *compositionVideo = [composition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid];+ [compositionVideo insertTimeRange:CMTimeRangeMake(kCMTimeZero, duration) ofTrack:videoTrack atTime:kCMTimeZero error:&insertError];+ compositionVideo.preferredTransform = videoTrack.preferredTransform;+ if (insertError) {+ [self failWithError:insertError];+ return;+ }++ AVMutableCompositionTrack *compositionAudio = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid];+ [compositionAudio insertTimeRange:CMTimeRangeMake(kCMTimeZero, duration) ofTrack:audioTrack atTime:kCMTimeZero error:&insertError];+ if (insertError) {+ [self failWithError:insertError];+ return;+ }++ AVAssetExportSession *exporter = [[AVAssetExportSession alloc] initWithAsset:composition presetName:AVAssetExportPresetPassthrough];+ exporter.outputURL = outputURL;+ exporter.outputFileType = AVFileTypeMPEG4;+ exporter.shouldOptimizeForNetworkUse = YES;++ __weak typeof(self) weakSelf = self;+ [exporter exportAsynchronouslyWithCompletionHandler:^{+ dispatch_async(dispatch_get_main_queue(), ^{+ __strong typeof(weakSelf) self = weakSelf;+ if (!self) return;+ if (exporter.status == AVAssetExportSessionStatusCompleted) {+ [self completeWithFileURL:outputURL isVideo:YES presenter:presenter];+ } else {+ [self failWithError:exporter.error ?: [NSError errorWithDomain:@"YouMod" code:6 userInfo:@{NSLocalizedDescriptionKey: @"Merge failed"}]];+ }+ });+ }];+}++- (void)trimSingleVideoURL:(NSURL *)inputURL outputURL:(NSURL *)outputURL durationMs:(unsigned long long)durationMs presenter:(UIViewController *)presenter {+ [self updateProgressTitle:@"Finalizing video" progress:0.99f];+ [NSFileManager.defaultManager removeItemAtURL:outputURL error:nil];++ AVURLAsset *asset = [AVURLAsset URLAssetWithURL:inputURL options:nil];+ AVAssetTrack *videoTrack = [[asset tracksWithMediaType:AVMediaTypeVideo] firstObject];+ if (!videoTrack) {+ [self failWithError:[NSError errorWithDomain:@"YouMod" code:10 userInfo:@{NSLocalizedDescriptionKey: @"Cannot finalize video"}]];+ return;+ }++ CMTime duration = YouModExportDuration(asset, nil, durationMs);+ if (!YouModCMTimeIsUsable(duration)) {+ [self failWithError:[NSError errorWithDomain:@"YouMod" code:11 userInfo:@{NSLocalizedDescriptionKey: @"Cannot determine duration"}]];+ return;+ }++ AVMutableComposition *composition = [AVMutableComposition composition];+ NSError *insertError = nil;+ AVMutableCompositionTrack *compositionVideo = [composition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid];+ [compositionVideo insertTimeRange:CMTimeRangeMake(kCMTimeZero, duration) ofTrack:videoTrack atTime:kCMTimeZero error:&insertError];+ compositionVideo.preferredTransform = videoTrack.preferredTransform;+ if (insertError) {+ [self failWithError:insertError];+ return;+ }++ AVAssetTrack *audioTrack = [[asset tracksWithMediaType:AVMediaTypeAudio] firstObject];+ if (audioTrack) {+ CMTime audioDuration = YouModMinUsableDuration(duration, audioTrack.timeRange.duration);+ AVMutableCompositionTrack *compositionAudio = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid];+ [compositionAudio insertTimeRange:CMTimeRangeMake(kCMTimeZero, audioDuration) ofTrack:audioTrack atTime:kCMTimeZero error:&insertError];+ if (insertError) {+ [self failWithError:insertError];+ return;+ }+ }++ AVAssetExportSession *exporter = [[AVAssetExportSession alloc] initWithAsset:composition presetName:AVAssetExportPresetPassthrough];+ exporter.outputURL = outputURL;+ exporter.outputFileType = AVFileTypeMPEG4;+ exporter.shouldOptimizeForNetworkUse = YES;++ __weak typeof(self) weakSelf = self;+ [exporter exportAsynchronouslyWithCompletionHandler:^{+ dispatch_async(dispatch_get_main_queue(), ^{+ __strong typeof(weakSelf) self = weakSelf;+ if (!self) return;+ if (exporter.status == AVAssetExportSessionStatusCompleted) {+ [self completeWithFileURL:outputURL isVideo:YES presenter:presenter];+ } else {+ [self failWithError:exporter.error ?: [NSError errorWithDomain:@"YouMod" code:12 userInfo:@{NSLocalizedDescriptionKey: @"Finalize failed"}]];+ }+ });+ }];+}++- (void)completeWithFileURL:(NSURL *)fileURL isVideo:(BOOL)isVideo presenter:(UIViewController *)presenter {+ self.active = NO;+ [self updateProgressTitle:@"Download completed" progress:1.0f];+ [self.progressAlert dismissViewControllerAnimated:YES completion:nil];+ self.progressAlert = nil;+ self.progressView = nil;++ BOOL canSaveToPhotos = isVideo && YouModVideoFileCanSaveToPhotos(fileURL);+ if (isVideo && IS_ENABLED(DownloadSaveToPhotos) && canSaveToPhotos) {+ [self cleanupTemporaryFiles];+ YouModSaveVideoToPhotos(fileURL, presenter, ^(BOOL success, NSError *error) {+ if (success) {+ YouModSendToast(@"Saved to Photos", presenter);+ } else {+ YouModSendToast(error.localizedDescription ?: @"Cannot save to Photos", presenter);+ YouModShareFile(fileURL, presenter);+ }+ });+ } else {+ [self cleanupTemporaryFiles];+ YouModSendToast(isVideo ? @"Download completed" : @"Audio saved", presenter);+ if (!isVideo || (isVideo && !canSaveToPhotos)) YouModShareFile(fileURL, presenter);+ }+}++- (void)failWithError:(NSError *)error {+ self.active = NO;+ [self.progressAlert dismissViewControllerAnimated:YES completion:nil];+ self.progressAlert = nil;+ self.progressView = nil;+ [self cleanupTemporaryFiles];+ YouModSendToast(error.localizedDescription ?: @"Download failed", self.presenter);+}++- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite {+ self.currentBytes = (unsigned long long)MAX(totalBytesWritten, 0);+ if (totalBytesExpectedToWrite > 0)+ [self adjustCurrentExpectedBytesIfNeeded:(unsigned long long)totalBytesExpectedToWrite];+ if (self.currentBytes > self.currentExpectedBytes)+ [self adjustCurrentExpectedBytesIfNeeded:self.currentBytes];+ [self updateDownloadProgressWithCurrentBytes:self.currentBytes expectedBytes:self.currentExpectedBytes];+}++- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location {+ self.finishedCurrentFile = YES;+ NSError *error = nil;+ [NSFileManager.defaultManager removeItemAtURL:self.destinationURL error:nil];+ [NSFileManager.defaultManager moveItemAtURL:location toURL:self.destinationURL error:&error];+ if (self.fileCompletion) self.fileCompletion(error ? nil : self.destinationURL, error);+}++- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error {+ if (error && !self.finishedCurrentFile && self.fileCompletion) {+ self.fileCompletion(nil, error);+ }+}++@end++static void YouModDownloadThumbnail(NSString *videoID, UIViewController *presenter) {+ NSURL *thumbnailURL = YouModThumbnailURLForVideoID(videoID);+ if (!thumbnailURL) {+ YouModSendToast(@"No thumbnail found", presenter);+ return;+ }++ YouModSendToast(@"Downloading thumbnail", presenter);+ [[NSURLSession.sharedSession dataTaskWithURL:thumbnailURL completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {+ UIImage *image = data ? [UIImage imageWithData:data] : nil;+ dispatch_async(dispatch_get_main_queue(), ^{+ if (!image || error) {+ YouModSendToast(error.localizedDescription ?: @"Thumbnail failed", presenter);+ return;+ }+ YouModRequestPhotoAccess(^(BOOL granted) {+ if (!granted) {+ YouModSendToast(@"Photos access denied", presenter);+ return;+ }+ [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{+ [PHAssetChangeRequest creationRequestForAssetFromImage:image];+ } completionHandler:^(BOOL success, NSError *saveError) {+ dispatch_async(dispatch_get_main_queue(), ^{+ YouModSendToast(success ? @"Saved to Photos" : (saveError.localizedDescription ?: @"Save failed"), presenter);+ });+ }];+ });+ });+ }] resume];+}++static void YouModCopyVideoInfo(YTPlayerViewController *player, UIViewController *presenter) {+ NSString *videoID = YouModVideoIDForPlayer(player);+ NSString *title = YouModTitleForPlayer(player);+ NSString *url = videoID.length ? [NSString stringWithFormat:@"https://youtu.be/%@", videoID] : @"";+ UIPasteboard.generalPasteboard.string = url.length ? [NSString stringWithFormat:@"%@\n%@", title, url] : title;+ YouModSendToast(@"Copied video information", presenter);+}++static void YouModShowVideoQualitySheet(YTPlayerViewController *player, UIViewController *presenter, UIView *sender) {+ NSArray <YouModMediaFormat *> *videoFormats = YouModFormatsForPlayer(player, YES);+ YouModMediaFormat *audioFormat = YouModBestAudioFormatForPlayer(player);+ NSString *title = YouModTitleForPlayer(player);+ NSString *videoID = YouModVideoIDForPlayer(player);++ if (videoFormats.count == 0 || !audioFormat) {+ YouModSendToast(@"No video/audio streams found", presenter);+ return;+ }++ NSMutableArray *items = [NSMutableArray array];+ for (YouModMediaFormat *format in videoFormats) {+ NSString *rowTitle = format.qualityLabel.length ? format.qualityLabel : @"Video";+ NSString *subtitle = YouModFormatSubtitle(format);+ [items addObject:[YouModMenuItem itemWithTitle:rowTitle subtitle:subtitle icon:YouModIconImage(658) handler:^{+ [[YouModDownloadCoordinator sharedCoordinator] startVideoDownloadWithVideoFormat:format audioFormat:audioFormat fileName:title videoID:videoID presenter:presenter];+ }]];+ }+ YouModPresentMenu(@"Download video", items, presenter, sender);+}++static void YouModShowAudioSourceSheet(YTPlayerViewController *player, YouModAudioOutputFormat *outputFormat, UIViewController *presenter, UIView *sender) {+ NSArray <YouModMediaFormat *> *audioFormats = YouModFormatsForPlayer(player, NO);+ NSString *title = YouModTitleForPlayer(player);+ NSString *videoID = YouModVideoIDForPlayer(player);+ NSMutableArray *items = [NSMutableArray array];++ if (audioFormats.count == 0) {+ if (items.count) {+ YouModPresentMenu(@"Download audio", items, presenter, sender);+ return;+ }+ YouModSendToast(@"No audio streams found", presenter);+ return;+ }++ NSUInteger index = 1;+ for (YouModMediaFormat *format in audioFormats) {+ NSString *rowTitle = audioFormats.count == 1 ? @"Audio" : [NSString stringWithFormat:@"Audio %lu", (unsigned long)index++];+ NSString *subtitle = YouModFormatSubtitle(format);+ [items addObject:[YouModMenuItem itemWithTitle:rowTitle subtitle:subtitle icon:YouModIconImage(21) handler:^{+ [[YouModDownloadCoordinator sharedCoordinator] startAudioDownloadWithAudioFormat:format fileName:title videoID:videoID outputFormat:outputFormat presenter:presenter];+ }]];+ }+ NSString *menuTitle = outputFormat.title.length ? [NSString stringWithFormat:@"Download %@", outputFormat.title] : @"Download audio";+ YouModPresentMenu(menuTitle, items, presenter, sender);+}++static void YouModShowAudioSheet(YTPlayerViewController *player, UIViewController *presenter, UIView *sender) {+ NSMutableArray *items = [NSMutableArray array];+ for (YouModAudioOutputFormat *format in YouModAudioOutputFormats()) {+ [items addObject:[YouModMenuItem itemWithTitle:format.title subtitle:YouModAudioOutputSubtitle(format) icon:YouModIconImage(21) handler:^{+ if (!format.supported) {+ YouModSendToast(@"DSD export is not supported by bundled FFmpeg.", presenter);+ return;+ }+ YouModShowAudioSourceSheet(player, format, presenter, sender);+ }]];+ }+ YouModPresentMenu(@"Audio format", items, presenter, sender);+}++static void YouModShowCaptionsSheet(YTPlayerViewController *player, UIViewController *presenter, UIView *sender) {+ NSArray *tracks = YouModCaptionTracksForPlayer(player);+ if (tracks.count == 0) {+ YouModSendToast(@"No captions available for this video.", presenter);+ return;+ }++ NSMutableArray *items = [NSMutableArray array];+ for (id track in tracks) {+ NSString *baseURL = YouModStringFromSelector(track, @selector(baseURL));+ if (baseURL.length == 0) continue;++ NSString *languageCode = YouModStringFromSelector(track, @selector(languageCode));+ NSString *vssId = YouModStringFromSelector(track, @selector(vssId));+ NSString *nameStr = nil;+ id nameObj = YouModObjectFromSelector(track, @selector(name));+ nameStr = YouModStringFromSelector(nameObj, @selector(simpleText));+ if (!nameStr.length) {+ NSArray *runs = YouModObjectFromSelector(nameObj, @selector(runsArray));+ if (runs.count > 0) nameStr = YouModStringFromSelector(runs.firstObject, @selector(text));+ }+ if (!nameStr.length) nameStr = languageCode;+ if (!nameStr.length) nameStr = vssId;++ [items addObject:[YouModMenuItem itemWithTitle:nameStr subtitle:languageCode icon:YouModIconImage(637) handler:^{+ NSString *vttURL = [baseURL stringByAppendingString:@"&fmt=vtt"];+ NSURL *url = [NSURL URLWithString:vttURL];+ if (!url) {+ YouModSendToast(@"Invalid caption URL.", presenter);+ return;+ }+ YouModSendToast(@"Downloading captions...", presenter);+ [[NSURLSession.sharedSession dataTaskWithURL:url completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {+ dispatch_async(dispatch_get_main_queue(), ^{+ if (error || data.length == 0) {+ YouModSendToast(@"Failed to download captions.", presenter);+ return;+ }+ NSString *videoID = YouModVideoIDForPlayer(player) ?: @"video";+ NSString *filename = [NSString stringWithFormat:@"%@_%@.vtt", videoID, languageCode ?: @"captions"];+ NSURL *tempURL = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:filename]];+ [data writeToURL:tempURL atomically:YES];+ YouModShareFile(tempURL, presenter);+ });+ }] resume];+ }]];+ }++ if (items.count == 0) {+ YouModSendToast(@"No valid caption URLs found.", presenter);+ return;+ }++ YouModPresentMenu(@"Download captions", items, presenter, sender);+}++static void YouModShowDownloadManager(YTPlayerViewController *player, UIViewController *presenter, UIView *sender) {+ if (!player) {+ YouModSendToast(@"Open a video before using the download manager.", presenter);+ return;+ }++ NSString *videoID = YouModVideoIDForPlayer(player);+ NSMutableArray *items = [NSMutableArray array];+ [items addObject:[YouModMenuItem itemWithTitle:@"Download video" subtitle:@"Choose quality" icon:YouModIconImage(658) handler:^{+ YouModShowVideoQualitySheet(player, presenter, sender);+ }]];+ [items addObject:[YouModMenuItem itemWithTitle:@"Download audio" subtitle:@"Choose format" icon:YouModIconImage(21) handler:^{+ YouModShowAudioSheet(player, presenter, sender);+ }]];+ [items addObject:[YouModMenuItem itemWithTitle:@"Download captions" subtitle:@"Save subtitles as VTT" icon:YouModIconImage(637) handler:^{+ YouModShowCaptionsSheet(player, presenter, sender);+ }]];+ [items addObject:[YouModMenuItem itemWithTitle:@"Copy diagnostics" subtitle:@"Copy last error log" icon:YouModIconImage(870) handler:^{+ YouModCopyDownloadDiagnostics(presenter);+ }]];+ [items addObject:[YouModMenuItem itemWithTitle:@"Save thumbnail" subtitle:@"Save to Photos" icon:YouModIconImage(367) handler:^{+ YouModDownloadThumbnail(videoID, presenter);+ }]];+ [items addObject:[YouModMenuItem itemWithTitle:@"Copy video information" subtitle:@"Copy title and URL" icon:YouModIconImage(250) handler:^{+ YouModCopyVideoInfo(player, presenter);+ }]];+ YouModPresentMenu(@"Download manager", items, presenter, sender);+}++void YouModConfigureDownloadButton(_ASDisplayView *view) {+ if (![view.accessibilityIdentifier isEqualToString:@"id.ui.add_to.offline.button"]) return;+ if (!IS_ENABLED(DownloadManager) || IS_ENABLED(HideDownloadButton)) return;+ if (objc_getAssociatedObject(view, @selector(YouModDownloadButtonTapped:))) return;++ view.userInteractionEnabled = YES;+ UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:view action:@selector(YouModDownloadButtonTapped:)];+ tap.cancelsTouchesInView = YES;+ tap.delaysTouchesBegan = YES;+ tap.delaysTouchesEnded = YES;+ [view addGestureRecognizer:tap];+ objc_setAssociatedObject(view, @selector(YouModDownloadButtonTapped:), @YES, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+}++%hook _ASDisplayView++%new+- (void)YouModDownloadButtonTapped:(UITapGestureRecognizer *)sender {+ if (sender.state != UIGestureRecognizerStateEnded) return;+ UIViewController *presenter = YouModPresenterForSender(self, YouModCurrentPlayerViewController);+ YTPlayerViewController *player = YouModPlayerFromViewController(presenter);+ YouModShowDownloadManager(player, presenter, self);+}++%end++%hook YTPlayerViewController++- (void)viewDidAppear:(BOOL)animated {+ %orig;+ YouModCurrentPlayerViewController = self;+}++- (void)viewWillDisappear:(BOOL)animated {+ %orig;+ if (YouModCurrentPlayerViewController == self)+ YouModCurrentPlayerViewController = nil;+}++%end++NSString *YouModGlobalAuthHeader = nil;++%hook SSOAuthorization+- (id)accessToken {+ id token = %orig;+ if ([token isKindOfClass:[NSString class]] && [(NSString *)token length] > 0) {+ YouModGlobalAuthHeader = [NSString stringWithFormat:@"Bearer %@", token];+ }+ return token;+}+%end++%hook SSOAuthorizationImpl+- (id)accessToken {+ id token = %orig;+ if ([token isKindOfClass:[NSString class]] && [(NSString *)token length] > 0) {+ YouModGlobalAuthHeader = [NSString stringWithFormat:@"Bearer %@", token];+ }+ return token;+}+%end++%hook GNPSSOAuthorizationService+- (id)authToken {+ id token = %orig;+ if ([token isKindOfClass:[NSString class]] && [(NSString *)token length] > 0) {+ YouModGlobalAuthHeader = [NSString stringWithFormat:@"Bearer %@", token];+ }+ return token;+}+%end\ No newline at end of filediff --git a/vendor/YouMod/Files/Feed.x b/vendor/YouMod/Files/Feed.xnew file mode 100644index 0000000..59c24c4--- /dev/null+++ b/vendor/YouMod/Files/Feed.x@@ -0,0 +1,97 @@+#import "Headers.h"++// Hide Subbar+%hook YTHeaderContentComboView+- (void)enableSubheaderBarWithView:(id)arg1 { if (!IS_ENABLED(HideSubbar)) %orig; }+- (void)setFeedHeaderScrollMode:(int)arg1 {+ int temp = IS_ENABLED(HideSubbar) ? 0 : arg1;+ %orig(temp);+}+- (id)initWithChildView:(id)arg1 headerView:(id)arg2 {+ self = %orig;+ if (self && IS_ENABLED(HideSubbar)) {+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setNeedsLayout) name:@"YouModReloadHeaderBar" object:nil];+ }+ return self;+}+%end++// Hide voice search button+%hook YTSearchViewController+- (void)viewDidLoad {+ %orig;+ if (IS_ENABLED(HideVoiceSearch)) {+ [self setValue:@(NO) forKey:@"_isVoiceSearchAllowed"];+ }+}+- (void)setSuggestions:(id)arg1 { if (!IS_ENABLED(HideSearchHis)) %orig; }+%end++// Hide search history and suggestions+%hook YTPersonalizedSuggestionsCacheProvider+- (id)activeCache { return IS_ENABLED(HideSearchHis) ? nil : %orig; }+%end++// Hide related videos in the player+%hook YTWatchNextResultsViewController+- (void)setVisibleSections:(NSInteger)sections {+ if (![self.parentViewController isKindOfClass:%c(YTWatchNextResponseViewController)]) {+ %orig;+ return;+ }+ NSInteger value = IS_ENABLED(HideRelatedVideos) ? 1 : sections;+ %orig(value);+}+%end++static void YouModFilterChannelButtons(_ASDisplayView *self, NSString *iden) {+ UIView *sup = self.superview;+ if ([sup isKindOfClass:%c(ASScrollView)]) {+ ASScrollView *scroll = (ASScrollView *)sup;+ ASDisplayNode *node = scroll.scrollNode;+ for (_ASDisplayView *view in node.yogaChildren) {+ if ([[view description] containsString:iden]) {+ [node removeYogaChild:view];+ [self removeFromSuperview];+ break;+ }+ }+ } else {+ UIViewController *con = self._viewControllerForAncestor;+ if ([con isKindOfClass:%c(YTPageHeaderViewController)]) {+ _ASDisplayView *dpv = (_ASDisplayView *)sup;+ ASDisplayNode *node = dpv.keepalive_node;+ _ASDisplayView *maindpv = (_ASDisplayView *)dpv.superview;+ ASDisplayNode *mainNode = maindpv.keepalive_node;+ [mainNode removeYogaChild:node];+ [dpv removeFromSuperview];+ } else if ([con isKindOfClass:%c(YTWatchNextResultsViewController)]) {+ _ASDisplayView *dpv = (_ASDisplayView *)sup;+ ASDisplayNode *node = dpv.keepalive_node;+ for (id child in [node.yogaChildren copy]) {+ if ([[child description] containsString:iden]) {+ [node removeYogaChild:child];+ [self removeFromSuperview];+ break;+ }+ }+ }+ }+}++%hook _ASDisplayView+- (void)didMoveToWindow {+ %orig;+ NSString *iden = self.accessibilityIdentifier;+ if (!iden || iden.length == 0) return;+ BOOL remove = NO;+ if ([iden isEqualToString:@"eml.header_community_button"] && IS_ENABLED(RemoveChannelCommunityButton)) {+ remove = YES;+ } else if ([iden isEqualToString:@"id.sponsor_button"] && IS_ENABLED(RemoveChannelSponsorAll)) {+ remove = YES;+ }+ if (remove) {+ YouModFilterChannelButtons(self, iden);+ }+}+%end\ No newline at end of filediff --git a/vendor/YouMod/Files/FixPlaybackIssues.x b/vendor/YouMod/Files/FixPlaybackIssues.xnew file mode 100644index 0000000..672e360--- /dev/null+++ b/vendor/YouMod/Files/FixPlaybackIssues.x@@ -0,0 +1,45 @@+// Some are adapted from https://github.com/Mark02-2012/YTPlaybackFix+#import "Headers.h"++/* Old method+static BOOL isReloaded = NO;++%hook YTPlayerViewController+- (int)state {+ int value = %orig;+ if (![self.UIDelegate isKindOfClass:%c(YTWatchController)]) return value;+ if (value == 7) {+ if (!isReloaded) {+ isReloaded = YES;+ YTWatchController *watchController = (YTWatchController *)self.UIDelegate;+ dispatch_async(dispatch_get_main_queue(), ^{+ [watchController reload];+ });+ }+ } else {+ isReloaded = NO;+ }+ return value;+}+%end+*/++%hook YTMainAppVideoPlayerOverlayViewController+- (void)handleError:(NSError *)error {+ if (error && [error.domain isEqualToString:@"com.google.ios.youtube.ErrorDomain.playback"] && error.code == 14) {+ YTPlayerViewController *playerViewController = self.parentViewController;+ if (![playerViewController.UIDelegate isKindOfClass:%c(YTWatchController)]) return;+ YTWatchController *watchController = (YTWatchController *)playerViewController.UIDelegate;+ dispatch_async(dispatch_get_main_queue(), ^{+ [watchController reload];+ });+ return;+ }+ %orig;+}+%end++%ctor {+ if (!IS_ENABLED(FixPlaybackIssues)) return;+ %init;+}\ No newline at end of filediff --git a/vendor/YouMod/Files/GlobalFunctions.x b/vendor/YouMod/Files/GlobalFunctions.xnew file mode 100644index 0000000..3233db2--- /dev/null+++ b/vendor/YouMod/Files/GlobalFunctions.x@@ -0,0 +1,98 @@+#import "Headers.h"++// YouMod's bundle (For localizations)+NSBundle *YouModBundle() {+ static NSBundle *bundle = nil;+ static dispatch_once_t onceToken;+ dispatch_once(&onceToken, ^{+ NSString *tweakBundlePath = [[NSBundle mainBundle] pathForResource:@"YouMod" ofType:@"bundle"];+ if (tweakBundlePath) {+ bundle = [NSBundle bundleWithPath:tweakBundlePath];+ } else {+ bundle = [NSBundle bundleWithPath:[NSString stringWithFormat:jbroot(@"/Library/Application Support/%@.bundle"), @"YouMod"]];+ }+ });+ return bundle;+}++// YouTube icon image (YTIIcon)+UIImage *YouModYTIconImage(NSInteger iconType, BOOL useCustomColor, UIColor *customColor) {+ YTIIcon *icon = [%c(YTIIcon) new];+ icon.iconType = iconType;+ UIColor *targetColor = (useCustomColor && customColor) ? customColor : [UIColor labelColor];+ return [icon iconImageWithColor:targetColor];+}++// Language list+NSArray *getAllSystemLanguageTitles() {+ NSMutableArray *titles = [NSMutableArray array];+ NSArray *allLocales = [%c(YTLanguages) languageList];+ NSMutableSet *seenLanguages = [NSMutableSet set];+ NSLocale *currentLocale = [NSLocale currentLocale];++ for (NSString *localeId in allLocales) {+ NSDictionary *components = [NSLocale componentsFromLocaleIdentifier:localeId];+ NSString *langCode = components[NSLocaleLanguageCode];++ if (langCode && ![seenLanguages containsObject:langCode]) {+ [seenLanguages addObject:langCode];+ NSString *displayName = [currentLocale localizedStringForLocaleIdentifier:langCode];+ if (displayName) [titles addObject:displayName];+ }+ }+ return [titles sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];+}++NSArray *getAllSystemLanguageValues() {+ NSArray *sortedTitles = getAllSystemLanguageTitles();+ NSMutableArray *sortedCodes = [NSMutableArray array];+ NSArray *allLocales = [%c(YTLanguages) languageList];+ NSLocale *currentLocale = [NSLocale currentLocale];++ NSMutableDictionary *titleToCodeMap = [NSMutableDictionary dictionary];+ for (NSString *localeId in allLocales) {+ NSDictionary *components = [NSLocale componentsFromLocaleIdentifier:localeId];+ NSString *langCode = components[NSLocaleLanguageCode];+ if (langCode) {+ NSString *displayName = [currentLocale localizedStringForLocaleIdentifier:langCode];+ if (displayName) titleToCodeMap[displayName] = langCode;+ }+ }++ for (NSString *title in sortedTitles) {+ [sortedCodes addObject:titleToCodeMap[title] ? titleToCodeMap[title] : @"en"];+ }+ return [sortedCodes copy];+}++// Get TopViewController+UIViewController *YouModTopViewController(UIViewController *root) {+ if (!root) {+ UIWindow *keyWindow = nil;+ for (UIWindow *window in UIApplication.sharedApplication.windows) {+ if (window.isKeyWindow) {+ keyWindow = window;+ break;+ }+ }+ root = keyWindow.rootViewController;+ }+ while (root.presentedViewController) root = root.presentedViewController;+ if ([root isKindOfClass:UINavigationController.class])+ return YouModTopViewController(((UINavigationController *)root).topViewController);+ if ([root isKindOfClass:UITabBarController.class])+ return YouModTopViewController(((UITabBarController *)root).selectedViewController);+ return root;+}++// OLEDKeyboard (https://github.com/dayanch96/OledKeyboard)+BOOL isDarkMode(UIView *view) {+ if ([view respondsToSelector:@selector(_mapkit_isDarkModeEnabled)]) {+ return view._mapkit_isDarkModeEnabled;+ }+ return view.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark;+}++BOOL isPad() {+ return UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad;+}\ No newline at end of filediff --git a/vendor/YouMod/Files/Headers.h b/vendor/YouMod/Files/Headers.hnew file mode 100644index 0000000..bab72de--- /dev/null+++ b/vendor/YouMod/Files/Headers.h@@ -0,0 +1,851 @@+// Perferences and headers+// For Tweak.x+#import <YouTubeHeader/_ASDisplayView.h>+#import <YouTubeHeader/YTIIcon.h>+#import <YouTubeHeader/YTRightNavigationButtons.h>+#import <YouTubeHeader/YTIElementRenderer.h>+#import <YouTubeHeader/YTPlayerBarController.h>+#import <YouTubeHeader/YTPlayerViewController.h>+#import <YouTubeHeader/YTWatchController.h>+#import <YouTubeHeader/YTIMenuConditionalServiceItemRenderer.h>+#import <YouTubeHeader/YTIPivotBarRenderer.h>+#import <YouTubeHeader/YTPivotBarItemView.h>+#import <YouTubeHeader/YTActionSheetAction.h>+#import <YouTubeHeader/YTIMenuItemSupportedRenderers.h>+#import <YouTubeHeader/YTMainAppControlsOverlayView.h>+#import <YouTubeHeader/YTMainAppVideoPlayerOverlayView.h>+#import <YouTubeHeader/YTMainAppVideoPlayerOverlayViewController.h>+#import <YouTubeHeader/YTVideoQualitySwitchOriginalController.h>+#import <YouTubeHeader/YTVideoQualitySwitchRedesignedController.h>+#import <YouTubeHeader/YTInnerTubeCollectionViewController.h>+#import <YouTubeHeader/YTIShowFullscreenInterstitialCommand.h>+#import <YouTubeHeader/YTISectionListRenderer.h>+#import <YouTubeHeader/YTIShelfRenderer.h>+#import <YouTubeHeader/YTIWatchNextResponse.h>+#import <YouTubeHeader/YTPlayerOverlay.h>+#import <YouTubeHeader/YTPlayerOverlayProvider.h>+#import <YouTubeHeader/YTReelModel.h>+#import <YouTubeHeader/YTAlertView.h>+#import <YouTubeHeader/YTVarispeedSwitchController.h>+#import <YouTubeHeader/YTVarispeedSwitchControllerOption.h>+#import <YouTubeHeader/YTInlinePlayerBarContainerView.h>+#import <YouTubeHeader/YTSingleVideoTime.h>+#import <YouTubeHeader/YTSingleVideoController.h>+#import <YouTubeHeader/YTPlayerView.h>+#import <YouTubeHeader/YTShortsPlayerViewController.h>+#import <YouTubeHeader/YTReelPlayerViewController.h>+#import <YouTubeHeader/YTLabel.h>+#import <YouTubeHeader/MLFormat.h>+#import <YouTubeHeader/MLQuickMenuVideoQualitySettingFormatConstraint.h>+#import <YouTubeHeader/YTCommonColorPalette.h>+#import <YouTubeHeader/YTIPivotBarSupportedRenderers.h>+#import <YouTubeHeader/YTIBrowseRequest.h>+#import <YouTubeHeader/YTAssetLoader.h>+#import <MediaPlayer/MediaPlayer.h>+#import <YouTubeHeader/ASCollectionView.h>+#import <YouTubeHeader/YTColor.h>+#import <YouTubeHeader/YTTypeStyle.h>+#import <YouTubeHeader/YTModularPlayerBarController.h>+#import <dlfcn.h>+#import <SystemConfiguration/SystemConfiguration.h>+#import <netinet/in.h>+#import <YouTubeHeader/YTAppViewControllerImpl.h>+#import <YouTubeHeader/YTAppViewController.h>+#import <YouTubeHeader/YTDefaultSheetController.h>+#import <YouTubeHeader/YTIFormatStream.h>+#import <YouTubeHeader/YTIPlayerResponse.h>+#import <YouTubeHeader/YTPlayerResponse.h>+#import <YouTubeHeader/YTIVideoDetails.h>+#import <YouTubeHeader/YTIStreamingData.h>+#import <YouTubeHeader/YTIFormattedString.h>+#import <YouTubeHeader/GOOHUDManagerInternal.h>+#import <YouTubeHeader/MLInnerTubeCaptionTrack.h>+#import <YouTubeHeader/MLCaption.h>+#import <YouTubeHeader/MLFormat3Captions.h>+#import <YouTubeHeader/YTFormat3CaptionViewController.h>+#import <YouTubeHeader/YTWatchNextResultsViewController.h>+#import <YouTubeHeader/YTIThumbnailDetails.h>+#import <YouTubeHeader/YTIThumbnailDetails_Thumbnail.h>+#import <YouTubeHeader/_ASCollectionViewCell.h>+#import <YouTubeHeader/YTReelElementAsyncComponentView.h>++// For Settings.x and SponsorBlockSettings.x+#import <roothide.h>+#import <YouTubeHeader/YTSettingsGroupData.h>+#import <YouTubeHeader/YTSettingsSectionItem.h>+#import <YouTubeHeader/YTSettingsSectionItemManager.h>+#import <YouTubeHeader/YTSettingsViewController.h>+#import <YouTubeHeader/YTSettingsSectionController.h>+#import <YouTubeHeader/YTSearchableSettingsViewController.h>+#import <YouTubeHeader/YTUIUtils.h>++#define DownloadFix @"YouModDownloadFix"+#define DownloadServerIndex @"YouModDownloadServerIndex"+#define SABRDownload @"YouModSABRDownload"+#define DownloadMethod @"YouModDownloadMethod" // index into the "Download method" picker+#define DownloadMethodDirect 0 // YouTube's built-in stream URLs+#define DownloadMethodServer 1 // external server (triggerSilentDownload…)+#define DownloadMethodOnDevice 2 // on-device SABR engine++#define IS_ENABLED(k) [[NSUserDefaults standardUserDefaults] boolForKey:k]+#define INTFORVAL(v) [[NSUserDefaults standardUserDefaults] integerForKey:v]+#define FixPlaybackIssues @"YouModFixPlaybackIssues"+#define MuteButton @"YouModMuteButton"+#define SpeedButton @"YouModSpeedButton"+#define ShareButton @"YouModShareButton"+#define LoopButton @"YouModLoopButton"+#define CaptionButton @"YouModCaptionButton"+#define KeepMutedKey @"YouModKeepMutedKey"+#define KeepLoopKey @"YouModKeepLoopKey"+#define QualityButton @"YouModQualityButton"+#define OverlayButtonOrder @"YouModOverlayButtonOrder"+#define GlobalSpeedLocked @"YouModGlobalSpeedLocked"+#define GlobalSavedNormalRate @"YouModGlobalSavedNormalRate"+// Downloading+#define DownloadManager @"YouModDownloadManager"+#define PostDownloadAction @"YouModPostDownloadAction"+#define PostDownloadActionSaveToPhotos 0+#define PostDownloadActionShare 1+#define PostDownloadActionAsk 2+#define AddDownloadToShorts @"YouModAddDownloadToShorts"+#define AudioPreferIndex @"YouModAudioPreferIndex"+#define DownloadComment @"YouModDownloadComment"+#define DownloadPost @"YouModDownloadPost"+// Cache+#define AutoClearCache @"YouModAutoClearCache"+// Appearance+#define OLEDTheme @"YouModEnablesOLEDTheme"+#define OLEDKeyboard @"YouModEnablesOLEDKeyboard"+// Navigation bar+#define YTLogoIndex @"YouModYTLogoIndex"+#define StickyNavBar @"YouModStickyNavBar"+#define HideNoti @"YouModHideNotificationButton"+#define HideSearch @"YouModHideSearchButton"+#define HideVoiceSearch @"YouModHideVoiceSearchButton"+#define HideCastButtonNav @"YouModHideCastButtonNavigationBar"+// Feed+#define HideSubbar @"YouModHideSubbar"+#define HideHoriShelf @"YouModHideHoriShelf"+#define HideGenMusicShelf @"YouModHideGenMusicShelf"+#define HideFeedPost @"YouModHideFeedPost"+#define HidePlayables @"YouModHidePlayables"+#define HideShortsShelf @"YouModHideShortsShelf"+#define KeepShortsSubscript @"YouModKeepShortsSubscript"+#define HideSearchHis @"YouModHideSearchHistoryAndSuggestions"+#define HideSurveys @"YouModHideSurveys"+#define HideRelatedVideos @"YouModHideRelatedVideos"+#define RemoveChannelCommunityButton @"YouModRemoveChannelCommunityButton"+#define RemoveChannelSponsorAll @"YouModRemoveChannelSponsorAll"+// Player+#define WifiQualityIndex @"YouModWifiQualityIndex"+#define CellQualityIndex @"YouModCellQualityIndex"+#define LowPowerQualityIndex @"YouModLowPowerQualityIndex"+#define AudioTrack @"YouModAudioTrackSegment"+#define AudioTrackLangIndex @"YouModAudioTrackLangIndex"+#define NoDubbedAudioTrack @"YouModNoDubbedAudioTrack"+#define CaptionTrack @"YouModCaptionTrack"+#define CaptionTrackLangIndex @"YouModCaptionTrackLangIndex"+#define DisablesCaptionTrack @"YouModDisablesCaptionTrack"+#define AutoSpeedIndex @"YouModAutoSpeedIndex"+#define HoldToSpeedIndex @"YouModHoldToSpeedIndex"+#define HideAutoPlayToggle @"YouModHideAutoPlayToggle"+#define HideCaptionsButton @"YouModHideCaptionsButton"+#define HideCastButtonPlayer @"YouModHideCastButtonPlayer"+#define HideNextAndPrevButtons @"YouModHideNextAndPrevButtons"+#define ReplacePrevNextButtons @"YouModReplacePrevNextButtons"+#define SkipBackwardEnabled @"YouModSkipBackwardEnabled"+#define SkipForwardEnabled @"YouModSkipForwardEnabled"+#define RewindSeconds @"YouModRewindSeconds"+#define ForwardSeconds @"YouModForwardSeconds"+#define RemoveDarkOverlay @"YouModRemoveDarkOverlay"+#define RemoveAmbiant @"YouModRemoveAmbiantColors"+#define HideEndScreenCards @"YouModHideEndScreenCards"+#define HideSuggestedVideo @"YouModHideSuggestedVideoOnFinish"+#define HidePaidPromoOverlay @"YouModHidePaidPromoOverlay"+#define HideWaterMark @"YouModHideWaterMark"+#define DisablesEngagementPanel @"YouModDisablesEngagementPanel"+#define DontSnapToChapter @"YouModDontSnapToChapter"+#define PauseOnOverlay @"YouModPauseOnOverlay"+#define GestureControls @"YouModEnableGesturesControls"+#define GestureActivationArea @"YouModGestureActivationArea"+#define LeftSideGesture @"YouModLeftSideGesture"+#define RightSideGesture @"YouModRightSideGesture"+#define GestureHUD @"YouModGestureHUD"+#define GestureHUDSize @"YouModGestureHUDSize"+#define GestureHUDPosition @"YouModGestureHUDPosition"+#define DisablesDoubleTap @"YouModDisablesDoubleTap"+#define DisablesLongHold @"YouModDisablesLongHold"+#define AutoExitFullScreen @"YouModAutoExitFullScreen"+#define DisablesShowRemaining @"YouModDisablesShowRemainingTime"+#define AlwaysShowRemaining @"YouModAlwaysShowRemainingTime"+#define ShowExtraTimeRemaining @"YouModShowExtraTimeRemaining"+#define Uses24HoursTime @"YouModUses24HoursTime"+#define CopyWithTimestampOnPause @"YouModCopyWithTimestampOnPause"+#define HideFullAction @"YouModHideFullScreenAction"+#define HideFullvidTitle @"YouModHideFullscreenVideoTitle"+#define StopAutoplayVideo @"YouModStopAutoplayVideo"+#define HideContentWarning @"YouModHideContentWarning"+#define AutoFullScreen @"YouModAutoFullScreen"+#define PortFull @"YouModPortraitFullscreen"+#define OldQualityPicker @"YouModUseOldQualityPicker"+#define ExtraSpeed @"YouModAddExtraSpeed"+#define ForceMiniPlayer @"YouModForceMiniPlayer"+#define AlwaysShowSeekbar @"YouModAlwaysShowSeekbar"+#define DisablesFreeZoom @"YouModDisablesFreeZoom"+#define TapToSeek @"YouModTapToSeek"+#define PauseTwoFingers @"YouModPauseTwoFingers"+#define HideCommentsSection @"YouModHideCommentsSection"+#define HideCommentsPreview @"YouModHideCommentsPreview"+#define LockSpeed @"YouModLockSpeed"+#define SeekOnOverlay @"YouModSeekOnOverlay"+#define AutoDRCAudioIndex @"YouModAutoDRCAudioIndex"+#define RemoveVideoLikeButton @"YouModRemoveVideoLikeButton"+#define RemoveVideoDislikeButton @"YouModRemoveVideoDislikeButton"+#define RemoveVideoShareButton @"YouModRemoveVideoShareButton"+#define RemoveVideoSaveButton @"YouModRemoveVideoSaveButton"+#define RemoveVideoDownloadButton @"YouModRemoveVideoDownloadButton"+#define RemoveVideoClipButton @"YouModRemoveVideoClipButton"+#define RemoveVideoRemixButton @"YouModRemoveVideoRemixButton"+#define RemoveVideoLiveChatButton @"YouModRemoveVideoLiveChatButton"+#define AutoFeedMute @"YouModAutoFeedMute"+// Shorts+#define HideShortsTopbar @"YouModHideShortsTopbar"+#define HideShortsSubbar @"YouModHideShortsSubbar"+#define FullScreenShorts @"YouModFullScreenShorts"+#define RemoveShortsLive @"YouModRemoveShortsLive"+#define RemoveShortsPosts @"YouModRemoveShortsPosts"+#define HideShortsProducts @"YouModHideShortsProducts"+#define HideShortsRecbar @"YouModHideShortsRecbar"+#define EnablesShortsQuality @"YouModEnablesShortsQuality"+#define ShowShortsSeekbar @"YouModShowShortsSeekbar"+#define ShortsActionIndex @"YouModMakeAShortsAction"+#define ShortsOnly @"YouModShortsOnly"+#define RemoveShortsLikeButton @"YouModRemoveShortsLikeButton"+#define RemoveShortsCommentButton @"YouModRemoveShortsCommentButton"+#define RemoveShortsShareButton @"YouModRemoveShortsShareButton"+#define RemoveShortsRemixButton @"YouModRemoveShortsRemixButton"+#define RemoveShortsSoundMetadataButton @"YouModRemoveShortsSoundMetadataButton"+#define RemoveShortsPausedSubButton @"YouModRemoveShortsPausedSubButton"+#define RemoveShortsPausedLiveButton @"YouModRemoveShortsPausedLiveButton"+#define RemoveShortsPausedLensButton @"YouModRemoveShortsPausedLensButton"+#define RemoveShortsPausedTrendsButton @"YouModRemoveShortsPausedTrendsButton"+#define RemoveShortsDisclosure @"YouModRemoveShortsDisclosure"+// Tab bar+#define DefaultTab @"YouModDefaultStartupTab"+#define TabOrder @"YouModTabOrder"+#define HideTabIndi @"YouModHideTabIndicators"+#define HideTabLabels @"YouModHideTabLabels"+#define UseFrostedTabBar @"YouModUseFrostedTabBar"+// Miscellaneous+#define BackgroundPlayback @"YouModEnablesBackgroundPlayback"+#define DisablesShortsPiP @"YouModTrytoDisablesShortsPiP"+#define DisableHints @"YouModDisableHints"+#define BlockUpgradeDialogs @"YouModBlockUpgradeDialogs"+#define HideAreYouThereDialog @"YouModHideAreYouThereDialog"+#define FixesSlowMiniPlayer @"YouModFixesSlowMiniPlayer"+#define DisablesNewMiniPlayer @"YouModDisablesNewMiniPlayer"+#define DisablesSnackBar @"YouModDisablesSnackBar"+#define HideStartupAni @"YouModHideStartupAnimations"+#define HideLikeDislikeVotes @"YouModHideLikeDislikeVotes"+#define HideCommuGuide @"YouModHideCommuGuide"+#define HideEngagementSubbar @"YouModHideEngagementSubbar"+#define DisablesRTL @"YouModDisablesRTL"+#define DeviceUIIndex @"YouModDeviceUIIndex"+#define FloatingKeyboard @"YouModFloatingKeyboard"+#define AutoOpenLink @"YouModAutoOpenLink"+// #define CustomStartup @"YouModUseCustomVideoStartup"+// Flyout menu+#define RemovePlayInNextQueueOption @"YouModRemovePlayInNextQueueOption"+#define RemoveDownloadOption @"YouModRemoveDownloadOption"+#define RemoveWatchLaterOption @"YouModRemoveWatchLaterOption"+#define RemoveSaveOption @"YouModRemoveSaveOption"+#define RemoveRemoveFromPlaylistOption @"YouModRemoveRemoveFromPlaylistOption"+#define RemoveShareOption @"YouModRemoveShareOption"+#define RemoveNotInterestedOption @"YouModRemoveNotInterestedOption"+#define RemoveInfoOption @"YouModRemoveInfoOption"+#define RemoveFilterOption @"YouModRemoveFilterOption"+#define RemoveReportOption @"YouModRemoveReportOption"+#define RemoveYouTubeMusicOption @"YouModRemoveYouTubeMusicOption"+#define RemoveFeedBackOption @"YouModRemoveFeedBackOption"+#define RemoveDontRecommendOption @"YouModRemoveDontRecommendOption"+#define RemoveCastOption @"YouModRemoveCastOption"+#define RemoveShuffleOption @"YouModRemoveShuffleOption"+#define RemoveUnSubOption @"YouModRemoveUnSubOption"+#define RemoveHideFromPlaylistOption @"YouModRemoveHideFromPlaylistOption"+#define RemoveHelpOption @"YouModRemoveHelpOption"+#define RemoveNotifyOption @"YouModRemoveNotifyOption"+#define RemoveClearScreenOption @"YouModRemoveClearScreenOption"+#define RemoveAddToLastQueueOption @"YouModRemoveAddToLastQueueOption"+// SponsorBlock+#define SBEnabled @"YouModSBEnabled"+#define SBShowButton @"YouModSBShowButton"+#define SBShowNotifications @"YouModSBShowNotifications"+#define SBAudioNotification @"YouModSBAudioNotification"+#define SBSegmentsInPlayer @"YouModSBSegmentsInPlayer"+#define SBSegmentsInFeed @"YouModSBSegmentsInFeed"+#define SBSegmentsInMiniPlayer @"YouModSBSegmentsInMiniPlayer"+#define SBShowDuration @"YouModSBShowDuration"+#define SBMinDuration @"YouModSBMinDuration"+#define SBSkipAlertDuration @"YouModSBSkipAlertDuration"+#define SBUnskipAlertDuration @"YouModSBUnskipAlertDuration"+#define SBButtonKey @"YouModSBButtonKey"++#define SB_ACTION_KEY(cat) [NSString stringWithFormat:@"YouModSBAction_%@", cat]+#define SB_COLOR_KEY(cat) [NSString stringWithFormat:@"YouModSBColor_%@", cat]++#define FLOAT_FOR_KEY(k) [[NSUserDefaults standardUserDefaults] floatForKey:k]++#define YT_BUNDLE_ID @"com.google.ios.youtube"+#define YT_NAME @"YouTube"++@interface MDCInkView : UIView+@end++@interface YTPageHeaderViewController : UIViewController+@end++@interface YTIPageHeaderRenderer : GPBMessage+@end++@interface YTDefaultSheetController (YouMod)++ (instancetype)sheetControllerWithParentResponder:(id)parentResponder;+- (void)addAction:(YTActionSheetAction *)action;+- (void)presentFromView:(UIView *)view animated:(BOOL)animated completion:(void (^)(void))completion;+- (void)presentFromViewController:(UIViewController *)vc animated:(BOOL)animated completion:(void (^)(void))completion;+- (void)addHeaderWithTitle:(NSString *)arg1 subtitle:(NSString *)arg2;+@end++// Gesture Section Enum+typedef NS_ENUM(NSUInteger, GestureSection) {+ GestureSectionTop,+ GestureSectionBottom,+ GestureSectionInvalid+};++@interface YTWatchController (YouMod)+- (void)reload;+@end++@interface YTPlayerOverlayProvider (YouMod)+- (void)removePlayerOverlayWithIdentifier:(NSString *)identifier;+@end++@interface YTELMViewController : UIViewController+@end++@interface YTInlineScrubGestureView : UIView+@end++@interface YTPivotBarView : UIView+@end++@interface YTPivotBarItemView (YouMod) <UIContextMenuInteractionDelegate>+@end++@interface YTContextualWrapView : UIView+@end++@interface YTShortsAdsPlayerViewController : YTReelPlayerViewController+@end++@interface YTIBrowseRequest (YouMod)++ (NSString *)browseIDForGamingDestination;++ (NSString *)browseIDForSportsDestination;++ (NSString *)browseIDForNotificationsInbox;++ (NSString *)browseIDForHistory;+@end++@interface YTITopbarLogoRenderer : NSObject+@property(readonly, nonatomic) YTIIcon *iconImage;+@end++@interface YTRightNavigationButtons (YouMod)+@property (nonatomic, strong) YTQTMButton *notificationButton;+@property (nonatomic, strong) YTQTMButton *searchButton;+@end++@interface YTVideoFreeZoomOverlayController : NSObject+- (NSUInteger)state;+@end++@interface YTVideoFreeZoomOverlayView : UIView+@end++@interface YTMainAppVideoPlayerOverlayView (YouMod)+@property (nonatomic, weak, readwrite) YTMainAppVideoPlayerOverlayViewController *delegate;+@property (nonatomic, strong) YTQTMButton *playbackRouteButton;+- (YTVideoFreeZoomOverlayView *)videoFreeZoomOverlayView;+@end++@interface YTQTMButton (YouMod)+- (void)enableNewTouchFeedback;+@end++@interface YTHeaderView : UIView+- (void)setStickyNavHeaderEnabled:(BOOL)arg;+@end++@interface YTNavigationBarTitleView : UIView+@end++@interface YTSearchViewController : UIViewController+@end++@interface YTPlayabilityResolutionUserActionUIController : NSObject+- (void)confirmAlertDidPressConfirm;+@end++@interface YTPlayabilityResolutionUserActionUIControllerImpl : NSObject+- (void)confirmAlertDidPressConfirm;+@end++@interface YTPivotBarViewController : UIViewController+- (void)selectItemWithPivotIdentifier:(id)pivotIndentifier;+- (void)YouModReloadTabBar:(id)arg;+@end++@interface YTReelWatchPlaybackOverlayView : UIView <UIGestureRecognizerDelegate>+@property (nonatomic, retain) UIPinchGestureRecognizer *YouModFullscreenGesture;+@end++@interface YTReelContentView (YouMod) <UIGestureRecognizerDelegate>+@property (nonatomic, retain) UILongPressGestureRecognizer *YouModExitShortsOnlyGesture;+- (YTReelWatchPlaybackOverlayView *)playbackOverlay;+@end++@interface YTLanguages : NSObject++ (instancetype)languageList;+@end++@interface YTICaptionTrackEntry : GPBMessage+- (NSString *)baseURL;+- (NSString *)vssId;+- (NSString *)languageCode;+- (YTIFormattedString *)name;+@end++@interface YTPlayerViewController (YouMod) <UIGestureRecognizerDelegate>+@property (nonatomic, retain) UIPanGestureRecognizer *YouModPanGesture;+@property (nonatomic, retain) UITapGestureRecognizer *YouModTapGesture;+@property (nonatomic, retain) UILabel *YouModGestureHUD;+@property (nonatomic, weak, readwrite) UIViewController *parentViewController;+@property (nonatomic, assign, readonly) BOOL isInlinePlaybackActive;+@property (nonatomic, assign, readonly) BOOL isPlayingAd;+@property (nonatomic, strong) UIView *YouModSpeedToastView;+@property (nonatomic, strong) UILabel *YouModSpeedToastLabel;+@property (nonatomic, retain) UILongPressGestureRecognizer *YouModHoldGesture;+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;+- (void)YouModAutoFullscreen;+- (void)YouModSetAutoSpeed;+- (void)setPlaybackRate:(float)rate;+- (void)setActiveCaptionTrack:(MLInnerTubeCaptionTrack *)arg1 source:(NSInteger)arg2;+- (void)setActiveCaptionTrack:(MLInnerTubeCaptionTrack *)arg;+- (void)play;+- (void)pause;+- (void)YouModAutoMute;+- (void)YouModAutoAudioTrack;+- (void)YouModAutoCaptions;+- (void)YouModLoopButton;+- (void)YouModCaptionsHelper:(MLInnerTubeCaptionTrack *)arg;+- (void)YouModShareButton:(UIView *)sourceView;+- (NSInteger)playerState;+- (YTPlayerResponse *)contentPlayerResponse;+- (YTPlayerResponse *)playerResponse;+- (id)audioTrackController;+- (void)YouModHideSpeedToast;+- (void)YouModShowSpeedToast:(CGFloat)speed isLocked:(BOOL)isLocked;+- (void)YouModAutoDRCAudio;+- (void)setAudioTrack:(YTIAudioTrack *)arg1 source:(NSInteger)arg2;+- (void)setAudioDRCEnabled:(BOOL)arg;+@end++@interface YTPlayerBarController (YouMod)+- (void)didScrub:(UIPanGestureRecognizer *)gesture;+@end++@interface YTFullscreenEngagementOverlayView : UIView+@end++@interface YTFullscreenActionsView : UIView+@end++@interface YTAnnotationsViewController : UIViewController+@end++@interface YTRelatedVideosView : UIView+@end++@interface YTAutoplayAutonavController : NSObject+- (void)setLoopMode:(NSInteger)loopMode;+@end++@interface YTInlineMutedPlaybackPlayerOverlayViewController : UIViewController+@end++@interface YTInlineMutedPlaybackPlayerOverlayView : UIView+@end++@interface YTWatchFloatingMiniplayerViewController : UIViewController+@end++@interface YTWatchFloatingMiniplayerWithPersistentControlsView : UIView+@end++@interface YTWatchFloatingMiniplayerProgressBarView : UIView+@end++@interface SSOConfiguration : NSObject+@end++@interface ASDisplayNode (YouMod)+- (void)removeYogaChild:(id)arg;+@end++@interface YTIMySubsFilterHeaderRenderer : GPBMessage+@end++@interface YTMySubsFilterHeaderViewController : UIViewController+@end++@interface YTEngagementPanelView : UIView+@end++@interface YTEngagementPanelContainerView : UIView+- (NSInteger)engagementPanelState;+@end++@interface YTRelatedVideosViewController : UIViewController+- (BOOL)isExpanded;+@end++@interface YTMainAppControlsOverlayView (YouMod)+- (YTMainAppVideoPlayerOverlayViewController *)eventsDelegate;+@end++@interface YTVideoQualitySwitchOriginalController (YouMod)+@property (retain, nonatomic) YTVideoQualitySwitchRedesignedController *redesignedController;+@end++@interface UIView (YouMod)+@property (nonatomic, assign, readonly) BOOL _mapkit_isDarkModeEnabled;+- (UIViewController *)_viewControllerForAncestor;+@end++@interface UIKeyboard : UIView // Regular keyboard++ (instancetype)activeKeyboard;+@end++@interface UIPredictionViewController : UIViewController // Keyboard with enabled predictions panel+@end++@interface UIKeyboardDockView : UIView // Dock under keyboard for notched devices+@end++@interface UIKBVisualEffectView : UIVisualEffectView+@property (nonatomic, copy, readwrite) NSArray *backgroundEffects;+@end++@interface YTAppDelegate : UIResponder+- (void)YouModAutoClearCache;+@end++@interface YTInlinePlayerBarContainerView (YouMod)+@property (nonatomic, strong) NSString *endTimeString;+@end++// Custom perferences logics+@interface YouModPrefsManager : NSObject <UIDocumentPickerDelegate>++ (instancetype)sharedManager;+- (void)exportYouModSettingsFromVC:(UIViewController *)vc;+- (void)importYouModSettingsFromVC:(UIViewController *)vc;+- (void)restoreYouModDefaults;+@end++@interface YTIAudioTrack (YouMod)+@property (nonatomic, assign, readwrite) BOOL isAutoDubbed;+- (BOOL)hasId_p;+@end++@interface MLInnerTubeCaptionTrack (YouMod)+- (NSString *)languageCode;+- (NSString *)VSSID;+@end++@interface YTCaptionTrackSwitchController : NSObject+@end++@interface ASScrollView : UIScrollView+- (id)scrollNode;+@end++// Player Gestures - @bhackel (YTLitePlus)+@interface YTMainAppVideoPlayerOverlayViewController (YouMod)+@property (nonatomic, assign) YTPlayerViewController *parentViewController;+- (YTCaptionTrackSwitchController *)captionTrackController;+- (NSString *)videoID;+- (CGFloat)mediaTime;+@end++@interface YTSingleVideo (YouMod)+- (BOOL)isLivePlayback;+@end++@interface YTSingleVideoController (YouMod)+- (CGFloat)totalMediaTime;+- (void)setVideoFormatConstraint:(id)arg;+- (void)YouModAutoQuality;+- (NSArray *)availableCaptionTracks;+- (MLInnerTubeCaptionTrack *)activeCaptionTrack;+@end++@interface YTReelPlayerViewController (YouMod)+- (void)reelContentViewRequestsAdvanceToNextVideo:(id)arg;+- (void)reelContentViewRequestsPlayPauseToggle:(id)arg;+- (id)audioTrackController;+- (void)YouModAutoAudioTrack:(YTPlayerViewController *)pv;+@end++@interface YTIPlayerCaptionsTrackListRenderer : GPBMessage+- (NSMutableArray *)captionTracksArray;+@end++@interface YTICaptionsSupportedRenderers : GPBMessage+- (YTIPlayerCaptionsTrackListRenderer *)playerCaptionsTracklistRenderer;+@end++@interface YTIPlayerResponse (YouMod)+- (YTIStreamingData *)streamingData;+- (YTICaptionsSupportedRenderers *)captions;+@end++@interface YTIFormatStream (YouMod)+- (NSString *)mimeType;+- (NSInteger)contentLength;+- (NSUInteger)approxDurationMs;+- (int)height;+- (int)fps;+- (YTIAudioTrack *)audioTrack;+- (int)itag;+@end++@interface YTIFormattedString (YouMod)+- (NSString *)dropdownOptionTitle;+@end++@interface YTIVideoDetails (YouMod)+- (NSString *)title;+- (NSString *)author;+- (NSString *)shortDescription;+- (YTIThumbnailDetails *)thumbnail;+@end++@interface YTDataUtils : NSObject++ (instancetype)generateClientSideNonce;+@end++@interface YCHAsyncLiveChatCollectionViewController : UIViewController+@end++@interface YTStartupAnimationViewController : UIViewController+@end++@interface YTWatchFloatingMiniplayerBadgeView : UIView+@end++@interface YTInlineMutedPlaybackScrubberViewController : UIViewController+@end++@interface YTReelTopBarView : UIView+@end++// SponsorBlock action modes+typedef NS_ENUM(NSInteger, SBSegmentAction) {+ SBSegmentActionDisable = 0,+ SBSegmentActionAutoSkip = 1,+ SBSegmentActionAsk = 2,+ SBSegmentActionDisplay = 3,+ SBSegmentActionSkipTo = 4+};++@interface SBSegment : NSObject+@property (nonatomic, strong) NSString *UUID;+@property (nonatomic, strong) NSString *category;+@property (nonatomic, assign) float startTime;+@property (nonatomic, assign) float endTime;+@property (nonatomic, strong) NSString *actionType;++ (instancetype)segmentWithUUID:(NSString *)UUID category:(NSString *)category start:(float)start end:(float)end action:(NSString *)actionType;+- (SBSegmentAction)configuredAction;+- (UIColor *)segmentColor;+@end++@interface SBRequest : NSObject++ (void)fetchSegmentsForVideoID:(NSString *)videoID completion:(void (^)(NSArray<SBSegment *> *segments))completion;+@end++@interface SBSkipNotificationView : UIView+@property (nonatomic, strong) UILabel *messageLabel;+@property (nonatomic, strong) UIButton *actionButton;+@property (nonatomic, strong) UIView *progressOverlay;+@property (nonatomic, copy) void (^onAction)(void);+@property (nonatomic, assign) NSTimeInterval totalDuration;+@property (nonatomic, assign) NSTimeInterval remainingDuration;+@property (nonatomic, assign) BOOL isPaused;+@property (nonatomic, assign) BOOL isHighlightPill;+@property (nonatomic, strong) NSDate *backgroundDate;++ (instancetype)showInView:(UIView *)parentView message:(NSString *)message buttonTitle:(NSString *)buttonTitle action:(void (^)(void))action duration:(NSTimeInterval)duration;++ (instancetype)showDownloadCompleteDialogInView:(UIView *)parentView message:(NSString *)message saveHandler:(void (^)(void))saveHandler shareHandler:(void (^)(void))shareHandler duration:(NSTimeInterval)duration;++ (instancetype)showSuccessInView:(UIView *)parentView message:(NSString *)message duration:(NSTimeInterval)duration;++ (instancetype)showErrorInView:(UIView *)parentView message:(NSString *)message duration:(NSTimeInterval)duration;+- (void)dismiss;+- (void)pauseProgress;+- (void)resumeProgress;+@end++extern UIView *sbGetNotificationParent(void);+extern void sbUpdateOverlayInsetForPivotBar(void);+extern void YMPresentTabOrderModally(id parentResponder);++// The ordered set of SponsorBlock categories YouMod supports. Both the core+// (segment fetching / skipping) and the settings UI read from this single list,+// so a category can never be fetchable without a control, or configurable+// without being fetched.+extern NSArray<NSString *> *sbAllCategories(void);++// Tag stamped on every seek-bar segment marker view, used to find and remove+// them across the player-bar layout hooks that don't hold a direct reference.+static const NSInteger SBSegmentMarkerTag = 9900;++// Supported range and default for the skip/unskip banner duration (seconds).+// The settings sliders expose this range and the core clamps stored values to+// it, so both read from one source and can never drift out of agreement.+static const CGFloat SBAlertDurationMin = 2.0;+static const CGFloat SBAlertDurationMax = 20.0;+static const CGFloat SBAlertDurationDefault = 4.0;++#pragma mark - Custom Overlay Button Registry++// A registered button shown in the player's controls overlay (top-right, under+// YouTube's settings gear). Features register a spec from their own %ctor; the+// single YTMainAppControlsOverlayView hook in OverlayButtons.x lays them all out.+@interface YMOverlayButtonSpec : NSObject+@property (nonatomic, copy) NSString *identifier; // unique, e.g. @"sponsorblock.toggle"+@property (nonatomic, copy) NSString *symbolName; // SF Symbol name (icon button)+@property (nonatomic, copy) NSString *title; // text label; set this instead of symbolName for a text button+@property (nonatomic, copy) NSString *displayName; // localized display name for settings+@property (nonatomic, copy) NSString *settingsSymbolName; // custom symbol name for settings table view+@property (nonatomic, strong) UIColor *tintColor; // default tint (used if tintProvider is nil)+@property (nonatomic, assign) NSInteger sortOrder; // ascending; lower = closer to gear (rightmost)+@property (nonatomic, copy) void (^onTap)(YTPlayerViewController *player, YTQTMButton *button);+@property (nonatomic, copy) BOOL (^isVisible)(YTPlayerViewController *player); // nil = always visible+@property (nonatomic, copy) UIColor *(^tintProvider)(YTPlayerViewController *player); // nil = use tintColor+@property (nonatomic, assign) NSInteger viewTag; // assigned by the registry; do not set+@end++extern void YMRegisterOverlayButton(YMOverlayButtonSpec *spec);+extern NSArray<YMOverlayButtonSpec *> *YMRegisteredOverlayButtons(void);+extern NSArray<YMOverlayButtonSpec *> *YMOrderedOverlayButtons(void);+extern BOOL YMIsOverlayButtonEnabled(NSString *identifier);+extern void YMPushOverlayButtonOrder(id settingsVC, id parentResponder);++#pragma mark - Settings Search++// One row in the global settings-search results. A row renders its own cell and+// (optionally) handles its own tap, so a single results table can host cells from+// different settings pages (the generic YouMod pages and SponsorBlock) without the+// search controller knowing how any of them are built. searchText is what the query+// is matched against (title + description). makeCell builds the live, editable+// control; onSelect handles taps that need to present UI (e.g. the colour picker),+// receiving the presenting VC and a reload block to refresh the results.+@interface YMSearchRow : NSObject+@property (nonatomic, copy) NSString *searchText;+@property (nonatomic, copy) UITableViewCell *(^makeCell)(UITableView *tableView);+@property (nonatomic, assign) CGFloat cellHeight; // 0 = UITableViewAutomaticDimension+@property (nonatomic, copy) void (^onSelect)(UIViewController *presenter, void (^reload)(void));+@end++// SponsorBlock's searchable rows (toggles, sliders, per-category action pickers and+// colour circles), rendered by SponsorBlock's own cell builders so its settings are+// editable inline in the global search. host adopts the rendering VC as a child so+// the cells inherit the correct trait collection (light/dark). Defined in+// SponsorBlockSettings.x; consumed by the search VC in YouModSettings.x.+extern NSArray<YMSearchRow *> *sbSearchRows(UIViewController *host);++extern NSBundle *YouModBundle();+extern UIImage *YouModYTIconImage(NSInteger iconType, BOOL useCustomColor, UIColor *customColor);+extern NSArray *getAllSystemLanguageTitles();+extern NSArray *getAllSystemLanguageValues();+extern UIViewController *YouModTopViewController(UIViewController *root);+extern BOOL isDarkMode(UIView *view);+extern BOOL isPad();++#define LOC(x) [YouModBundle() localizedStringForKey:x value:nil table:nil]++@interface YMDownloadProgressView : UIView+@property (nonatomic, strong) UILabel *titleLabel;+@property (nonatomic, strong) UILabel *subtitleLabel;+@property (nonatomic, strong) UIProgressView *progressBar;+@property (nonatomic, strong) UIButton *cancelButton;+@property (nonatomic, copy) void (^onCancel)(void);++ (instancetype)showInView:(UIView *)parentView message:(NSString *)message cancelAction:(void (^)(void))cancelAction;+- (void)updateProgress:(float)progress title:(NSString *)title subtitle:(NSString *)subtitle;+- (void)dismiss;+@end++@interface YTPlayerViewController (SponsorBlock)+@property (nonatomic, strong) NSString *sbLastVideoID;+@property (nonatomic, strong) NSArray<SBSegment *> *sbSegments;+@property (nonatomic, strong) NSMutableSet<NSString *> *sbSkippedSegments;+@property (nonatomic, strong) SBSkipNotificationView *sbNotificationView;+- (void)sbCheckSegmentsAtCurrentTime;+- (void)sbPerformSkip:(SBSegment *)segment;+- (void)sbShowAskNotification:(SBSegment *)segment;+- (void)sbShowHighlightBannerIfNeeded:(NSArray<SBSegment *> *)segments;+- (void)sbSkipToHighlight;+- (void)sbRefreshMarkers:(NSArray<SBSegment *> *)segments;+@end++@interface YouModThumbnailViewController : UIViewController <UIScrollViewDelegate, UIGestureRecognizerDelegate>+@property (nonatomic, strong) UIImage *thumbnailImage;+@property (nonatomic, strong) UIScrollView *scrollView;+@property (nonatomic, strong) UIImageView *imageView;+@end++typedef NS_ENUM(NSInteger, YouModTranslationState) {+ YouModTranslationStateLoading = 0,+ YouModTranslationStateSuccess = 1,+ YouModTranslationStateFailed = 2+};++@interface YouModTranslationViewController : UIViewController+@property (nonatomic, copy) NSString *originalText;+@property (nonatomic, strong) UILabel *langValueLabel;+@property (nonatomic, strong) UIButton *reloadButton;+@property (nonatomic, strong) UITextView *resultTextView;+@property (nonatomic, copy) NSString *selectedLangCode;+@property (nonatomic, copy) NSString *selectedLangName;+@property (nonatomic, strong) NSArray<NSString *> *languageTitles;+@property (nonatomic, strong) NSArray<NSString *> *languageCodes;+@property (nonatomic, assign) YouModTranslationState translationState;+- (void)performTranslation;+@end++@interface YouModLanguagePickerViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, UIGestureRecognizerDelegate>+@property (nonatomic, copy) NSString *selectedLangCode;+@property (nonatomic, copy) NSArray<NSString *> *titles;+@property (nonatomic, copy) NSArray<NSString *> *codes;+@property (nonatomic, copy) void (^onSelectLanguage)(NSString *code, NSString *title);+@property (nonatomic, strong) UITableView *tableView;+@property (nonatomic, strong) UIView *containerView;+@end++// On-device SABR downloader (SABRDownload.x). Produces two elementary files (video+// mp4 + audio m4a) for the existing muxer; progress/completion on the main queue.+@interface YMSABR : NSObject++ (void)downloadVideoItag:(int)videoItag audioItag:(int)audioItag+ progress:(void (^)(float fraction, unsigned long long bytesDownloaded, BOOL isAudio))progress+ completion:(void (^)(NSURL *videoURL, NSURL *audioURL, NSString *err))completion;++ (void)downloadAudioItag:(int)audioItag+ progress:(void (^)(float fraction, unsigned long long bytesDownloaded))progress+ completion:(void (^)(NSURL *audioURL, NSString *err))completion;++ (void)cancelCurrent;+@enddiff --git a/vendor/YouMod/Files/Navbar.x b/vendor/YouMod/Files/Navbar.xnew file mode 100644index 0000000..a27c252--- /dev/null+++ b/vendor/YouMod/Files/Navbar.x@@ -0,0 +1,123 @@+#import "Headers.h"++// YouTube Premium logo+%hook YTHeaderLogoController+- (void)setTopbarLogoRenderer:(YTITopbarLogoRenderer *)renderer {+ if (INTFORVAL(YTLogoIndex) == 0) {+ %orig;+ return;+ }+ // Modify the type of the icon before setting the renderer+ YTIIcon *icon = renderer.iconImage;+ if (icon) {+ if (INTFORVAL(YTLogoIndex) == 1) {+ icon.iconType = 537;+ } else if (INTFORVAL(YTLogoIndex) == 2) {+ icon.iconType = 158;+ }+ }+ %orig(renderer);+}+// For when spoofing before 18.34.5+- (void)setPremiumLogo:(BOOL)arg {+ if (INTFORVAL(YTLogoIndex) == 1) {+ arg = YES;+ } else if (INTFORVAL(YTLogoIndex) == 2) {+ arg = NO;+ }+ %orig(arg);+}+- (BOOL)isPremiumLogo {+ if (INTFORVAL(YTLogoIndex) == 1) {+ return YES;+ } else if (INTFORVAL(YTLogoIndex) == 2) {+ return NO;+ }+ return %orig;+}+%end++%hook YTHeaderLogoControllerImpl+- (void)setTopbarLogoRenderer:(YTITopbarLogoRenderer *)renderer {+ if (INTFORVAL(YTLogoIndex) == 0) {+ %orig;+ return;+ }+ // Modify the type of the icon before setting the renderer+ YTIIcon *icon = renderer.iconImage;+ if (icon) {+ if (INTFORVAL(YTLogoIndex) == 1) {+ icon.iconType = 537;+ } else if (INTFORVAL(YTLogoIndex) == 2) {+ icon.iconType = 158;+ }+ }+ %orig(renderer);+}+// For when spoofing before 18.34.5+- (void)setPremiumLogo:(BOOL)arg {+ if (INTFORVAL(YTLogoIndex) == 1) {+ arg = YES;+ } else if (INTFORVAL(YTLogoIndex) == 2) {+ arg = NO;+ }+ %orig(arg);+}+- (BOOL)isPremiumLogo {+ if (INTFORVAL(YTLogoIndex) == 1) {+ return YES;+ } else if (INTFORVAL(YTLogoIndex) == 2) {+ return NO;+ }+ return %orig;+}+%end++// Hide Navigation Bar Buttons+%hook YTRightNavigationButtons+- (void)layoutSubviews {+ %orig;+ if (IS_ENABLED(HideNoti)) self.notificationButton.hidden = YES;+ if (IS_ENABLED(HideSearch)) self.searchButton.hidden = YES;+ for (UIView *subview in self.subviews) {+ if (IS_ENABLED(HideVoiceSearch) && [subview.accessibilityLabel isEqualToString:NSLocalizedString(@"search.voice.access", nil)]) subview.hidden = YES;+ if (IS_ENABLED(HideCastButtonNav) && [subview.accessibilityIdentifier isEqualToString:@"id.mdx.playbackroute.button"]) subview.hidden = YES;+ }+}+%end++%hook YTHeaderLogoController+- (id)init {+ return INTFORVAL(YTLogoIndex) == 3 ? nil : %orig;+}+%end++%hook YTHeaderLogoControllerImpl+- (id)init {+ return INTFORVAL(YTLogoIndex) == 3 ? nil : %orig;+}+%end++%hook YTNavigationBarTitleView+- (void)didMoveToWindow {+ %orig;+ if (INTFORVAL(YTLogoIndex) == 3) {+ for (UIView *sub in self.subviews) {+ if ([sub.accessibilityIdentifier isEqualToString:@"id.yoodle.logo"] || [sub.accessibilityIdentifier isEqualToString:@"id.youtube.logo"]) {+ [sub removeFromSuperview];+ break;+ }+ }+ }+}+%end++%hook YTHeaderView+- (BOOL)stickyNavHeaderEnabled {+ if (IS_ENABLED(StickyNavBar)) {+ [self setStickyNavHeaderEnabled:YES];+ return YES;+ }+ return %orig;+}+%end\ No newline at end of filediff --git a/vendor/YouMod/Files/Others.x b/vendor/YouMod/Files/Others.xnew file mode 100644index 0000000..760016e--- /dev/null+++ b/vendor/YouMod/Files/Others.x@@ -0,0 +1,214 @@+#import "Headers.h"++// Background playback+%hook MLVideo+- (BOOL)playableInBackground { return IS_ENABLED(BackgroundPlayback) ? YES : %orig; }+%end++%hook YTIPlayabilityStatus+- (BOOL)isPlayableInBackground { return IS_ENABLED(BackgroundPlayback) ? YES : %orig; }+%end++%hook YTPlaybackData+- (BOOL)isPlayableInBackground { return IS_ENABLED(BackgroundPlayback) ? YES : %orig; }+%end++%hook YTIPlayerResponse+- (BOOL)isPlayableInBackground { return IS_ENABLED(BackgroundPlayback) ? YES : %orig; }+%end++%hook YTColdConfig+// Try to disable Shorts PiP+- (BOOL)shortsPlayerGlobalConfigEnableReelsPictureInPicture { return IS_ENABLED(DisablesShortsPiP) ? NO : %orig; }+- (BOOL)shortsPlayerGlobalConfigEnableReelsPictureInPictureIos { return IS_ENABLED(DisablesShortsPiP) ? NO : %orig; }+// Hide startup animations+- (BOOL)mainAppCoreClientIosEnableStartupAnimation { return IS_ENABLED(HideStartupAni) ? NO : %orig; }+// Prevent YouTube from asking "Are you there?"+- (BOOL)enableYouthereCommandsOnIos { return IS_ENABLED(BlockUpgradeDialogs) ? NO : %orig; }+// Fixes slow miniplayer+- (BOOL)enableIosFloatingMiniplayerDoubleTapToResize { return IS_ENABLED(FixesSlowMiniPlayer) ? NO : %orig; }+// Use old miniplayer+- (BOOL)enableIosFloatingMiniplayer { return IS_ENABLED(DisablesNewMiniPlayer) ? NO : %orig; }+%end++%hook YTHotConfig+- (BOOL)shortsPlayerGlobalConfigEnableReelsPictureInPictureAllowedFromPlayer { return IS_ENABLED(DisablesShortsPiP) ? NO : %orig; }+%end++%hook YTReelModel+- (BOOL)isPiPSupported { return IS_ENABLED(DisablesShortsPiP) ? NO : %orig; }+%end++%hook YTReelPlayerViewController+- (BOOL)isPictureInPictureAllowed { return IS_ENABLED(DisablesShortsPiP) ? NO : %orig; }+- (void)setupPlayerForPiP { if (!IS_ENABLED(DisablesShortsPiP)) %orig; }+%end++%hook YTReelWatchRootViewController+- (void)switchToPictureInPicture { if (!IS_ENABLED(DisablesShortsPiP)) %orig; }+%end++// Disable Hints+%hook YTSettings+- (BOOL)areHintsDisabled { return IS_ENABLED(DisableHints) ? YES : %orig; }+- (void)setHintsDisabled:(BOOL)arg1 {+ BOOL temp = IS_ENABLED(DisableHints) ? YES : arg1;+ %orig(temp);+}+%end++%hook YTSettingsImpl+- (BOOL)areHintsDisabled { return IS_ENABLED(DisableHints) ? YES : %orig; }+- (void)setHintsDisabled:(BOOL)arg1 {+ BOOL temp = IS_ENABLED(DisableHints) ? YES : arg1;+ %orig(temp);+}+%end++%hook YTUserDefaults+- (BOOL)areHintsDisabled { return IS_ENABLED(DisableHints) ? YES : %orig; }+- (void)setHintsDisabled:(BOOL)arg1 {+ BOOL temp = IS_ENABLED(DisableHints) ? YES : arg1;+ %orig(temp);+}+%end++// Block upgrade dialogs+%hook YTGlobalConfig+- (BOOL)shouldBlockUpgradeDialog { return IS_ENABLED(BlockUpgradeDialogs) ? YES : %orig; }+- (BOOL)shouldShowUpgradeDialog { return IS_ENABLED(BlockUpgradeDialogs) ? NO : %orig; }+- (BOOL)shouldShowUpgrade { return IS_ENABLED(BlockUpgradeDialogs) ? NO : %orig; }+- (BOOL)shouldForceUpgrade { return IS_ENABLED(BlockUpgradeDialogs) ? NO : %orig; }+%end++%hook YTYouThereController+- (BOOL)shouldShowYouTherePrompt { return IS_ENABLED(HideAreYouThereDialog) ? NO : %orig; }+- (void)showYouTherePrompt { if (!IS_ENABLED(HideAreYouThereDialog)) %orig; }+%end++%hook YTYouThereControllerImpl+- (BOOL)shouldShowYouTherePrompt { return IS_ENABLED(HideAreYouThereDialog) ? NO : %orig; }+- (void)showYouTherePrompt { if (!IS_ENABLED(HideAreYouThereDialog)) %orig; }+%end++// Disables Snackbar+%hook GOOHUDManagerInternal+- (id)sharedInstance { return IS_ENABLED(DisablesSnackBar) ? nil : %orig; }+- (void)showMessageMainThread:(id)arg { if (!IS_ENABLED(DisablesSnackBar)) %orig; }+- (void)activateOverlay:(id)arg { if (!IS_ENABLED(DisablesSnackBar)) %orig; }+- (void)displayHUDViewForMessage:(id)arg { if (!IS_ENABLED(DisablesSnackBar)) %orig; }+%end++// Remove "Play next in queue" from the menu @PoomSmart (https://github.com/qnblackcat/uYouPlus/issues/1138#issuecomment-1606415080)+%hook YTMenuItemVisibilityHandler+- (BOOL)shouldShowServiceItemRenderer:(YTIMenuConditionalServiceItemRenderer *)renderer {+ int iconnum = renderer.icon.iconType;+ if (iconnum == 251 && IS_ENABLED(RemovePlayInNextQueueOption)) {+ return NO;+ }+ if (iconnum == 895 && IS_ENABLED(RemoveAddToLastQueueOption)) {+ return NO;+ }+ return %orig;+}+%end++%hook YTMenuItemVisibilityHandlerImpl+- (BOOL)shouldShowServiceItemRenderer:(YTIMenuConditionalServiceItemRenderer *)renderer {+ int iconnum = renderer.icon.iconType;+ if (iconnum == 251 && IS_ENABLED(RemovePlayInNextQueueOption)) {+ return NO;+ }+ if (iconnum == 895 && IS_ENABLED(RemoveAddToLastQueueOption)) {+ return NO;+ }+ return %orig;+}+%end++// Remove flyout menu options+%hook YTDefaultSheetController+- (void)addAction:(YTActionSheetAction *)action {+ UIButton *button = action.button;+ NSString *iden = button.accessibilityIdentifier;+ NSString *imageName = [button.currentImage description];++ // Method 1: Filter from accessibilityIdentifier+ NSDictionary *actionsToRemove = @{+ @"7": @(IS_ENABLED(RemoveDownloadOption)),+ @"1": @(IS_ENABLED(RemoveWatchLaterOption)),+ @"3": @(IS_ENABLED(RemoveSaveOption)),+ @"4": @(IS_ENABLED(RemoveRemoveFromPlaylistOption)),+ @"5": @(IS_ENABLED(RemoveShareOption)),+ @"6": @(IS_ENABLED(RemoveShareOption)),+ @"12": @(IS_ENABLED(RemoveNotInterestedOption)),+ @"22": @(IS_ENABLED(RemoveInfoOption)),+ @"36": @(IS_ENABLED(RemoveFilterOption)),+ @"40": @(IS_ENABLED(RemoveNotifyOption)),+ @"58": @(IS_ENABLED(RemoveReportOption))+ };+ if ([actionsToRemove[iden] boolValue]) return;++ // Method 2: Filter from imageName+ NSDictionary *imageNameToRemove = @{+ @"youtube_music": @(IS_ENABLED(RemoveYouTubeMusicOption)),+ @"flag": @(IS_ENABLED(RemoveReportOption)),+ @"alert_bubble": @(IS_ENABLED(RemoveFeedBackOption)),+ @"bookmark": @(IS_ENABLED(RemoveSaveOption)),+ @"circle_slash": @(IS_ENABLED(RemoveNotInterestedOption)),+ @"x_circle": @(IS_ENABLED(RemoveDontRecommendOption)),+ @"chromecast": @(IS_ENABLED(RemoveCastOption)),+ @"shuffle": @(IS_ENABLED(RemoveShuffleOption)),+ @"person_x": @(IS_ENABLED(RemoveUnSubOption)),+ @"help_circle": @(IS_ENABLED(RemoveHelpOption)),+ @"eye_slash": @(IS_ENABLED(RemoveHideFromPlaylistOption)),+ @"player_full_enter_alt": @(IS_ENABLED(RemoveClearScreenOption)),+ @"info_circle": @(IS_ENABLED(RemoveInfoOption))+ };+ for (NSString *key in imageNameToRemove) {+ if ([imageName containsString:key]) {+ if ([imageNameToRemove[key] boolValue]) {+ return;+ }+ break;+ }+ }+ %orig;+}+%end++// YTSlientVote (https://github.com/PoomSmart/YTSilentVote)+%hook YTInnerTubeResponseWrapper+- (id)initWithResponse:(id)response cacheContext:(id)arg2 requestStatistics:(id)arg3 mutableSharedData:(id)arg4 {+ if (!IS_ENABLED(HideLikeDislikeVotes)) return %orig;+ if ([response isKindOfClass:%c(YTILikeResponse)]+ || [response isKindOfClass:%c(YTIDislikeResponse)]+ || [response isKindOfClass:%c(YTIRemoveLikeResponse)]) return nil;+ return %orig;+}+%end++%hook NSParagraphStyle++ (NSWritingDirection)defaultWritingDirectionForLanguage:(id)lang { return IS_ENABLED(DisablesRTL) ? NSWritingDirectionLeftToRight : %orig; }++ (NSWritingDirection)_defaultWritingDirection { return IS_ENABLED(DisablesRTL) ? NSWritingDirectionLeftToRight : %orig; }+%end++%hook UIDevice+- (UIUserInterfaceIdiom)userInterfaceIdiom {+ if (INTFORVAL(DeviceUIIndex) == 1) {+ return UIUserInterfaceIdiomPad;+ }+ if (INTFORVAL(DeviceUIIndex) == 2) {+ return UIUserInterfaceIdiomPhone;+ }+ return %orig;+}+%end++%hook UIKeyboardImpl++ (BOOL)isFloating { return IS_ENABLED(FloatingKeyboard) && isPad() ? YES : %orig; }+%end++%hook YTEngagementPanelHeaderView+- (void)setSubheader:(UIView *)view { if (!IS_ENABLED(HideEngagementSubbar)) %orig; }+%end\ No newline at end of filediff --git a/vendor/YouMod/Files/OverlayButtons.x b/vendor/YouMod/Files/OverlayButtons.xnew file mode 100644index 0000000..4693ecb--- /dev/null+++ b/vendor/YouMod/Files/OverlayButtons.x@@ -0,0 +1,656 @@+#import "Headers.h"++static NSString *YouModUpdateSpeedLabel = @"YouModUpdateSpeedLabel";+static NSString *currentSpeedLabel = @"1x";+static float currentPlaybackRate = 1.0;++static NSString *YouModUpdateNotification = @"YouModUpdateNotification";+static NSString *currentQualityLabel = @"Auto";++static NSString *speedLabel(float rate) {+ NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];+ formatter.numberStyle = NSNumberFormatterDecimalStyle;+ formatter.minimumFractionDigits = 0;+ formatter.maximumFractionDigits = 2;+ NSString *rateString = [formatter stringFromNumber:[NSNumber numberWithFloat:rate]];+ return [NSString stringWithFormat:@"%@x", rateString];+}++static void didSelectRate(float rate) {+ currentPlaybackRate = rate;+ currentSpeedLabel = speedLabel(rate);+ [[NSNotificationCenter defaultCenter] postNotificationName:YouModUpdateSpeedLabel object:nil];+}++@interface YTMainAppControlsOverlayView ()+- (void)updateQualityButton:(id)arg;+- (void)updateSpeedButton:(id)arg;+@end++// YouGetCaption (https://github.com/PoomSmart/YouGetCaption)+static void showTranscript(YTFormat3CaptionViewController *cvc) {+ UIView *parent = sbGetNotificationParent();+ MLFormat3Captions *currentCaptions = [cvc valueForKey:@"_currentCaptions"];+ YTIntervalTree *tree = currentCaptions.captions;+ NSMutableString *transcript = [NSMutableString string];+ [tree enumerateAllIntervalsWithBlock:^(YTInterval *interval) {+ MLCaption *caption = (MLCaption *)interval;+ NSArray <MLCaptionSegment *> *segments = caption.segments;+ for (MLCaptionSegment *segment in segments) {+ [transcript appendString:segment.text];+ }+ }];+ if (transcript.length == 0) {+ [SBSkipNotificationView showErrorInView:parent message:LOC(@"NO_CAPTIONS") duration:4.0];+ return;+ }+ YTAlertView *alertView = [%c(YTAlertView) confirmationDialogWithAction:^{+ UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];+ pasteboard.string = transcript;+ [SBSkipNotificationView showSuccessInView:parent message:LOC(@"COPIED_TO_CLIPBOARD") duration:3.0];+ } actionTitle:LOC(@"COPY")];+ alertView.title = nil;+ alertView.subtitle = transcript;+ alertView.shouldDismissOnBackgroundTap = YES;+ [alertView show];+}++#pragma mark - YMOverlayButtonSpec++@implementation YMOverlayButtonSpec+@end++#pragma mark - Registry++// Base of the view-tag range for registered overlay buttons. Chosen to avoid+// colliding with other tagged views in the player overlay (e.g. the seek-bar+// segment markers at 9900).+static const NSInteger YMOverlayButtonBaseTag = 9910;++// Button geometry. The top inset places the row just below YouTube's own+// CC/gear row in the top-right corner of the player overlay.+static const CGFloat YMOverlayButtonSize = 30.0;+static const CGFloat YMOverlayButtonGap = 6.0;+static const CGFloat YMOverlayButtonTopInset = 52.0; // fallback row top when the gear can't be located+static const CGFloat YMOverlayButtonEdgePadding = 12.0; // fallback right padding when the gear isn't found++// Width of a text button. Tweak this to make text buttons wider or narrower; icon+// buttons stay square at YMOverlayButtonSize.+static const CGFloat YMOverlayTextButtonWidth = 30.0;++static NSMutableArray<YMOverlayButtonSpec *> *gOverlayButtons = nil;+static NSInteger gOverlayButtonNextTag = YMOverlayButtonBaseTag;++void YMRegisterOverlayButton(YMOverlayButtonSpec *spec) {+ if (!spec || spec.identifier.length == 0) return;+ static dispatch_once_t once;+ dispatch_once(&once, ^{ gOverlayButtons = [NSMutableArray array]; });++ // Replace any previous registration with the same identifier (idempotent).+ for (YMOverlayButtonSpec *existing in [gOverlayButtons copy]) {+ if ([existing.identifier isEqualToString:spec.identifier]) {+ spec.viewTag = existing.viewTag;+ [gOverlayButtons removeObject:existing];+ }+ }+ if (spec.viewTag == 0) spec.viewTag = gOverlayButtonNextTag++;+ [gOverlayButtons addObject:spec];+}++NSArray<YMOverlayButtonSpec *> *YMRegisteredOverlayButtons(void) {+ if (!gOverlayButtons) return @[];+ return [gOverlayButtons sortedArrayUsingComparator:^NSComparisonResult(YMOverlayButtonSpec *a, YMOverlayButtonSpec *b) {+ if (a.sortOrder == b.sortOrder) return [a.identifier compare:b.identifier];+ return a.sortOrder < b.sortOrder ? NSOrderedAscending : NSOrderedDescending;+ }];+}++BOOL YMIsOverlayButtonEnabled(NSString *identifier) {+ if (!identifier || identifier.length == 0) return NO;+ if ([identifier isEqualToString:@"download.video"] && !IS_ENABLED(DownloadManager)) return NO;+ if ([identifier isEqualToString:@"sponsorblock.toggle"] && !IS_ENABLED(SBEnabled)) return NO;+ NSArray *savedOrder = [[NSUserDefaults standardUserDefaults] arrayForKey:OverlayButtonOrder];+ if (savedOrder.count > 0) {+ for (NSDictionary *entry in savedOrder) {+ if ([entry[@"id"] isEqualToString:identifier]) {+ return [entry[@"enabled"] boolValue];+ }+ }+ return YES;+ }+ // Fallback migration for legacy keys if custom order is not saved yet+ if ([identifier isEqualToString:@"mute.video"]) return IS_ENABLED(MuteButton);+ if ([identifier isEqualToString:@"speed.video"]) return IS_ENABLED(SpeedButton);+ if ([identifier isEqualToString:@"quality.video"]) return IS_ENABLED(QualityButton);+ if ([identifier isEqualToString:@"share.video"]) return IS_ENABLED(ShareButton);+ if ([identifier isEqualToString:@"loop.video"]) return IS_ENABLED(LoopButton);+ if ([identifier isEqualToString:@"caption.video"]) return IS_ENABLED(CaptionButton);+ if ([identifier isEqualToString:@"download.video"]) return IS_ENABLED(DownloadManager);+ if ([identifier isEqualToString:@"sponsorblock.toggle"]) return IS_ENABLED(SBEnabled) && IS_ENABLED(SBShowButton);+ return YES;+}++NSArray<YMOverlayButtonSpec *> *YMOrderedOverlayButtons(void) {+ if (!gOverlayButtons || gOverlayButtons.count == 0) return @[];++ NSMutableDictionary<NSString *, YMOverlayButtonSpec *> *lookup = [NSMutableDictionary dictionary];+ for (YMOverlayButtonSpec *spec in gOverlayButtons) {+ if (spec.identifier) lookup[spec.identifier] = spec;+ }++ NSArray *savedOrder = [[NSUserDefaults standardUserDefaults] arrayForKey:OverlayButtonOrder];+ NSMutableArray<YMOverlayButtonSpec *> *ordered = [NSMutableArray array];++ if (savedOrder.count > 0) {+ for (NSDictionary *entry in savedOrder) {+ NSString *ident = entry[@"id"];+ BOOL enabled = [entry[@"enabled"] boolValue];+ if (!enabled) continue;+ YMOverlayButtonSpec *spec = lookup[ident];+ if (spec) [ordered addObject:spec];+ }+ // Append any registered specs not present in savedOrder+ for (YMOverlayButtonSpec *spec in YMRegisteredOverlayButtons()) {+ BOOL found = NO;+ for (NSDictionary *entry in savedOrder) {+ if ([entry[@"id"] isEqualToString:spec.identifier]) {+ found = YES;+ break;+ }+ }+ if (!found) {+ [ordered addObject:spec];+ }+ }+ } else {+ for (YMOverlayButtonSpec *spec in YMRegisteredOverlayButtons()) {+ if (YMIsOverlayButtonEnabled(spec.identifier)) {+ [ordered addObject:spec];+ }+ }+ }++ return ordered;+}++#pragma mark - Helpers++// The player view controller that owns this controls overlay, reached through the+// overlay's events delegate. Button handlers use it to act on the current video.+static YTPlayerViewController *YMPlayerVCFromOverlay(YTMainAppControlsOverlayView *overlay) {+ YTMainAppVideoPlayerOverlayViewController *mainOverlayController = (YTMainAppVideoPlayerOverlayViewController *)overlay.eventsDelegate;+ return mainOverlayController.parentViewController;+}++// Recursively find the right-most YTQTMButton in the overlay's top region. YouTube+// nests the gear/CC/cast buttons inside a container, so a one-level scan would miss+// them; recursion reaches the nested buttons wherever they sit.+static void YMScanForGearFrame(UIView *view, YTMainAppControlsOverlayView *overlay, CGFloat topRegionMaxY, CGRect *bestFrame) {+ for (UIView *sub in view.subviews) {+ if ([sub isKindOfClass:%c(YTQTMButton)]) {+ CGRect f = [sub convertRect:sub.bounds toView:overlay];+ if (CGRectGetMidY(f) <= topRegionMaxY) { // in the top button row+ // The CGRectIsNull check must stay first: CGRectGetMidX(CGRectNull) is+ // infinite, so the > comparison alone would never accept the first match.+ if (CGRectIsNull(*bestFrame) || CGRectGetMidX(f) > CGRectGetMidX(*bestFrame)) *bestFrame = f;+ }+ }+ YMScanForGearFrame(sub, overlay, topRegionMaxY, bestFrame);+ }+}++// Find YouTube's settings/overflow button so we can anchor our row directly beneath it.+// Prefer the overlay's own overflowButton; otherwise take the right-most YTQTMButton in+// the overlay's top region. Returns its frame in the overlay's coordinate space, or+// CGRectNull if not found (the caller then falls back to the screen edge / top inset).+static CGRect YMGearFrameInOverlay(YTMainAppControlsOverlayView *overlay) {+ YTQTMButton *overflow = [overlay valueForKey:@"_overflowButton"];+ if (overflow.window) {+ return [overflow convertRect:overflow.bounds toView:overlay];+ }++ CGFloat topRegionMaxY = overlay.bounds.size.height * 0.25;+ CGRect bestFrame = CGRectNull;+ YMScanForGearFrame(overlay, overlay, topRegionMaxY, &bestFrame);+ return bestFrame;+}++// The font for a text button's label, in YouTube Sans to match native controls,+// with a plain system-font fallback on versions lacking the YouTube Sans style API.+static UIFont *YMOverlayTextButtonFont(NSString *text, CGSize maxSize) {+ if (text.length == 0) return [UIFont systemFontOfSize:15 weight:UIFontWeightSemibold];++ YTDefaultTypeStyle *typeStyle = [%c(YTTypeStyle) defaultTypeStyle];+ BOOL hasYTFont = [typeStyle respondsToSelector:@selector(ytSansFontOfSize:weight:)];+ NSInteger bestSize = 10;++ for (NSInteger size = (NSInteger)maxSize.height; size >= 8; size--) {+ UIFont *testFont = hasYTFont ? [typeStyle ytSansFontOfSize:(CGFloat)size weight:UIFontWeightSemibold] : [UIFont systemFontOfSize:(CGFloat)size weight:UIFontWeightSemibold];+ CGRect rect = [text boundingRectWithSize:CGSizeMake(maxSize.width, CGFLOAT_MAX)+ options:NSStringDrawingUsesLineFragmentOrigin+ attributes:@{NSFontAttributeName: testFont}+ context:nil];+ if (ceil(rect.size.width) <= maxSize.width && ceil(rect.size.height) <= maxSize.height) {+ bestSize = size;+ break;+ }+ }+ return hasYTFont ? [typeStyle ytSansFontOfSize:(CGFloat)bestSize weight:UIFontWeightSemibold] : [UIFont systemFontOfSize:(CGFloat)bestSize weight:UIFontWeightSemibold];+}++static YTQTMButton *YMCreateOverlayButton(YTMainAppControlsOverlayView *overlay, YMOverlayButtonSpec *spec) {+ YTQTMButton *button;+ UIColor *tint = spec.tintColor ?: [UIColor whiteColor];++ if (spec.title.length > 0) {+ // Text button: a label instead of an icon. customTitleColor is YTQTMButton's+ // own text-colour channel; sizeWithPaddingAndInsets is disabled so the width+ // stays fixed rather than expanding to fit the text.+ button = [%c(YTQTMButton) textButton];+ [button setTitle:spec.title forState:UIControlStateNormal];+ button.customTitleColor = tint;+ button.titleLabel.font = YMOverlayTextButtonFont(spec.title, CGSizeMake(25, 25));+ button.titleLabel.textAlignment = NSTextAlignmentCenter;+ button.sizeWithPaddingAndInsets = NO;+ button.titleLabel.numberOfLines = 2;+ button.titleLabel.adjustsFontSizeToFitWidth = YES;+ button.titleLabel.lineBreakMode = NSLineBreakByClipping;+ button.titleLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters;+ button.contentEdgeInsets = UIEdgeInsetsZero;+ button.titleEdgeInsets = UIEdgeInsetsZero;+ button.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;+ button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;+ } else {+ UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:20 weight:UIImageSymbolWeightMedium];+ // Template rendering so YTQTMButton's tint colours the glyph reliably.+ UIImage *icon = [[UIImage systemImageNamed:spec.symbolName withConfiguration:config] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];+ button = [%c(YTQTMButton) iconButton];+ [button setImage:icon forState:UIControlStateNormal];+ button.tintColor = tint;+ button.imageView.contentMode = UIViewContentModeScaleAspectFit;+ }++ button.exclusiveTouch = YES;+ button.tag = spec.viewTag;+ // The row's frame is assigned authoritatively in layoutSubviews.+ button.frame = CGRectMake(0, 0, YMOverlayButtonSize, YMOverlayButtonSize);+ [button enableNewTouchFeedback];+ [button addTarget:overlay action:@selector(ymOverlayButtonTapped:) forControlEvents:UIControlEventTouchUpInside];+ [overlay addSubview:button];+ return button;+}++#pragma mark - YTMainAppControlsOverlayView Hook++static BOOL isRelatedVideosExpanded = NO;++%hook YTMainAppControlsOverlayView++- (void)layoutSubviews {+ %orig;+ NSArray<YMOverlayButtonSpec *> *allRegistered = YMRegisteredOverlayButtons();+ NSArray<YMOverlayButtonSpec *> *specs = YMOrderedOverlayButtons();++ NSMutableSet<NSNumber *> *activeTags = [NSMutableSet set];+ for (YMOverlayButtonSpec *spec in specs) {+ [activeTags addObject:@(spec.viewTag)];+ }+ for (YMOverlayButtonSpec *spec in allRegistered) {+ if (![activeTags containsObject:@(spec.viewTag)]) {+ UIView *btn = [self viewWithTag:spec.viewTag];+ if (btn) [btn removeFromSuperview];+ }+ }++ if (specs.count == 0) return;++ YTPlayerViewController *player = YMPlayerVCFromOverlay(self);+ YTSingleVideoController *sgvid = player.activeVideo;+ YTSingleVideo *sgvid2 = sgvid.singleVideo;+ BOOL isLive = [sgvid2 isLivePlayback];+ BOOL overlayVisible = self.isOverlayVisible;+ CGRect gearFrame = YMGearFrameInOverlay(self);+ BOOL hasGear = !CGRectIsNull(gearFrame);+ CGFloat trailingCenterX = hasGear ? CGRectGetMidX(gearFrame) : self.bounds.size.width - YMOverlayButtonEdgePadding - YMOverlayButtonSize / 2.0;+ CGFloat rowTop = hasGear ? CGRectGetMaxY(gearFrame) : YMOverlayButtonTopInset;+ CGFloat prevHalfWidth = 0;++ for (YMOverlayButtonSpec *spec in specs) {+ BOOL isHiddenOnLive = isLive && ([spec.identifier isEqualToString:@"sponsorblock.toggle"] ||+ [spec.identifier isEqualToString:@"loop.video"] ||+ [spec.identifier isEqualToString:@"caption.video"]);+ BOOL visible = !isHiddenOnLive && ((spec.isVisible == nil) || spec.isVisible(player));+ YTQTMButton *btn = (YTQTMButton *)[self viewWithTag:spec.viewTag];++ if (!visible) {+ if (btn) [btn removeFromSuperview];+ continue;+ }+ if (!btn) btn = YMCreateOverlayButton(self, spec);++ btn.hidden = !overlayVisible || isRelatedVideosExpanded;++ if (spec.tintProvider) {+ UIColor *dynamic = spec.tintProvider(player);+ if (spec.title.length > 0) btn.customTitleColor = dynamic;+ else btn.tintColor = dynamic;+ }++ CGFloat width = (spec.title.length > 0) ? YMOverlayTextButtonWidth : YMOverlayButtonSize;+ CGFloat centerX = (prevHalfWidth == 0) ? trailingCenterX : trailingCenterX - prevHalfWidth - YMOverlayButtonGap - width / 2.0;++ btn.frame = CGRectMake(centerX - width / 2.0, rowTop, width, YMOverlayButtonSize);+ trailingCenterX = centerX;+ prevHalfWidth = width / 2.0;+ [self bringSubviewToFront:btn];+ }+}++- (void)setOverlayVisible:(BOOL)visible {+ %orig;+ for (YMOverlayButtonSpec *spec in YMRegisteredOverlayButtons()) {+ YTQTMButton *btn = (YTQTMButton *)[self viewWithTag:spec.viewTag];+ if (btn) btn.hidden = !visible || isRelatedVideosExpanded;+ }+}++%new+- (void)ymOverlayButtonTapped:(YTQTMButton *)sender {+ YMOverlayButtonSpec *matched = nil;+ for (YMOverlayButtonSpec *spec in YMRegisteredOverlayButtons()) {+ if (spec.viewTag == sender.tag) { matched = spec; break; }+ }+ if (!matched || !matched.onTap) return;++ YTPlayerViewController *player = YMPlayerVCFromOverlay(self);+ matched.onTap(player, sender);+}++%new+- (void)ymUpdateOverlayButtons:(id)arg {+ [self setNeedsLayout];+}++- (id)initWithDelegate:(id)delegate {+ self = %orig;+ [self updateSpeedButton:nil];+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateSpeedButton:) name:YouModUpdateSpeedLabel object:nil];+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateQualityButton:) name:YouModUpdateNotification object:nil];+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ymUpdateOverlayButtons:) name:@"YouModUpdateOverlayButtons" object:nil];+ return self;+}++- (id)initWithDelegate:(id)delegate autoplaySwitchEnabled:(BOOL)autoplaySwitchEnabled {+ self = %orig;+ [self updateSpeedButton:nil];+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateSpeedButton:) name:YouModUpdateSpeedLabel object:nil];+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateQualityButton:) name:YouModUpdateNotification object:nil];+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ymUpdateOverlayButtons:) name:@"YouModUpdateOverlayButtons" object:nil];+ return self;+}++- (void)dealloc {+ [[NSNotificationCenter defaultCenter] removeObserver:self name:YouModUpdateSpeedLabel object:nil];+ [[NSNotificationCenter defaultCenter] removeObserver:self name:YouModUpdateNotification object:nil];+ [[NSNotificationCenter defaultCenter] removeObserver:self name:@"YouModUpdateOverlayButtons" object:nil];+ %orig;+}++%new+- (void)updateSpeedButton:(id)arg {+ for (YMOverlayButtonSpec *spec in YMRegisteredOverlayButtons()) {+ if ([spec.identifier isEqualToString:@"speed.video"]) {+ spec.title = currentSpeedLabel;++ YTQTMButton *btn = (YTQTMButton *)[self viewWithTag:spec.viewTag];+ if (btn) {+ [btn setTitle:currentSpeedLabel forState:UIControlStateNormal];+ btn.titleLabel.font = YMOverlayTextButtonFont(currentSpeedLabel, CGSizeMake(25, 25));+ }+ break;+ }+ }+}++%new+- (void)updateQualityButton:(id)arg {+ for (YMOverlayButtonSpec *spec in YMRegisteredOverlayButtons()) {+ if ([spec.identifier isEqualToString:@"quality.video"]) {+ spec.title = currentQualityLabel;++ YTQTMButton *btn = (YTQTMButton *)[self viewWithTag:spec.viewTag];+ if (btn) {+ [btn setTitle:currentQualityLabel forState:UIControlStateNormal];+ btn.titleLabel.font = YMOverlayTextButtonFont(currentQualityLabel, CGSizeMake(25, 25));+ }+ break;+ }+ }+}+%end++%hook YTRelatedVideosViewController+- (void)setExpanded:(BOOL)arg {+ %orig;+ isRelatedVideosExpanded = arg;+ YTRelatedVideosView *relatedview = (YTRelatedVideosView *)self.view;+ YTFullscreenEngagementOverlayView *fullov = (YTFullscreenEngagementOverlayView *)relatedview.superview;+ YTMainAppVideoPlayerOverlayView *mainov = (YTMainAppVideoPlayerOverlayView *)fullov.superview;+ YTMainAppControlsOverlayView *conov = [mainov controlsOverlayView];+ [conov setNeedsLayout];+}+%end++static void YouModShowShareNotification(NSString *message, BOOL success) {+ UIView *parent = sbGetNotificationParent();+ if (success) {+ [SBSkipNotificationView showSuccessInView:parent message:message duration:3.0];+ } else {+ [SBSkipNotificationView showErrorInView:parent message:message duration:4.0];+ }+}++%hook YTPlayerViewController+%new+- (void)YouModShareButton:(UIView *)sourceView {+ if (!self.currentVideoID) {+ YouModShowShareNotification(LOC(@"ERROR_VIDEOID"), NO);+ return;+ } else if (self.isPlayingAd) {+ YouModShowShareNotification(LOC(@"ERROR_ADS"), NO);+ return;+ }++ NSString *videoURL = [NSString stringWithFormat:@"https://youtube.com/watch?v=%@", self.currentVideoID];+ NSInteger seconds = (NSInteger)floor(self.currentVideoMediaTime);+ NSString *timestampURL = [NSString stringWithFormat:@"%@&t=%lds", videoURL, (long)seconds];++ UIViewController *presenter = (UIViewController *)[self activeVideoPlayerOverlay];+ YTDefaultSheetController *sheet = [%c(YTDefaultSheetController) sheetControllerWithParentResponder:presenter];++ YTActionSheetAction *copyURL = [%c(YTActionSheetAction) actionWithTitle:LOC(@"COPY_URL") iconImage:YouModYTIconImage(250, NO, nil) style:0 handler:^(__unused YTActionSheetAction *action) {+ UIPasteboard.generalPasteboard.string = videoURL;+ YouModShowShareNotification(LOC(@"URL_COPIED"), YES);+ }];++ YTActionSheetAction *copyTimestamp = [%c(YTActionSheetAction) actionWithTitle:LOC(@"COPY_URL_TIMESTAMP") iconImage:YouModYTIconImage(250, NO, nil) style:0 handler:^(__unused YTActionSheetAction *action) {+ UIPasteboard.generalPasteboard.string = timestampURL;+ YouModShowShareNotification(LOC(@"URL_TIMESTAMP_COPIED"), YES);+ }];++ [sheet addAction:copyURL];+ [sheet addAction:copyTimestamp];++ [sheet presentFromView:sourceView animated:YES completion:nil];+}+%new+- (void)YouModLoopButton {+ YTMainAppVideoPlayerOverlayViewController *playerOverlay = self.activeVideoPlayerOverlay;+ YTAutoplayAutonavController *autoplayController = [playerOverlay valueForKey:@"_autonavController"];+ BOOL isLoopEnabled = !IS_ENABLED(KeepLoopKey);+ [[NSUserDefaults standardUserDefaults] setBool:isLoopEnabled forKey:KeepLoopKey];+ [autoplayController setLoopMode:isLoopEnabled ? 2 : 0];+ YouModShowShareNotification(LOC(isLoopEnabled ? @"LOOP_ENABLED" : @"LOOP_DISABLED"), YES);+}+- (void)setPlaybackRate:(float)rate {+ didSelectRate(rate);+ %orig;+}+%end++%hook YTAutoplayAutonavController+- (id)initWithParentResponder:(id)arg {+ self = %orig;+ if (self && IS_ENABLED(KeepLoopKey)) {+ [self setLoopMode:2];+ }+ return self;+}+- (void)setLoopMode:(NSInteger)arg {+ NSInteger set = IS_ENABLED(KeepLoopKey) ? 2 : arg;+ %orig(set);+}+%end++static NSString *getCompactQualityLabel(MLFormat *format) {+ NSString *qualityLabel = [format qualityLabel];+ BOOL shouldShowFPS = [format FPS] > 30;+ if ([qualityLabel hasPrefix:@"2160p"])+ qualityLabel = [qualityLabel stringByReplacingOccurrencesOfString:@"2160p" withString:@"4K"];+ else if ([qualityLabel hasPrefix:@"1440p"])+ qualityLabel = [qualityLabel stringByReplacingOccurrencesOfString:@"1440p" withString:@"2K"];+ else if ([qualityLabel hasPrefix:@"1080p"])+ qualityLabel = [qualityLabel stringByReplacingOccurrencesOfString:@"1080p" withString:@"FHD"];+ else if ([qualityLabel hasPrefix:@"720p"])+ qualityLabel = [qualityLabel stringByReplacingOccurrencesOfString:@"720p" withString:@"HD"];+ else if (shouldShowFPS)+ qualityLabel = [qualityLabel stringByReplacingOccurrencesOfString:@"p" withString:@""];+ if ([qualityLabel hasSuffix:@" HDR"])+ qualityLabel = [qualityLabel stringByReplacingOccurrencesOfString:@" HDR" withString:@"\nHDR"];+ return qualityLabel;+}++%hook YTVideoQualitySwitchOriginalController++- (void)singleVideo:(id)singleVideo didSelectVideoFormat:(MLFormat *)format {+ currentQualityLabel = getCompactQualityLabel(format);+ [[NSNotificationCenter defaultCenter] postNotificationName:YouModUpdateNotification object:nil];+ %orig;+}++%end++%hook YTVideoQualitySwitchRedesignedController++- (void)singleVideo:(id)singleVideo didSelectVideoFormat:(MLFormat *)format {+ currentQualityLabel = getCompactQualityLabel(format);+ [[NSNotificationCenter defaultCenter] postNotificationName:YouModUpdateNotification object:nil];+ %orig;+}++%end++%ctor {+ YMOverlayButtonSpec *mute = [[YMOverlayButtonSpec alloc] init];+ mute.identifier = @"mute.video";+ mute.symbolName = IS_ENABLED(KeepMutedKey) ? @"speaker.slash" : @"speaker.wave.2";+ mute.settingsSymbolName = @"speaker.wave.2";+ mute.displayName = LOC(@"MUTE_BUTTON");+ mute.tintColor = [UIColor whiteColor];+ mute.sortOrder = 300;+ mute.isVisible = ^BOOL(YTPlayerViewController *player) {+ return YMIsOverlayButtonEnabled(@"mute.video");+ };+ mute.onTap = ^(YTPlayerViewController *player, YTQTMButton *button) {+ YTSingleVideoController *sgvid = player.activeVideo;+ BOOL muteStatus = ![sgvid isMuted];+ [[NSUserDefaults standardUserDefaults] setBool:muteStatus forKey:KeepMutedKey];+ [sgvid setMuted:muteStatus];+ UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:20 weight:UIImageSymbolWeightMedium];+ UIImage *newIcon = [UIImage systemImageNamed:muteStatus ? @"speaker.slash" : @"speaker.wave.2" withConfiguration:config];+ [button setImage:newIcon forState:UIControlStateNormal];+ };+ YMRegisterOverlayButton(mute);+ YMOverlayButtonSpec *speed = [[YMOverlayButtonSpec alloc] init];+ speed.identifier = @"speed.video";+ speed.title = currentSpeedLabel;+ speed.settingsSymbolName = @"speedometer";+ speed.displayName = LOC(@"SPEED_BUTTON");+ speed.sortOrder = 400;+ speed.isVisible = ^BOOL(YTPlayerViewController *player) {+ return YMIsOverlayButtonEnabled(@"speed.video");+ };+ speed.onTap = ^(YTPlayerViewController *player, YTQTMButton *button) {+ YTMainAppVideoPlayerOverlayViewController *ovcon = [player activeVideoPlayerOverlay];+ YTMainAppVideoPlayerOverlayView *ovview = [ovcon videoPlayerOverlayView];+ YTMainAppControlsOverlayView *conview = [ovview controlsOverlayView];+ [ovcon didPressVarispeed:button];+ [conview updateSpeedButton:nil];+ };+ YMRegisterOverlayButton(speed);+ YMOverlayButtonSpec *quality = [[YMOverlayButtonSpec alloc] init];+ quality.identifier = @"quality.video";+ quality.title = currentQualityLabel;+ quality.settingsSymbolName = @"slider.horizontal.3";+ quality.displayName = LOC(@"QUALITY_BUTTON");+ quality.sortOrder = 500;+ quality.isVisible = ^BOOL(YTPlayerViewController *player) {+ return YMIsOverlayButtonEnabled(@"quality.video");+ };+ quality.onTap = ^(YTPlayerViewController *player, YTQTMButton *button) {+ YTMainAppVideoPlayerOverlayViewController *ovcon = [player activeVideoPlayerOverlay];+ YTMainAppVideoPlayerOverlayView *ovview = [ovcon videoPlayerOverlayView];+ YTMainAppControlsOverlayView *conview = [ovview controlsOverlayView];+ [ovcon didPressVideoQuality:button];+ [conview updateQualityButton:nil];+ };+ YMRegisterOverlayButton(quality);+ YMOverlayButtonSpec *share = [[YMOverlayButtonSpec alloc] init];+ share.identifier = @"share.video";+ share.symbolName = @"arrowshape.turn.up.right";+ share.settingsSymbolName = @"arrowshape.turn.up.right";+ share.displayName = LOC(@"SHARE_BUTTON");+ share.tintColor = [UIColor whiteColor];+ share.sortOrder = 600;+ share.isVisible = ^BOOL(YTPlayerViewController *player) {+ return YMIsOverlayButtonEnabled(@"share.video");+ };+ share.onTap = ^(YTPlayerViewController *player, YTQTMButton *button) {+ [player YouModShareButton:button];+ };+ YMRegisterOverlayButton(share);+ YMOverlayButtonSpec *loop = [[YMOverlayButtonSpec alloc] init];+ loop.identifier = @"loop.video";+ loop.symbolName = IS_ENABLED(KeepLoopKey) ? @"repeat.1" : @"repeat";+ loop.settingsSymbolName = @"repeat";+ loop.displayName = LOC(@"LOOP_BUTTON");+ loop.tintColor = [UIColor whiteColor];+ loop.sortOrder = 700;+ loop.isVisible = ^BOOL(YTPlayerViewController *player) {+ return YMIsOverlayButtonEnabled(@"loop.video");+ };+ loop.onTap = ^(YTPlayerViewController *player, YTQTMButton *button) {+ [player YouModLoopButton];+ UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:20 weight:UIImageSymbolWeightMedium];+ UIImage *newIcon = [UIImage systemImageNamed:IS_ENABLED(KeepLoopKey) ? @"repeat.1" : @"repeat" withConfiguration:config];+ [button setImage:newIcon forState:UIControlStateNormal];+ };+ YMRegisterOverlayButton(loop);+ YMOverlayButtonSpec *caption = [[YMOverlayButtonSpec alloc] init];+ caption.identifier = @"caption.video";+ caption.symbolName = @"captions.bubble";+ caption.settingsSymbolName = @"captions.bubble";+ caption.displayName = LOC(@"CAPTION_BUTTON");+ caption.tintColor = [UIColor whiteColor];+ caption.sortOrder = 800;+ caption.isVisible = ^BOOL(YTPlayerViewController *player) {+ return YMIsOverlayButtonEnabled(@"caption.video");+ };+ caption.onTap = ^(YTPlayerViewController *player, YTQTMButton *button) {+ YTMainAppVideoPlayerOverlayViewController *c = [player activeVideoPlayerOverlay];+ YTFormat3CaptionViewController *cvc = [c valueForKey:@"_captionOverlayViewController"];+ showTranscript(cvc);+ };+ YMRegisterOverlayButton(caption);+ %init;+}diff --git a/vendor/YouMod/Files/Player.x b/vendor/YouMod/Files/Player.xnew file mode 100644index 0000000..d835068--- /dev/null+++ b/vendor/YouMod/Files/Player.x@@ -0,0 +1,1586 @@+#import "Headers.h"++static BOOL isWiFiConnected() {+ struct sockaddr_in zeroAddress;+ bzero(&zeroAddress, sizeof(zeroAddress));+ zeroAddress.sin_len = sizeof(zeroAddress);+ zeroAddress.sin_family = AF_INET;++ SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)&zeroAddress);+ if (!reachability) return NO;++ SCNetworkReachabilityFlags flags;+ BOOL retrievedFlags = SCNetworkReachabilityGetFlags(reachability, &flags);+ CFRelease(reachability);++ if (!retrievedFlags) return NO;++ BOOL isReachable = (flags & kSCNetworkReachabilityFlagsReachable) != 0;+ BOOL needsConnection = (flags & kSCNetworkReachabilityFlagsConnectionRequired) != 0;+ BOOL canConnect = isReachable && !needsConnection;++ if (!canConnect) return NO;++ BOOL isCellular = (flags & kSCNetworkReachabilityFlagsIsWWAN) != 0;+ return !isCellular;+}++extern void YouModDownloadSetCurrentPlayer(YTPlayerViewController *player);+extern YTPlayerViewController *YouModDownloadGetCurrentPlayer(void);++#pragma mark - Rewind / Fast-forward on iOS media controls++// The user-chosen skip amount for each direction, in seconds. Zero means the+// preference was never set, in which case the seek falls back to 10 seconds.+static CGFloat YouModRewindSecondsValue(void) {+ CGFloat s = FLOAT_FOR_KEY(RewindSeconds);+ return s > 0 ? s : 10.0;+}++static CGFloat YouModForwardSecondsValue(void) {+ CGFloat s = FLOAT_FOR_KEY(ForwardSeconds);+ return s > 0 ? s : 10.0;+}++// Seeks the active player by delta seconds, clamped to [0, duration]. Returns NO+// when no active player is available (e.g. a media key is pressed after playback+// ended), so the caller can report the command as having nothing to act on.+//+// The seek runs on the main queue because MPRemoteCommand handlers may be invoked+// off the main thread (notably from Bluetooth and CarPlay), while seekToTime: and+// the player's time accessors are main-thread-only.+static BOOL YouModSeekByInterval(CGFloat delta) {+ YTPlayerViewController *player = YouModDownloadGetCurrentPlayer();+ if (!player || ![player respondsToSelector:@selector(seekToTime:)]) return NO;+ dispatch_async(dispatch_get_main_queue(), ^{+ CGFloat cur = [player currentVideoMediaTime];+ CGFloat dur = [player currentVideoTotalMediaTime];+ CGFloat target = cur + delta;+ if (target < 0) target = 0;+ if (dur > 0 && target > dur) target = dur;+ [player seekToTime:target];+ });+ return YES;+}++// Retained handler tokens for the two skip commands. A non-nil token marks a+// command whose handler is already installed, so it is installed only once.+static id gYouModRewindTarget = nil;+static id gYouModForwardTarget = nil;++// Points the system now-playing skip controls (lock screen, Bluetooth, Control+// Center, CarPlay) at our per-direction seek. When enabled, the OS previous/next+// commands are turned off and skip-backward/forward take over with the user's+// intervals; when disabled, previous/next are restored. Only these system+// controls are configurable — the on-screen player rewind/fast-forward buttons+// are rendered by YouTube with an amount it owns, so they are left alone.+//+// The handlers are installed once and thereafter only their enabled state and+// preferred intervals are updated. Because the handlers read the seconds at press+// time, a changed preference always seeks by the new amount immediately; the+// interval shown on the OS controls reflects the value captured the last time this+// ran (video change or launch).+static void YouModConfigureRemoteSkipCommands(void) {+ MPRemoteCommandCenter *cc = [MPRemoteCommandCenter sharedCommandCenter];+ BOOL back = IS_ENABLED(SkipBackwardEnabled);+ BOOL fwd = IS_ENABLED(SkipForwardEnabled);++ // Each direction is independent: the previous/next track command is remapped+ // to a skip only on the side the user enabled, so a mixed state (e.g. rewind+ // on, fast-forward off) shows a skip-back control alongside the stock next+ // track button.+ cc.skipBackwardCommand.enabled = back;+ cc.skipBackwardCommand.preferredIntervals = @[@(YouModRewindSecondsValue())];+ cc.skipForwardCommand.enabled = fwd;+ cc.skipForwardCommand.preferredIntervals = @[@(YouModForwardSecondsValue())];+ cc.previousTrackCommand.enabled = !back;+ cc.nextTrackCommand.enabled = !fwd;++ if (!gYouModRewindTarget) {+ gYouModRewindTarget = [cc.skipBackwardCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent *event) {+ return YouModSeekByInterval(-YouModRewindSecondsValue()) ? MPRemoteCommandHandlerStatusSuccess : MPRemoteCommandHandlerStatusNoSuchContent;+ }];+ }+ if (!gYouModForwardTarget) {+ gYouModForwardTarget = [cc.skipForwardCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent *event) {+ return YouModSeekByInterval(YouModForwardSecondsValue()) ? MPRemoteCommandHandlerStatusSuccess : MPRemoteCommandHandlerStatusNoSuchContent;+ }];+ }+}++static void YouModAddEndTime(YTPlayerViewController *self, YTSingleVideoController *video, YTSingleVideoTime *time) {+ if (!IS_ENABLED(ShowExtraTimeRemaining) && !IS_ENABLED(SBShowDuration)) return;++ YTMainAppVideoPlayerOverlayViewController *con = [self activeVideoPlayerOverlay];+ if (![con isKindOfClass:%c(YTMainAppVideoPlayerOverlayViewController)]) return;+ CGFloat rate = [con currentPlaybackRate] != 0 ? [con currentPlaybackRate] : 1.0;+ NSTimeInterval remainingSeconds = (lround(video.totalMediaTime) - lround(time.time)) / rate;++ NSString *remainingTimeText;+ NSString *SBTimeRemaining = nil;+ NSTimeInterval SBTotalTimeRemaining = 0.0;++ if (IS_ENABLED(SBShowDuration)) {+ if (self.sbSegments && self.sbSegments.count > 0 && IS_ENABLED(SBButtonKey)) {+ for (SBSegment *segment in self.sbSegments) {+ SBSegmentAction action = [segment configuredAction];+ if (action == SBSegmentActionDisable) continue;++ CGFloat timeValue = segment.endTime - segment.startTime;+ SBTotalTimeRemaining = SBTotalTimeRemaining + timeValue;+ }+ if (SBTotalTimeRemaining != 0.0) {+ NSTimeInterval SBRemaining = video.totalMediaTime - SBTotalTimeRemaining;+ int hours = (int)(SBRemaining / 3600);+ int minutes = (int)(((int)SBRemaining % 3600) / 60);+ int seconds = (int)((int)SBRemaining % 60);+ if (hours > 0) {+ SBTimeRemaining = [NSString stringWithFormat:@"%d:%02d:%02d", hours, minutes, seconds];+ } else {+ SBTimeRemaining = [NSString stringWithFormat:@"%d:%02d", minutes, seconds];+ }+ }+ }+ }++ if (IS_ENABLED(ShowExtraTimeRemaining)) {+ NSDate *estimatedEndTime = [NSDate dateWithTimeIntervalSinceNow:remainingSeconds];+ NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];+ [dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]];+ [dateFormatter setDateFormat:IS_ENABLED(Uses24HoursTime) ? @"HH:mm" : @"h:mm a"];+ remainingTimeText = [dateFormatter stringFromDate:estimatedEndTime];+ }++ NSString *safeRemainingTimeText = remainingTimeText ?: @"";+ NSString *safeSBTimeRemaining = SBTimeRemaining ?: @"";++ YTPlayerView *playerView = (YTPlayerView *)self.playerView;+ if (![playerView.overlayView isKindOfClass:%c(YTMainAppVideoPlayerOverlayView)]) return;++ YTMainAppVideoPlayerOverlayView *overlay = (YTMainAppVideoPlayerOverlayView*)playerView.overlayView;+ YTLabel *durationLabel = overlay.playerBar.durationLabel;++ NSString *labelText = durationLabel.text ?: @"";++ NSString *baseText = labelText;+ NSRange extraTimeRange = [baseText rangeOfString:@" • "];+ if (extraTimeRange.location != NSNotFound) {+ baseText = [baseText substringToIndex:extraTimeRange.location];+ }+ NSRange sbRange = [baseText rangeOfString:@" ("];+ if (sbRange.location != NSNotFound) {+ baseText = [baseText substringToIndex:sbRange.location];+ }++ NSMutableString *newLabelText = [NSMutableString stringWithString:baseText];+ if (IS_ENABLED(SBShowDuration) && safeSBTimeRemaining.length > 0) {+ [newLabelText appendFormat:@" (%@)", safeSBTimeRemaining];+ }+ if (IS_ENABLED(ShowExtraTimeRemaining) && safeRemainingTimeText.length > 0) {+ [newLabelText appendFormat:@" • %@", safeRemainingTimeText];+ }++ if (![labelText isEqualToString:newLabelText]) {+ durationLabel.text = newLabelText;+ overlay.playerBar.endTimeString = newLabelText;+ [durationLabel sizeToFit];+ }+}++%hook YTInlinePlayerBarContainerView+%property (nonatomic, strong) NSString *endTimeString;+- (void)didMoveToWindow {+ %orig;+ if (!IS_ENABLED(TapToSeek) || [self._viewControllerForAncestor isKindOfClass:%c(YTPivotBarViewController)]) return;+ for (UIView *subview in self.subviews) {+ if ([subview isKindOfClass:%c(YTInlineScrubGestureView)]) {+ BOOL hasCustomTap = NO;+ for (UIGestureRecognizer *gesture in subview.gestureRecognizers) {+ if ([gesture isKindOfClass:[UITapGestureRecognizer class]] &&+ [gesture.name isEqualToString:@"YouModTapToSeek"]) {+ hasCustomTap = YES;+ break;+ }+ }+ if (!hasCustomTap) {+ UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleYouModScrubTap:)];+ tap.name = @"YouModTapToSeek";+ [subview addGestureRecognizer:tap];+ }+ break;+ }+ }+}+%new+- (void)handleYouModScrubTap:(UITapGestureRecognizer *)gesture {+ if (gesture.state == UIGestureRecognizerStateEnded) {+ UIView *progressBar = nil;++ for (UIView *subview in self.subviews) {+ if ([subview isKindOfClass:%c(YTModularPlayerBarView)]) {+ progressBar = subview;+ break;+ }+ }+ if (!progressBar) return;++ CGPoint touchPoint = [gesture locationInView:progressBar];+ CGFloat barWidth = progressBar.bounds.size.width;++ if (barWidth > 0) {+ CGFloat relativeX = touchPoint.x;+ CGFloat percentage = relativeX / barWidth;+ CGFloat snapThreshold = 8.0;++ if (relativeX <= snapThreshold) {+ percentage = 0.0;+ } else if (relativeX >= barWidth - snapThreshold) {+ percentage = 1.0;+ } else {+ if (percentage < 0.0) percentage = 0.0;+ if (percentage > 1.0) percentage = 1.0;+ }++ YTMainAppVideoPlayerOverlayViewController *ovcon = (YTMainAppVideoPlayerOverlayViewController *)self._viewControllerForAncestor;+ YTPlayerViewController *pvcon = ovcon.parentViewController;+ CGFloat totalDuration = [pvcon currentVideoTotalMediaTime];+ CGFloat targetTime = totalDuration * percentage;+ [pvcon seekToTime:targetTime];+ }+ }+}+// Disable toggle time remaining - @bhackel+- (void)setShouldDisplayTimeRemaining:(BOOL)arg1 {+ BOOL temp;+ if (IS_ENABLED(DisablesShowRemaining)) {+ temp = NO;+ } else if (IS_ENABLED(AlwaysShowRemaining)) {+ temp = YES;+ } else {+ temp = arg1;+ }+ %orig(temp);+}+// Always show seekbar+- (void)setPlayerBarAlpha:(CGFloat)alpha {+ CGFloat temp = IS_ENABLED(AlwaysShowSeekbar) ? 1.0 : alpha;+ %orig(temp);+}+// Disables snap to chapter+- (void)inlinePlayerBarView:(id)arg1 didScrubToChapteredTime:(CGFloat)arg2 shouldSnap:(BOOL)arg3 {+ BOOL temp = IS_ENABLED(DontSnapToChapter) ? NO : arg3;+ %orig(arg1, arg2, temp);+}+- (void)setPeekableViewVisible:(BOOL)visible {+ %orig;+ if (!IS_ENABLED(ShowExtraTimeRemaining) && !IS_ENABLED(SBShowDuration)) return;++ YTLabel *dLabel = self.durationLabel;+ if (dLabel && self.endTimeString) {+ if (![dLabel.text isEqualToString:self.endTimeString]) {+ dLabel.text = self.endTimeString;+ [dLabel sizeToFit];+ }+ }+}+%end++%hook YTMainAppControlsOverlayView+// Hide autoplay Switch+- (void)setAutoplaySwitchButtonRenderer:(id)arg1 { if (!IS_ENABLED(HideAutoPlayToggle)) %orig; }+// Hide captions Button+- (void)setClosedCaptionsOrSubtitlesButtonAvailable:(BOOL)arg1 { if (!IS_ENABLED(HideCaptionsButton)) %orig; }+// Hide video title in full screen+- (BOOL)titleViewHidden { return IS_ENABLED(HideFullvidTitle) ? YES : %orig; }+// Pause On Overlay+- (void)setOverlayVisible:(BOOL)visible {+ %orig;+ if (!IS_ENABLED(PauseOnOverlay)) return;+ YTMainAppVideoPlayerOverlayViewController *mainOverlayController = (YTMainAppVideoPlayerOverlayViewController *)self.eventsDelegate;+ YTPlayerViewController *playerViewController = mainOverlayController.parentViewController;+ visible ? [playerViewController pause] : [playerViewController play];+}+%end++%hook YTAutonavEndscreenController+- (void)showEndscreen { if (!IS_ENABLED(HideSuggestedVideo)) %orig; }+- (void)showEndscreenControlsInPlayerBar:(BOOL)arg {+ BOOL temp = IS_ENABLED(HideSuggestedVideo) ? NO : arg;+ %orig(temp);+}+%end++%hook YTSettings+- (BOOL)isAutoplayEnabled { return IS_ENABLED(HideAutoPlayToggle) ? NO : %orig; }+%end++%hook YTSettingsImpl+- (BOOL)isAutoplayEnabled { return IS_ENABLED(HideAutoPlayToggle) ? NO : %orig; }+%end++%hook YTColdConfig+- (BOOL)isLandscapeEngagementPanelEnabled { return IS_ENABLED(DisablesEngagementPanel) ? NO : %orig; }+- (BOOL)removeNextPaddleForAllVideos { return IS_ENABLED(HideNextAndPrevButtons) ? YES : %orig; }+- (BOOL)removePreviousPaddleForAllVideos { return IS_ENABLED(HideNextAndPrevButtons) ? YES : %orig; }+// Replace previous/next buttons with back and forward+- (BOOL)replaceNextPaddleWithFastForwardButtonForSingletonVods { return IS_ENABLED(ReplacePrevNextButtons) ? YES : %orig; }+- (BOOL)replacePreviousPaddleWithRewindButtonForSingletonVods { return IS_ENABLED(ReplacePrevNextButtons) ? YES : %orig; }+%end++// No Endscreen Cards+%hook YTCreatorEndscreenView+- (void)setHidden:(BOOL)arg1 {+ BOOL temp = IS_ENABLED(HideEndScreenCards) ? YES : arg1;+ %orig(temp);+}+- (void)setHoverCardHidden:(BOOL)arg {+ BOOL temp = IS_ENABLED(HideEndScreenCards) ? YES : arg;+ %orig(temp);+}+- (void)setHoverCardRenderer:(id)arg { if (!IS_ENABLED(HideEndScreenCards)) %orig; }+%end++%hook YTMainAppVideoPlayerOverlayViewController+// Disable Double Tap To Seek+- (BOOL)allowDoubleTapToSeekGestureRecognizer { return IS_ENABLED(DisablesDoubleTap) ? NO : %orig; }+// Disable long hold+- (BOOL)allowLongPressGestureRecognizerInView:(id)arg {+ if (IS_ENABLED(DisablesLongHold) || INTFORVAL(HoldToSpeedIndex) != 0) return NO;+ return %orig;+}+// Copy timestamp on pause+- (void)didPressPause:(id)arg {+ %orig;+ if (!IS_ENABLED(CopyWithTimestampOnPause)) return;+ CGFloat mediaTimeIn = self.mediaTime;+ NSString *vidID = self.videoID;+ if (vidID.length) {+ UIPasteboard.generalPasteboard.string = [NSString stringWithFormat:@"https://www.youtube.com/watch?v=%@&t=%lds", vidID, (long)mediaTimeIn];+ }+}+- (BOOL)isZoomEnabled {+ if (IS_ENABLED(DisablesFreeZoom)) {+ YTMainAppVideoPlayerOverlayView *mainov = [self videoPlayerOverlayView];+ YTVideoFreeZoomOverlayView *vidfreeov = [mainov videoFreeZoomOverlayView];+ vidfreeov.hidden = YES; // See if this is enough to hide the indicator+ return NO;+ }+ return %orig;+}+- (void)setPaidContentWithPlayerData:(id)data { if (!IS_ENABLED(HidePaidPromoOverlay)) %orig; }+%end++// YTNoPaidPromo (https://github.com/PoomSmart/YTNoPaidPromo)+%hook YTInlineMutedPlaybackPlayerOverlayViewController+- (void)setPaidContentWithPlayerData:(id)data { if (!IS_ENABLED(HidePaidPromoOverlay)) %orig; }+%end++// Remove Watermarks+%hook YTAnnotationsViewController+- (void)loadFeaturedChannelWatermark {+ if (IS_ENABLED(HideWaterMark)) {+ [self setValue:nil forKey:@"_watermarkView"];+ return;+ }+ %orig;+}+- (void)setWatermarkImage:(id)arg1 height:(NSUInteger)arg2 {+ if (IS_ENABLED(HideWaterMark)) {+ arg1 = nil;+ arg2 = 0;+ [self setValue:nil forKey:@"_watermarkView"];+ }+ %orig(arg1, arg2);+}+%end++%hook YTInlineMutedPlaybackScrubberViewController+- (void)setActiveSingleVideoObservable:(YTSingleVideoController *)singleVideoController {+ %orig;+ if (singleVideoController && IS_ENABLED(AutoFeedMute)) {+ [singleVideoController setMuted:YES];+ UIView *soundView = [self.view.superview valueForKey:@"_audioSoundIconView"];+ [soundView performSelector:@selector(setAudioOn:) withObject:@NO];+ }+}+%end++// Exit Fullscreen on Finish+%hook YTWatchFlowController+- (BOOL)shouldExitFullScreenOnFinish { return IS_ENABLED(AutoExitFullScreen) ? YES : %orig; }+%end++// Always use remaining time in the video player - @bhackel+%hook YTPlayerBarController+// When a new video is played, enable time remaining flag+- (void)setActiveSingleVideo:(id)arg1 {+ %orig;+ if (IS_ENABLED(AlwaysShowRemaining) && !IS_ENABLED(DisablesShowRemaining)) {+ // Get the player bar view+ YTInlinePlayerBarContainerView *playerBar = self.playerBar;+ if (playerBar) {+ // Enable the time remaining flag+ playerBar.shouldDisplayTimeRemaining = YES;+ }+ }+ YTSingleVideoController *sgvid = [self valueForKey:@"_currentSingleVideo"];+ YTPlayerView *playerview = [sgvid valueForKey:@"_playerView"];+ YTPlayerViewController *playerviewController = [playerview valueForKey:@"_playerViewDelegate"];+ YouModDownloadSetCurrentPlayer(playerviewController);+ YouModConfigureRemoteSkipCommands();+ if (INTFORVAL(AutoDRCAudioIndex) != 0) [playerviewController YouModAutoDRCAudio];+ if (INTFORVAL(AudioTrack) != 0) [playerviewController performSelector:@selector(YouModAutoAudioTrack) withObject:nil afterDelay:0.1];+ if (YMIsOverlayButtonEnabled(@"mute.video")) [playerviewController YouModAutoMute];+ if (IS_ENABLED(AutoFullScreen)) [playerviewController performSelector:@selector(YouModAutoFullscreen) withObject:nil afterDelay:0.4];+ if (INTFORVAL(CaptionTrack) != 0) [playerviewController performSelector:@selector(YouModAutoCaptions) withObject:nil afterDelay:0.2];+ if (INTFORVAL(AutoSpeedIndex) != 0) [playerviewController YouModSetAutoSpeed];+}+%end++// Disable Fullscreen Actions+%hook YTFullscreenActionsView+- (CGSize)sizeThatFits:(CGSize)size {+ if (IS_ENABLED(HideFullAction)) {+ self.hidden = YES;+ }+ return IS_ENABLED(HideFullAction) ? CGSizeMake(1, 35) : %orig;+}+%end++// Disable Ambiant mode (Hide the lights)+%hook YTWatchView+- (void)setCinematicContainerView:(id)arg { if (!IS_ENABLED(RemoveAmbiant)) %orig; }+%end++// Disable Autoplay+%hook YTPlaybackConfig+- (void)setStartPlayback:(BOOL)arg1 {+ BOOL temp = IS_ENABLED(StopAutoplayVideo) ? NO : arg1;+ %orig(temp);+}+%end++// Skip Content Warning (https://github.com/qnblackcat/uYouPlus/blob/main/uYouPlus.xm#L452-L454)+%hook YTPlayabilityResolutionUserActionUIController+- (void)showConfirmAlert { IS_ENABLED(HideContentWarning) ? [self confirmAlertDidPressConfirm] : %orig; }+%end++%hook YTPlayabilityResolutionUserActionUIControllerImpl+- (void)showConfirmAlert { IS_ENABLED(HideContentWarning) ? [self confirmAlertDidPressConfirm] : %orig; }+%end++// Portrait Fullscreen+%hook YTWatchViewController+- (NSUInteger)allowedFullScreenOrientations { return IS_ENABLED(PortFull) ? UIInterfaceOrientationMaskAllButUpsideDown : %orig; }+%end++%group ForceMiniPlayer+%hook YTIMiniplayerRenderer+%new+- (BOOL)hasMinimizedEndpoint { return NO; }+%new+- (BOOL)hasPlaybackMode { return NO; }+%end+%end++// Extra speed - adapted from YouSpeed+%group Speed++#define itemCount 13++%hook YTMenuController++- (NSMutableArray <YTActionSheetAction *> *)actionsForRenderers:(NSMutableArray <YTIMenuItemSupportedRenderers *> *)renderers fromView:(UIView *)fromView entry:(id)entry shouldLogItems:(BOOL)shouldLogItems firstResponder:(id)firstResponder {+ NSUInteger index = [renderers indexOfObjectPassingTest:^BOOL(YTIMenuItemSupportedRenderers *renderer, NSUInteger idx, BOOL *stop) {+ YTIMenuItemSupportedRenderersElementRendererCompatibilityOptionsExtension *extension = (YTIMenuItemSupportedRenderersElementRendererCompatibilityOptionsExtension *)[renderer.elementRenderer.compatibilityOptions messageForFieldNumber:396644439];+ BOOL isVideoSpeed = [extension.menuItemIdentifier isEqualToString:@"menu_item_playback_speed"];+ if (isVideoSpeed) *stop = YES;+ return isVideoSpeed;+ }];+ NSMutableArray <YTActionSheetAction *> *actions = %orig;+ if (index != NSNotFound) {+ YTActionSheetAction *action = actions[index];+ action.handler = ^{+ [firstResponder didPressVarispeed:fromView];+ };+ UIView *elementView = [action.button valueForKey:@"_elementView"];+ elementView.userInteractionEnabled = NO;+ }+ return actions;+}++%end++%hook YTVarispeedSwitchController++- (id)init {+ self = %orig;+ float speeds[] = {0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.5, 3.0, 5.0, 7.5, 10.0};+ id options[itemCount];+ Class YTVarispeedSwitchControllerOptionClass = %c(YTVarispeedSwitchControllerOption);+ for (int i = 0; i < itemCount; ++i) {+ NSString *title = [NSString stringWithFormat:@"%.2fx", speeds[i]];+ options[i] = [[YTVarispeedSwitchControllerOptionClass alloc] initWithTitle:title rate:speeds[i]];+ }+ [self setValue:[NSArray arrayWithObjects:options count:itemCount] forKey:@"_options"];+ return self;+}++%end++%hook YTIPlayerHotConfig++%new(f@:)+- (float)maximumPlaybackRate {+ return 10.0;+}++%end++%hook YTIGranularVariableSpeedConfig++%new(d@:)+- (int)maximumPlaybackRate {+ return 10.0 * 100;+}++%end+%end++static NSArray *YouModHoldSpeedValues(void) {+ return @[@0.0, @0.25, @0.5, @0.75, @1.0, @1.25, @1.5, @1.75, @2.0, @3.0, @4.0, @5.0];+}++static CGFloat YouModSpeedForHoldIndex(NSInteger index) {+ NSArray *values = YouModHoldSpeedValues();+ return [values[index] floatValue];+}++%hook YTMainAppVideoPlayerOverlayView+- (void)setLongPressGestureRecognizer:(id)arg {+ if (INTFORVAL(HoldToSpeedIndex) != 0) return;+ %orig;+}+// Remove Dark Background in Overlay+- (void)setBackgroundVisible:(BOOL)arg1 isGradientBackground:(BOOL)arg2 {+ BOOL temp = IS_ENABLED(RemoveDarkOverlay) ? NO : arg1;+ %orig(temp, arg2);+}+// Hide Watermarks+- (BOOL)isWatermarkEnabled { return IS_ENABLED(HideWaterMark) ? NO : %orig; }+- (void)setWatermarkEnabled:(BOOL)arg {+ BOOL temp = IS_ENABLED(HideWaterMark) ? NO : arg;+ %orig(temp);+}+- (void)layoutSubviews {+ %orig;+ if (IS_ENABLED(HideCastButtonPlayer)) self.playbackRouteButton.hidden = YES;+}+%end++%hook YTSingleVideoController++- (void)playerItem:(id)arg1 hasSelectableVideoFormats:(id)arg2 {+ %orig;+ if (!arg2) return;+ [self YouModAutoQuality];+}++%new+- (void)YouModAutoQuality {+ NSArray *videoFormats = self.selectableVideoFormats;+ // Return early if there aren't any video formats available+ // eg. Voice comments and others+ if (!videoFormats || videoFormats.count == 0) return;+ NSInteger kQualityIndex = isWiFiConnected() ? INTFORVAL(WifiQualityIndex) : INTFORVAL(CellQualityIndex);+ if ([NSProcessInfo processInfo].lowPowerModeEnabled) kQualityIndex = INTFORVAL(LowPowerQualityIndex);+ if (kQualityIndex == 0) return;++ NSString *bestQualityLabel;+ int highestResolution = 0;+ for (MLFormat *format in videoFormats) {+ int reso = format.singleDimensionResolution;+ if (reso > highestResolution) {+ highestResolution = reso;+ bestQualityLabel = format.qualityLabel;+ }+ }++ NSArray *qualityLabels = @[@"Default", bestQualityLabel, @"2160p", @"1440p", @"1080p", @"720p", @"480p", @"360p", @"240p", @"144p"];+ NSString *qualityLabel = qualityLabels[kQualityIndex];++ if (![qualityLabel isEqualToString:bestQualityLabel]) {+ BOOL exactMatch = NO;+ NSString *closestQualityLabel = qualityLabel;++ for (MLFormat *format in videoFormats) {+ if ([format.qualityLabel isEqualToString:qualityLabel]) {+ exactMatch = YES;+ break;+ }+ }++ if (!exactMatch) {+ NSInteger bestQualityDifference = NSIntegerMax;++ for (MLFormat *format in videoFormats) {+ NSArray *formatСomponents = [format.qualityLabel componentsSeparatedByString:@"p"];+ NSArray *targetComponents = [qualityLabel componentsSeparatedByString:@"p"];+ if (formatСomponents.count == 2) {+ NSInteger formatQuality = [formatСomponents.firstObject integerValue];+ NSInteger targetQuality = [targetComponents.firstObject integerValue];+ NSInteger difference = labs(formatQuality - targetQuality);+ if (difference < bestQualityDifference) {+ bestQualityDifference = difference;+ closestQualityLabel = format.qualityLabel;+ }+ }+ }++ qualityLabel = closestQualityLabel;+ }+ }++ MLQuickMenuVideoQualitySettingFormatConstraint *fc = [%c(MLQuickMenuVideoQualitySettingFormatConstraint) alloc];+ if ([fc respondsToSelector:@selector(initWithVideoQualitySetting:formatSelectionReason:qualityLabel:resolutionCap:)]) {+ [self setVideoFormatConstraint:[fc initWithVideoQualitySetting:3 formatSelectionReason:2 qualityLabel:qualityLabel resolutionCap:0]];+ } else {+ [self setVideoFormatConstraint:[fc initWithVideoQualitySetting:3 formatSelectionReason:2 qualityLabel:qualityLabel]];+ }+}+%end++// YTClassicVideoQuality (https://github.com/PoomSmart/YTClassicVideoQuality)+%group OldVideoQuality+%hook YTIMediaQualitySettingsHotConfig+%new(B@:)+- (BOOL)enableQuickMenuVideoQualitySettings { return NO; }+%end++%hook YTVideoQualitySwitchOriginalController+%property (retain, nonatomic) YTVideoQualitySwitchRedesignedController *redesignedController;+- (void)setUserSelectableFormats:(NSArray <MLFormat *> *)formats {+ if (self.redesignedController == nil)+ self.redesignedController = [[%c(YTVideoQualitySwitchRedesignedController) alloc] initWithServiceRegistryScope:nil parentResponder:nil];+ [self.redesignedController setValue:[self valueForKey:@"_video"] forKey:@"_video"];+ NSArray <MLFormat *> *newFormats = [self.redesignedController respondsToSelector:@selector(addRestrictedFormats:)] ? [self.redesignedController addRestrictedFormats:formats] : formats;+ %orig(newFormats);+}+- (void)dealloc {+ self.redesignedController = nil;+ %orig;+}+%end++%hook YTMenuController+- (NSMutableArray <YTActionSheetAction *> *)actionsForRenderers:(NSMutableArray <YTIMenuItemSupportedRenderers *> *)renderers fromView:(UIView *)fromView entry:(id)entry shouldLogItems:(BOOL)shouldLogItems firstResponder:(id)firstResponder {+ NSUInteger index = [renderers indexOfObjectPassingTest:^BOOL(YTIMenuItemSupportedRenderers *renderer, NSUInteger idx, BOOL *stop) {+ YTIMenuItemSupportedRenderersElementRendererCompatibilityOptionsExtension *extension = (YTIMenuItemSupportedRenderersElementRendererCompatibilityOptionsExtension *)[renderer.elementRenderer.compatibilityOptions messageForFieldNumber:396644439];+ BOOL isVideoQuality = [extension.menuItemIdentifier isEqualToString:@"menu_item_video_quality"];+ if (isVideoQuality) *stop = YES;+ return isVideoQuality;+ }];+ NSMutableArray <YTActionSheetAction *> *actions = %orig;+ if (index != NSNotFound) {+ YTActionSheetAction *action = actions[index];+ action.handler = ^{+ [firstResponder didPressVideoQuality:fromView];+ };+ UIView *elementView = [action.button valueForKey:@"_elementView"];+ elementView.userInteractionEnabled = NO;+ }+ return actions;+}+%end+%end++// Gestures - @bhackel (YTLitePlus)+%hook YTWatchLayerViewController+// invoked when the player view controller is either created or destroyed+- (void)watchController:(YTWatchController *)watchController didSetPlayerViewController:(YTPlayerViewController *)playerViewController {+ if (playerViewController) {+ YTPlayerView *pv = playerViewController.playerView;+ if (!playerViewController.YouModPanGesture && (IS_ENABLED(GestureControls) || IS_ENABLED(SeekOnOverlay))) {+ playerViewController.YouModPanGesture = [[UIPanGestureRecognizer alloc] initWithTarget:playerViewController action:@selector(YouModHandlePanGesture:)];+ playerViewController.YouModPanGesture.delegate = playerViewController;+ [pv addGestureRecognizer:playerViewController.YouModPanGesture];+ }+ if (!playerViewController.YouModTapGesture && IS_ENABLED(PauseTwoFingers)) {+ playerViewController.YouModTapGesture = [[UITapGestureRecognizer alloc] initWithTarget:playerViewController action:@selector(YouModHandleTapGesture:)];+ playerViewController.YouModTapGesture.numberOfTouchesRequired = 2;+ playerViewController.YouModTapGesture.delegate = playerViewController;+ [pv addGestureRecognizer:playerViewController.YouModTapGesture];+ }+ if (!playerViewController.YouModHoldGesture && INTFORVAL(HoldToSpeedIndex) != 0) {+ playerViewController.YouModHoldGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:playerViewController action:@selector(YouModHoldToSpeed:)];+ playerViewController.YouModHoldGesture.minimumPressDuration = 0.4;+ [pv addGestureRecognizer:playerViewController.YouModHoldGesture];+ }+ }+ %orig;+}+%end++static YTMainAppVideoPlayerOverlayView *getMainVideoOverlay(YTPlayerViewController *pvc) {+ YTMainAppVideoPlayerOverlayViewController *ovcon = [pvc activeVideoPlayerOverlay];+ return [ovcon videoPlayerOverlayView];+}++static BOOL isRelatedVideosPanelEnabled(YTPlayerViewController *pvc) {+ YTMainAppVideoPlayerOverlayView *ov = getMainVideoOverlay(pvc);+ YTFullscreenEngagementOverlayView *fullov = [ov valueForKey:@"_fullscreenEngagementOverlayView"];+ if (fullov) {+ YTRelatedVideosView *relatedview = [fullov valueForKey:@"_relatedVideosView"];+ YTRelatedVideosViewController *relatedcon = [relatedview valueForKey:@"_delegate"];+ return [relatedcon isExpanded];+ }+ return NO;+}++static CGFloat remainingOverlayWidth(YTPlayerViewController *pvc, CGFloat fullWidth) {+ YTMainAppVideoPlayerOverlayView *ov = getMainVideoOverlay(pvc);+ YTEngagementPanelContainerView *engagecontainer = [ov valueForKey:@"_engagementPanelContainerView"];+ if (engagecontainer) {+ if (engagecontainer.engagementPanelState == 3) {+ UIView *mainpanel = nil;+ for (UIView *sub in engagecontainer.subviews) {+ if ([sub isKindOfClass:%c(UILayoutContainerView)]) {+ mainpanel = sub;+ break;+ }+ }+ if (mainpanel) {+ CGFloat panelWidth = mainpanel.bounds.size.width;+ if (panelWidth > 0 && panelWidth < fullWidth) {+ CGFloat remainingWidth = fullWidth - panelWidth;+ return remainingWidth;+ }+ }+ }+ }+ return fullWidth;+}++%hook YTPlayerViewController+%property (nonatomic, retain) UIPanGestureRecognizer *YouModPanGesture;+%property (nonatomic, retain) UITapGestureRecognizer *YouModTapGesture;+%property (nonatomic, retain) UILabel *YouModGestureHUD;+%property (nonatomic, strong) UIView *YouModSpeedToastView;+%property (nonatomic, strong) UILabel *YouModSpeedToastLabel;+%property (nonatomic, retain) UILongPressGestureRecognizer *YouModHoldGesture;+%new+- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {+ if (gestureRecognizer == self.YouModPanGesture) {+ if (self.YouModHoldGesture && (self.YouModHoldGesture.state == UIGestureRecognizerStateBegan || self.YouModHoldGesture.state == UIGestureRecognizerStateChanged)) {+ return NO;+ }++ if (isRelatedVideosPanelEnabled(self)) return NO;++ UIPanGestureRecognizer *panGesture = (UIPanGestureRecognizer *)gestureRecognizer;+ CGPoint startLocation = [panGesture locationInView:self.view];+ CGPoint velocity = [panGesture velocityInView:self.view];+ CGFloat activeWidth = remainingOverlayWidth(self, self.view.bounds.size.width);++ if (startLocation.x > activeWidth) return NO;++ BOOL isHorizontal = fabs(velocity.x) > fabs(velocity.y);++ if (isHorizontal) {+ YTMainAppVideoPlayerOverlayView *ov = getMainVideoOverlay(self);+ YTVideoFreeZoomOverlayView *vidfreeov = ov.videoFreeZoomOverlayView;+ YTVideoFreeZoomOverlayController *vidfreecon = [vidfreeov valueForKey:@"_delegate"];+ return IS_ENABLED(SeekOnOverlay) && vidfreecon.state != 4;+ } else {+ if (!IS_ENABLED(GestureControls)) return NO;++ float areaPercent = 0.15;+ int areaSetting = INTFORVAL(GestureActivationArea);+ if (areaSetting == 0) areaPercent = 0.10;+ else if (areaSetting == 2) areaPercent = 0.20;+ else if (areaSetting == 3) areaPercent = 0.25;+ else if (areaSetting == 4) areaPercent = 0.30;+ else if (areaSetting == 5) areaPercent = 0.35;+ else if (areaSetting == 6) areaPercent = 0.40;+ else if (areaSetting == 7) areaPercent = 0.45;+ else if (areaSetting == 8) areaPercent = 0.50;++ int leftAction = [[NSUserDefaults standardUserDefaults] objectForKey:LeftSideGesture] ? INTFORVAL(LeftSideGesture) : 1;+ int rightAction = [[NSUserDefaults standardUserDefaults] objectForKey:RightSideGesture] ? INTFORVAL(RightSideGesture) : 2;++ if (startLocation.x > activeWidth * areaPercent && startLocation.x < activeWidth * (1.0 - areaPercent)) return NO;+ if (startLocation.x <= activeWidth * areaPercent && leftAction == 0) return NO;+ if (startLocation.x >= activeWidth * (1.0 - areaPercent) && rightAction == 0) return NO;++ return YES;+ }+ }+ if (gestureRecognizer == self.YouModHoldGesture) {+ if (self.YouModPanGesture && (self.YouModPanGesture.state == UIGestureRecognizerStateBegan || self.YouModPanGesture.state == UIGestureRecognizerStateChanged)) {+ return NO;+ }+ if (isRelatedVideosPanelEnabled(self)) return NO;+ CGPoint touchLocation = [gestureRecognizer locationInView:self.view];+ CGFloat activeWidth = remainingOverlayWidth(self, self.view.bounds.size.width);+ if (touchLocation.x > activeWidth) return NO;+ }+ return YES;+}++%new+- (void)YouModHandlePanGesture:(UIPanGestureRecognizer *)panGestureRecognizer {+ // 0 = None, 1 = Vertical (Bright/Vol/Speed), 2 = Horizontal (Scrub)+ static int currentPanMode = 0;++ static float initialVolume;+ static float initialBrightness;+ static float initialSpeed;+ static int controlType = 0;+ static CGFloat deadzoneStartingTranslation;+ static CGFloat sensitivityFactor = 1.0;++ static MPVolumeView *volumeView;+ static UISlider *volumeViewSlider;++ static dispatch_once_t onceToken;+ dispatch_once(&onceToken, ^{+ volumeView = [[MPVolumeView alloc] initWithFrame:CGRectZero];+ for (UIView *view in volumeView.subviews) {+ if ([view isKindOfClass:[UISlider class]]) {+ volumeViewSlider = (UISlider *)view;+ break;+ }+ }+ });++ YTMainAppVideoPlayerOverlayViewController *ovcon = [self activeVideoPlayerOverlay];++ if (IS_ENABLED(GestureHUD)) {+ if (!self.YouModGestureHUD) {+ self.YouModGestureHUD = [[UILabel alloc] initWithFrame:CGRectZero];+ self.YouModGestureHUD.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.5];+ self.YouModGestureHUD.textColor = [UIColor colorWithWhite:1.0 alpha:0.75];+ self.YouModGestureHUD.tintColor = [UIColor colorWithWhite:1.0 alpha:0.75];+ self.YouModGestureHUD.textAlignment = NSTextAlignmentCenter;+ self.YouModGestureHUD.layer.masksToBounds = YES;+ self.YouModGestureHUD.alpha = 0.0;+ [self.view addSubview:self.YouModGestureHUD];+ }+ }++ if (panGestureRecognizer.state == UIGestureRecognizerStateBegan) {+ CGPoint velocity = [panGestureRecognizer velocityInView:self.view];+ BOOL isHorizontal = fabs(velocity.x) > fabs(velocity.y);++ if (isHorizontal && IS_ENABLED(SeekOnOverlay)) {+ currentPanMode = 2;+ } else if (!isHorizontal && IS_ENABLED(GestureControls)) {+ currentPanMode = 1;+ }++ if (currentPanMode == 2) {+ YTMainAppVideoPlayerOverlayView *ovview = [ovcon videoPlayerOverlayView];+ YTInlinePlayerBarContainerView *wth = ovview.playerBar;+ YTPlayerBarController *playerbarcon = [wth valueForKey:@"_delegate"];+ [playerbarcon didScrub:panGestureRecognizer];+ } else if (currentPanMode == 1) {+ CGPoint startLocation = [panGestureRecognizer locationInView:self.view];+ CGFloat activeWidth = remainingOverlayWidth(self, self.view.bounds.size.width);++ float areaPercent = 0.15;+ int areaSetting = INTFORVAL(GestureActivationArea);+ if (areaSetting == 0) areaPercent = 0.10;+ else if (areaSetting == 2) areaPercent = 0.20;+ else if (areaSetting == 3) areaPercent = 0.25;+ else if (areaSetting == 4) areaPercent = 0.30;+ else if (areaSetting == 5) areaPercent = 0.35;+ else if (areaSetting == 6) areaPercent = 0.40;+ else if (areaSetting == 7) areaPercent = 0.45;+ else if (areaSetting == 8) areaPercent = 0.50;++ int leftAction = [[NSUserDefaults standardUserDefaults] objectForKey:LeftSideGesture] ? INTFORVAL(LeftSideGesture) : 1;+ int rightAction = [[NSUserDefaults standardUserDefaults] objectForKey:RightSideGesture] ? INTFORVAL(RightSideGesture) : 2;++ if (startLocation.x <= activeWidth * areaPercent) {+ controlType = leftAction;+ } else if (startLocation.x >= activeWidth * (1.0 - areaPercent)) {+ controlType = rightAction;+ } else {+ controlType = 0;+ }++ deadzoneStartingTranslation = [panGestureRecognizer translationInView:self.view].y;++ if (controlType == 1) initialBrightness = [UIScreen mainScreen].brightness;+ else if (controlType == 2) initialVolume = [[AVAudioSession sharedInstance] outputVolume];+ else if (controlType == 3) initialSpeed = [ovcon currentPlaybackRate];++ if (IS_ENABLED(GestureHUD) && controlType != 0) {+ int sizeSetting = [[NSUserDefaults standardUserDefaults] objectForKey:GestureHUDSize] ? (int)[[NSUserDefaults standardUserDefaults] integerForKey:GestureHUDSize] : 1;+ CGFloat fontSize = 14.0 + (sizeSetting * 2.0);+ CGFloat hudWidth = 74.0 + (sizeSetting * 10.0);+ CGFloat hudHeight = 30.0 + (sizeSetting * 4.0);++ self.YouModGestureHUD.frame = CGRectMake(0, 0, hudWidth, hudHeight);+ self.YouModGestureHUD.layer.cornerRadius = hudHeight / 2.0;+ self.YouModGestureHUD.font = [UIFont boldSystemFontOfSize:fontSize];++ int posSetting = [[NSUserDefaults standardUserDefaults] objectForKey:GestureHUDPosition] ? (int)[[NSUserDefaults standardUserDefaults] integerForKey:GestureHUDPosition] : 0;+ CGFloat viewHeight = self.view.bounds.size.height;+ CGFloat centerY = viewHeight / 6.0;+ if (posSetting == 1) centerY = viewHeight / 2.0;+ else if (posSetting == 2) centerY = viewHeight * 5.0 / 6.0;++ [self.view bringSubviewToFront:self.YouModGestureHUD];+ self.YouModGestureHUD.center = CGPointMake(activeWidth / 2, centerY);+ }+ }+ }++ if (panGestureRecognizer.state == UIGestureRecognizerStateChanged) {+ if (currentPanMode == 2) {+ YTMainAppVideoPlayerOverlayView *ovview = [ovcon videoPlayerOverlayView];+ YTInlinePlayerBarContainerView *wth = ovview.playerBar;+ YTPlayerBarController *playerbarcon = [wth valueForKey:@"_delegate"];+ [playerbarcon didScrub:panGestureRecognizer];+ } else if (currentPanMode == 1 && controlType != 0) {+ CGPoint translation = [panGestureRecognizer translationInView:self.view];+ CGFloat adjustedTranslation = translation.y - deadzoneStartingTranslation;+ float delta = (-adjustedTranslation / self.view.bounds.size.height) * sensitivityFactor;++ NSString *symbolName = nil;+ NSString *percentString = nil;++ if (controlType == 1) {+ float newBrightness = fmaxf(fminf(initialBrightness + delta, 1.0), 0.0);+ dispatch_async(dispatch_get_main_queue(), ^{+ [[UIScreen mainScreen] setBrightness:newBrightness];+ });++ if (newBrightness <= 0.5f) {+ symbolName = @"sun.min.fill";+ } else {+ symbolName = @"sun.max.fill";+ }++ percentString = [NSString stringWithFormat:@" %d%%", (int)(newBrightness * 100)];+ } else if (controlType == 2) {+ float newVolume = fmaxf(fminf(initialVolume + delta, 1.0), 0.0);+ dispatch_async(dispatch_get_main_queue(), ^{+ volumeViewSlider.value = newVolume;+ });++ if (newVolume == 0.0f) {+ symbolName = @"speaker.slash.fill";+ } else if (newVolume <= 0.25f) {+ symbolName = @"speaker.fill";+ } else if (newVolume <= 0.50f) {+ symbolName = @"speaker.wave.1.fill";+ } else if (newVolume <= 0.75f) {+ symbolName = @"speaker.wave.2.fill";+ } else {+ symbolName = @"speaker.wave.3.fill";+ }++ percentString = [NSString stringWithFormat:@" %d%%", (int)(newVolume * 100)];+ } else if (controlType == 3) {+ float speedSensitivity = 8.0;+ float speedDelta = (-adjustedTranslation / self.view.bounds.size.height) * speedSensitivity;+ float rawSpeed = initialSpeed + speedDelta;+ float clampedSpeed = fmaxf(fminf(rawSpeed, 10.0), 0.25);+ float steppedSpeed = roundf(clampedSpeed * 4.0) / 4.0;++ static float lastUpdatedSpeed = 0;+ if (steppedSpeed != lastUpdatedSpeed) {+ [self setPlaybackRate:steppedSpeed];+ lastUpdatedSpeed = steppedSpeed;+ }++ if (steppedSpeed < 1.0f) {+ symbolName = @"tortoise.fill";+ } else if (steppedSpeed == 1.0f) {+ symbolName = @"speedometer";+ } else if (steppedSpeed <= 5.0f) {+ symbolName = @"hare.fill";+ } else {+ symbolName = @"bolt.fill";+ }++ percentString = [NSString stringWithFormat:@" %.2fx", steppedSpeed];+ }++ if (IS_ENABLED(GestureHUD) && symbolName) {+ NSTextAttachment *attachment = [[NSTextAttachment alloc] init];+ UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:self.YouModGestureHUD.font.pointSize - 1];+ UIImage *icon = [UIImage systemImageNamed:symbolName withConfiguration:config];+ attachment.image = [icon imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];+ CGFloat iconY = (self.YouModGestureHUD.font.capHeight - attachment.image.size.height) / 2.0;+ attachment.bounds = CGRectMake(0, iconY, attachment.image.size.width, attachment.image.size.height);+ NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithAttributedString:[NSAttributedString attributedStringWithAttachment:attachment]];+ NSAttributedString *textString = [[NSAttributedString alloc] initWithString:percentString attributes:@{NSFontAttributeName: self.YouModGestureHUD.font, NSForegroundColorAttributeName: self.YouModGestureHUD.textColor}];+ [attributedString appendAttributedString:textString];+ self.YouModGestureHUD.attributedText = attributedString;+ self.YouModGestureHUD.alpha = 1.0;+ }+ }+ }++ if (panGestureRecognizer.state == UIGestureRecognizerStateEnded || panGestureRecognizer.state == UIGestureRecognizerStateCancelled || panGestureRecognizer.state == UIGestureRecognizerStateFailed) {+ if (currentPanMode == 2) {+ YTMainAppVideoPlayerOverlayView *ovview = [ovcon videoPlayerOverlayView];+ YTInlinePlayerBarContainerView *wth = ovview.playerBar;+ YTPlayerBarController *playerbarcon = [wth valueForKey:@"_delegate"];+ [playerbarcon didScrub:panGestureRecognizer];+ } else if (currentPanMode == 1) {+ if (IS_ENABLED(GestureHUD)) {+ [UIView animateWithDuration:0.3 delay:0.5 options:UIViewAnimationOptionCurveEaseOut animations:^{+ self.YouModGestureHUD.alpha = 0.0;+ } completion:nil];+ }+ }+ currentPanMode = 0;+ controlType = 0;+ }+}++%new+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {+ if (gestureRecognizer == self.YouModPanGesture && [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) {+ return YES;+ }+ if (gestureRecognizer == self.YouModHoldGesture && ![otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) {+ return YES;+ }+ return NO;+}++%new+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {+ if (gestureRecognizer == self.YouModPanGesture) {+ return NO;+ }+ if (gestureRecognizer == self.YouModHoldGesture || otherGestureRecognizer == self.YouModHoldGesture) {+ if ([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] || [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) {+ return NO;+ }+ return YES;+ }+ return YES;+}++// Pause using Two fingers+%new+- (void)YouModHandleTapGesture:(UITapGestureRecognizer *)tapGestureRecognizer {+ if (isRelatedVideosPanelEnabled(self)) return;++ CGPoint startLocation = [tapGestureRecognizer locationInView:self.view];+ CGFloat remainingWidth = remainingOverlayWidth(self, self.view.bounds.size.width);+ if (startLocation.x > remainingWidth) return;++ if (tapGestureRecognizer.state == UIGestureRecognizerStateEnded) {+ if (self.playerState == 3) {+ [self pause];+ } else if (self.playerState == 4) {+ [self play];+ }+ }+}++%new+- (void)YouModAutoFullscreen {+ YTWatchController *watchController = [self valueForKey:@"_UIDelegate"];+ [watchController showFullScreen];+}++%new+- (void)YouModSetAutoSpeed {+ if (self.YouModHoldGesture && (self.YouModHoldGesture.state == UIGestureRecognizerStateBegan || self.YouModHoldGesture.state == UIGestureRecognizerStateChanged)) {+ return;+ }+ if (IS_ENABLED(GlobalSpeedLocked)) {+ NSInteger speedIndex = INTFORVAL(HoldToSpeedIndex);+ CGFloat speed = YouModSpeedForHoldIndex(speedIndex);+ [self setPlaybackRate:speed];+ return;+ }+ if (INTFORVAL(AutoSpeedIndex) == 0) return;+ NSArray *speedLabels = @[@0.01, @0.25, @0.5, @0.75, @1.0, @1.25, @1.5, @1.75, @2.0, @3.0, @4.0, @5.0];+ [self setPlaybackRate:[speedLabels[INTFORVAL(AutoSpeedIndex)] floatValue]];+}++- (void)singleVideo:(YTSingleVideoController *)video currentVideoTimeDidChange:(YTSingleVideoTime *)time {+ %orig;+ YouModAddEndTime(self, video, time);+}++- (void)potentiallyMutatedSingleVideo:(YTSingleVideoController *)video currentVideoTimeDidChange:(YTSingleVideoTime *)time {+ %orig;+ YouModAddEndTime(self, video, time);+}++%new+- (void)YouModAutoMute {+ YTSingleVideoController *sgvid = self.activeVideo;+ BOOL muted = [sgvid isMuted];+ [sgvid setMuted:[self isInlinePlaybackActive] ? muted : IS_ENABLED(KeepMutedKey)];+}++%new+- (void)YouModAutoAudioTrack {+ NSInteger selectedIndex = INTFORVAL(AudioTrackLangIndex);+ NSArray *langCodes = getAllSystemLanguageValues();+ NSString *userTargetLang = langCodes[selectedIndex];+ id switchcon = self.audioTrackController;+ NSArray *availableTracks = [switchcon valueForKey:@"_availableAudioTracks"];+ if (!availableTracks || availableTracks.count == 0) return;+ YTIAudioTrack *matchedTrack = nil;++ if (INTFORVAL(AudioTrack) == 1) {+ // Loop for all tracks+ for (YTIAudioTrack *track in availableTracks) {+ if ([track.id_p hasSuffix:@".4"]) {+ matchedTrack = track;+ break;+ }+ }+ } else if (INTFORVAL(AudioTrack) == 2) {+ // Loop for all tracks+ for (YTIAudioTrack *track in availableTracks) {+ if ([track.id_p hasPrefix:userTargetLang]) {+ matchedTrack = track;+ break;+ }+ }++ // Check if it's dubbed+ if (matchedTrack && [matchedTrack isAutoDubbed] && IS_ENABLED(NoDubbedAudioTrack)) matchedTrack = nil;++ if (!matchedTrack && IS_ENABLED(NoDubbedAudioTrack)) {+ for (YTIAudioTrack *track in availableTracks) {+ if ([track.id_p hasSuffix:@".4"]) {+ matchedTrack = track;+ break;+ }+ }+ }+ }++ // If found, change to it+ if (matchedTrack) {+ [self setAudioTrack:matchedTrack source:0];+ }+}++%new+- (void)YouModAutoCaptions {+ YTSingleVideoController *sgvid = self.activeVideo;+ NSArray *allTracks = sgvid.availableCaptionTracks;+ if (!allTracks || allTracks.count == 0) return;+ NSInteger selectedIndex = INTFORVAL(CaptionTrackLangIndex);+ NSArray *langCodes = getAllSystemLanguageValues();+ NSString *userTargetLang = langCodes[selectedIndex];+ MLInnerTubeCaptionTrack *currentTrack = sgvid.activeCaptionTrack;+ MLInnerTubeCaptionTrack *matchedTrack;++ if (INTFORVAL(CaptionTrack) == 1) {+ if (currentTrack != nil) {+ [self YouModCaptionsHelper:nil];+ }+ return;+ }++ for (MLInnerTubeCaptionTrack *track in allTracks) {+ if ([track.languageCode isEqualToString:userTargetLang]) {+ matchedTrack = track;+ break;+ }+ }+ if (matchedTrack && ([matchedTrack.VSSID hasPrefix:@"a."] || [matchedTrack.VSSID hasPrefix:@"ta."]) && IS_ENABLED(DisablesCaptionTrack)) {+ matchedTrack = nil;+ [self YouModCaptionsHelper:nil];+ return;+ } else if (!matchedTrack && IS_ENABLED(DisablesCaptionTrack)) {+ [self YouModCaptionsHelper:nil];+ return;+ }+ if (matchedTrack && matchedTrack != currentTrack) {+ [self YouModCaptionsHelper:matchedTrack];+ }+}++%new+- (void)YouModCaptionsHelper:(MLInnerTubeCaptionTrack *)track {+ if ([self respondsToSelector:@selector(setActiveCaptionTrack:source:)]) {+ [self setActiveCaptionTrack:track source:0];+ } else {+ [self setActiveCaptionTrack:track];+ }+}+%new+- (void)YouModHideSpeedToast {+ [UIView animateWithDuration:0.2 animations:^{+ self.YouModSpeedToastView.alpha = 0.0;+ }];+}+%new+- (void)YouModShowSpeedToast:(CGFloat)speed isLocked:(BOOL)isLocked {+ UIColor *themeTextColor = [UIColor labelColor];+ UIColor *toastBgColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ return (traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) ?+ [UIColor colorWithWhite:0.1 alpha:0.95] : [UIColor colorWithWhite:0.95 alpha:0.95];+ }];++ if (!self.YouModSpeedToastView) {+ self.YouModSpeedToastView = [[UIView alloc] init];+ self.YouModSpeedToastView.clipsToBounds = YES;+ self.YouModSpeedToastView.alpha = 0.0;++ self.YouModSpeedToastLabel = [[UILabel alloc] init];+ self.YouModSpeedToastLabel.textAlignment = NSTextAlignmentCenter;+ self.YouModSpeedToastLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];+ self.YouModSpeedToastLabel.numberOfLines = 2;+ [self.YouModSpeedToastView addSubview:self.YouModSpeedToastLabel];++ [self.playerView addSubview:self.YouModSpeedToastView];+ }++ self.YouModSpeedToastView.backgroundColor = toastBgColor;+ self.YouModSpeedToastLabel.textColor = themeTextColor;++ NSTextAttachment *topAttachment = [[NSTextAttachment alloc] init];+ topAttachment.image = [[UIImage systemImageNamed:@"hare.fill"] imageWithTintColor:themeTextColor];+ topAttachment.bounds = CGRectMake(0, -2, 14, 14);++ NSTextAttachment *lockAttachment = nil;+ if (IS_ENABLED(LockSpeed)) {+ lockAttachment = [[NSTextAttachment alloc] init];+ NSString *lockIconName = isLocked ? @"lock.fill" : @"lock.open.fill";+ lockAttachment.image = [[UIImage systemImageNamed:lockIconName] imageWithTintColor:themeTextColor];+ lockAttachment.bounds = CGRectMake(0, -1, 12, 12);+ }++ NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];+ paragraphStyle.alignment = NSTextAlignmentCenter;+ paragraphStyle.lineSpacing = 3.0;++ NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@" %@\n", LOC(@"PLAYBACK_SPEED")]];++ if (topAttachment.image) {+ NSAttributedString *topIconString = [NSAttributedString attributedStringWithAttachment:topAttachment];+ [attrString insertAttributedString:topIconString atIndex:0];+ }++ if (lockAttachment && lockAttachment.image) {+ NSAttributedString *lockIconString = [NSAttributedString attributedStringWithAttachment:lockAttachment];+ [attrString appendAttributedString:lockIconString];+ [attrString appendAttributedString:[[NSAttributedString alloc] initWithString:@" "]];+ }++ NSAttributedString *speedText = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%gx", speed]];+ [attrString appendAttributedString:speedText];+ [attrString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attrString.length)];++ self.YouModSpeedToastLabel.attributedText = attrString;++ CGFloat activeWidth = remainingOverlayWidth(self, self.playerView.bounds.size.width);+ CGFloat maxAvailableWidth = activeWidth * 0.8;+ CGSize maxLabelSize = CGSizeMake(maxAvailableWidth, CGFLOAT_MAX);++ CGRect boundingBox = [attrString boundingRectWithSize:maxLabelSize+ options:(NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading)+ context:nil];+ CGSize textSize = CGSizeMake(ceilf(boundingBox.size.width), ceilf(boundingBox.size.height));++ CGFloat paddingY = 16.0;+ CGFloat toastHeight = textSize.height + paddingY;++ // Dynamic horizontal padding based on capsule corner geometry (radius = toastHeight / 2.0)+ // Ensures text in any language sits comfortably inside the flat region of the pill container+ CGFloat paddingX = toastHeight + 24.0;+ CGFloat calculatedWidth = textSize.width + paddingX;+ CGFloat toastWidth = fminf(fmaxf(calculatedWidth, toastHeight * 2.2), maxAvailableWidth + 24.0);++ self.YouModSpeedToastView.frame = CGRectMake(0, 0, toastWidth, toastHeight);+ self.YouModSpeedToastView.layer.cornerRadius = toastHeight / 2.0;+ self.YouModSpeedToastLabel.frame = self.YouModSpeedToastView.bounds;++ self.YouModSpeedToastView.center = CGPointMake(activeWidth / 2.0, 36.0);+ self.YouModSpeedToastView.layer.zPosition = 999;+ [self.playerView bringSubviewToFront:self.YouModSpeedToastView];++ [UIView animateWithDuration:0.2 animations:^{+ self.YouModSpeedToastView.alpha = 1.0;+ }];+}++%new+- (void)YouModHoldToSpeed:(UILongPressGestureRecognizer *)gesture {+ if (isRelatedVideosPanelEnabled(self)) return;++ CGPoint touchLocation = [gesture locationInView:self.view];+ CGFloat activeWidth = remainingOverlayWidth(self, self.view.bounds.size.width);+ if (touchLocation.x > activeWidth) return;++ NSInteger speedIndex = INTFORVAL(HoldToSpeedIndex);+ CGFloat speed = YouModSpeedForHoldIndex(speedIndex);++ static CGPoint startLocation;+ static BOOL initialLockState;+ static BOOL isPendingToggle;++ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];++ if (gesture.state == UIGestureRecognizerStateBegan) {+ if (self.playerState != 3) return;+ YTMainAppVideoPlayerOverlayViewController *con = [self activeVideoPlayerOverlay];+ CGFloat currentRate = [con currentPlaybackRate];+ CGFloat savedNormal = FLOAT_FOR_KEY(GlobalSavedNormalRate);++ if (savedNormal <= 0) {+ savedNormal = (currentRate > 0) ? currentRate : 1.0;+ [defaults setFloat:savedNormal forKey:GlobalSavedNormalRate];+ [defaults setBool:NO forKey:GlobalSpeedLocked];+ }++ initialLockState = IS_ENABLED(GlobalSpeedLocked);+ isPendingToggle = NO;+ startLocation = [gesture locationInView:self.playerView];++ if (!initialLockState) {+ if (currentRate != speed) {+ savedNormal = (currentRate > 0) ? currentRate : 1.0;+ [defaults setFloat:savedNormal forKey:GlobalSavedNormalRate];+ }+ [self setPlaybackRate:speed];+ [self YouModShowSpeedToast:speed isLocked:NO];+ } else {+ [self setPlaybackRate:speed];+ [self YouModShowSpeedToast:speed isLocked:YES];+ }+ } else if (gesture.state == UIGestureRecognizerStateChanged) {+ if (!IS_ENABLED(LockSpeed)) return;++ CGPoint currentLocation = [gesture locationInView:self.playerView];+ CGFloat dragDistanceY = currentLocation.y - startLocation.y;++ BOOL stateChanged = NO;++ if (!isPendingToggle && dragDistanceY > 40.0) {+ isPendingToggle = YES;+ stateChanged = YES;+ } else if (isPendingToggle && dragDistanceY < 20.0) {+ isPendingToggle = NO;+ stateChanged = YES;+ }++ if (stateChanged) {+ UIImpactFeedbackStyle feedbackStyle = isPendingToggle ? UIImpactFeedbackStyleMedium : UIImpactFeedbackStyleLight;+ UIImpactFeedbackGenerator *feedback = [[UIImpactFeedbackGenerator alloc] initWithStyle:feedbackStyle];+ [feedback impactOccurred];++ BOOL previewLockState = initialLockState ? !isPendingToggle : isPendingToggle;++ if (previewLockState) {+ [self YouModShowSpeedToast:speed isLocked:YES];+ } else {+ CGFloat toastSpeed;+ if (initialLockState) {+ CGFloat savedNormal = [defaults floatForKey:GlobalSavedNormalRate];+ toastSpeed = (savedNormal >= 0.25) ? savedNormal : 1.0;+ } else {+ toastSpeed = speed;+ }+ [self YouModShowSpeedToast:toastSpeed isLocked:NO];+ }+ }+ } else if (gesture.state == UIGestureRecognizerStateEnded ||+ gesture.state == UIGestureRecognizerStateCancelled ||+ gesture.state == UIGestureRecognizerStateFailed) {++ BOOL finalLockState = initialLockState;+ if (gesture.state == UIGestureRecognizerStateEnded || (gesture.state == UIGestureRecognizerStateCancelled && isPendingToggle)) {+ if (IS_ENABLED(LockSpeed) && isPendingToggle) {+ finalLockState = !initialLockState;+ [defaults setBool:finalLockState forKey:GlobalSpeedLocked];+ }+ }+ if (finalLockState) {+ [self setPlaybackRate:speed];+ } else {+ CGFloat savedNormal = [defaults floatForKey:GlobalSavedNormalRate];+ CGFloat targetRate = (savedNormal >= 0.25) ? savedNormal : 1.0;+ [self setPlaybackRate:targetRate];+ }+ isPendingToggle = NO;+ [self YouModHideSpeedToast];+ }+}+%new+- (void)YouModAutoDRCAudio {+ BOOL value = NO;+ if (INTFORVAL(AutoDRCAudioIndex) == 1) {+ value = YES;+ }+ [self setAudioDRCEnabled:value];+}+%end++// Video buttons filtering+static void YouModFilterVideoButtons(_ASDisplayView *view, NSString *iden) {+ UIViewController *con = view._viewControllerForAncestor;+ if ([con isKindOfClass:%c(YTELMViewController)]) {+ _ASDisplayView *mainView = (_ASDisplayView *)view.superview;+ ASDisplayNode *node = mainView.keepalive_node;+ BOOL done = NO;+ for (ASDisplayNode *child in [node.yogaChildren copy]) {+ for (id child2 in [child.yogaChildren copy]) {+ if ([[child2 description] containsString:iden]) {+ [node removeYogaChild:child];+ [view removeFromSuperview];+ done = YES;+ break;+ }+ }+ if (done) break;+ }+ } else if ([con isKindOfClass:%c(YTWatchNextResultsViewController)]) {+ BOOL isNewActionBar = NO;+ UIView *test = view.superview;+ while (test != nil) {+ if ([test.accessibilityIdentifier isEqualToString:@"id.video.non_scrollable_action_bar"]) {+ isNewActionBar = YES;+ break;+ }+ test = test.superview;+ }++ BOOL isSpecialButton = ([iden isEqualToString:@"id.video.like.button"] || [iden isEqualToString:@"id.video.dislike.button"]);++ if (!isSpecialButton) {+ if (isNewActionBar) {+ _ASDisplayView *dpView = (_ASDisplayView *)view.superview;++ ASDisplayNode *node = dpView.keepalive_node;+ NSArray *children = [node.yogaChildren copy];+ for (UIView *child in children) {+ if ([[child description] containsString:iden]) {+ [node removeYogaChild:child];+ break;+ }+ }++ BOOL isFounded = NO;+ _ASDisplayView *targetDpView = dpView;+ while (targetDpView != nil && targetDpView.superview != nil) {+ if ([targetDpView.superview.accessibilityIdentifier isEqualToString:@"id.video.non_scrollable_action_bar"]) {+ isFounded = YES;+ break;+ }+ targetDpView = (_ASDisplayView *)targetDpView.superview;+ }++ if (isFounded && targetDpView) {+ ASDisplayNode *node2 = targetDpView.keepalive_node;+ NSArray *children2 = [node2.yogaChildren copy];+ for (UIView *child in children2) {+ [node2 removeYogaChild:child];+ }+ [targetDpView removeFromSuperview];+ }+ } else {+ UIView *actualMainView = view.superview;+ while (actualMainView != nil && ![actualMainView isKindOfClass:%c(_ASCollectionViewCell)]) {+ actualMainView = actualMainView.superview;+ }++ if (actualMainView) {+ ASCellNode *node = ((_ASCollectionViewCell *)actualMainView).node;+ NSArray *children = [node.yogaChildren copy];+ for (UIView *child in children) {+ [node removeYogaChild:child];+ }+ [actualMainView removeFromSuperview];+ }+ }+ } else {+ _ASDisplayView *dpView = (_ASDisplayView *)view.superview;+ if (dpView) {+ ASDisplayNode *node = dpView.keepalive_node;+ NSArray *children = [node.yogaChildren copy];+ for (UIView *child in children) {+ NSString *desc = [child description];+ if ([desc containsString:iden]) {+ [node removeYogaChild:child];+ [view removeFromSuperview];+ } else if (![desc containsString:@"id.video.like.button"] && ![desc containsString:@"id.video.dislike.button"]) {+ [node removeYogaChild:child];+ }+ }++ if (isNewActionBar) {+ BOOL isFounded = NO;+ _ASDisplayView *targetDpView = dpView;+ while (targetDpView != nil && targetDpView.superview != nil) {+ if ([targetDpView.superview.accessibilityIdentifier isEqualToString:@"id.video.non_scrollable_action_bar"]) {+ isFounded = YES;+ break;+ }+ targetDpView = (_ASDisplayView *)targetDpView.superview;+ }++ if (isFounded && targetDpView) {+ ASDisplayNode *node2 = targetDpView.keepalive_node;+ NSArray *children2 = [node2.yogaChildren copy];+ for (UIView *child in children2) {+ [node2 removeYogaChild:child];+ }+ [targetDpView removeFromSuperview];+ }+ }+ }+ }+ }+}++%hook _ASDisplayView+- (void)didMoveToWindow {+ %orig;+ NSString *iden = self.accessibilityIdentifier;+ if (!iden || iden.length == 0) return;+ BOOL shouldFilter = NO;+ if ([iden isEqualToString:@"id.video.share.button"] && IS_ENABLED(RemoveVideoShareButton)) {+ shouldFilter = YES;+ } else if ([iden isEqualToString:@"id.video.add_to.button"] && IS_ENABLED(RemoveVideoSaveButton)) {+ shouldFilter = YES;+ } else if ([iden isEqualToString:@"id.ui.add_to.offline.button"] && IS_ENABLED(RemoveVideoDownloadButton)) {+ shouldFilter = YES;+ } else if ([iden isEqualToString:@"clip_button.eml"] && IS_ENABLED(RemoveVideoClipButton)) {+ shouldFilter = YES;+ } else if ([iden isEqualToString:@"id.video.remix.button"] && IS_ENABLED(RemoveVideoRemixButton)) {+ shouldFilter = YES;+ } else if ([iden isEqualToString:@"id.video.like.button"] && IS_ENABLED(RemoveVideoLikeButton)) {+ shouldFilter = YES;+ } else if ([iden isEqualToString:@"id.video.dislike.button"] && IS_ENABLED(RemoveVideoDislikeButton)) {+ shouldFilter = YES;+ } else if ([iden isEqualToString:@"id.player.chat.toggle.button"] && IS_ENABLED(RemoveVideoLiveChatButton)) {+ shouldFilter = YES;+ }+ if (shouldFilter) {+ YouModFilterVideoButtons(self, iden);+ }+}+%end++%ctor {+ %init;+ YouModConfigureRemoteSkipCommands();+ if (IS_ENABLED(OldQualityPicker)) {+ %init(OldVideoQuality);+ }+ if (IS_ENABLED(ExtraSpeed) || IS_ENABLED(GestureControls) || INTFORVAL(HoldToSpeedIndex) >= 9 || INTFORVAL(AutoSpeedIndex) >= 9) {+ %init(Speed);+ }+ if (IS_ENABLED(ForceMiniPlayer)) {+ %init(ForceMiniPlayer);+ }+}diff --git a/vendor/YouMod/Files/SABRDownload.x b/vendor/YouMod/Files/SABRDownload.xnew file mode 100644index 0000000..b2da286--- /dev/null+++ b/vendor/YouMod/Files/SABRDownload.x@@ -0,0 +1,743 @@+// SABRDownload.x — On-device SABR download (opt-in, behind the SABRDownload toggle).+//+// Modern YouTube (21.29) ships no direct stream URL; media flows via SABR (server-+// driven adaptive bitrate) over the UMP byte protocol. This downloads on-device by+// CAPTURING the app's own live, fully-signed `videoplayback` request (which already+// carries the session's auth / PoToken in its URL) and REPLAYING a modified copy of+// it — selecting the mp4 itags we want, then reading the returned UMP media parts to+// disk — instead of reconstructing a SABR session from scratch. The two elementary+// files are handed to YouMod's existing muxer for the final mp4.+//+// Additive: gated on SABR_ENABLED(), off by default. Touches none of the existing+// (direct / server) download paths.+//+// Protocol field numbers follow LuanRT/googlevideo (cross-checked against+// coletdjnz/yt-dlp-ytse and Epic0001/YTKACE) but are pinned to what YouTube 21.29+// actually sends; see docs/specs/2026-07-29-sabr-ondevice-download-final.md. They are+// version-sensitive — every wire field is a named constant below so a YouTube update+// can be re-mapped in one place.++#import "Headers.h"++// Active only when the "Download method" setting is On-device (SABR). The capture+// hook must share this gate with the download routing in Download.x, or it won't+// capture the request the engine later needs.+#define SABR_ENABLED() (INTFORVAL(DownloadMethod) == DownloadMethodOnDevice)++// Serial queue guarding all shared engine state (capture globals, per-download+// bookkeeping). Capture hooks and network completions fire on arbitrary threads and+// hop here before touching shared state.+static dispatch_queue_t SABRQueue(void) {+ static dispatch_queue_t q; static dispatch_once_t o;+ dispatch_once(&o, ^{ q = dispatch_queue_create("youmod.sabr", DISPATCH_QUEUE_SERIAL); });+ return q;+}++#pragma mark - UMP parser++// UMP varint: leading 1-bits of the first byte give total byte count (1..5).+static NSUInteger SABRReadUMPVarint(const uint8_t *b, NSUInteger len, NSUInteger pos, uint64_t *out) {+ if (pos >= len) return 0;+ uint8_t pfx = b[pos]; int size = 1;+ if (pfx >= 0xF0) size = 5; else if (pfx >= 0xE0) size = 4; else if (pfx >= 0xC0) size = 3; else if (pfx >= 0x80) size = 2;+ if (pos + size > len) return 0;+ uint64_t r = 0; int sh = 0;+ if (size != 5) { sh = 8 - size; r = pfx & ((1u << sh) - 1); }+ for (int i = 1; i < size; i++) { r |= ((uint64_t)b[pos + i]) << sh; sh += 8; }+ *out = r; return (NSUInteger)size;+}++// UMP part type IDs (LuanRT/googlevideo ump_part_id.proto).+typedef NS_ENUM(NSInteger, SABRPartType) {+ SABRPartMediaHeader = 20,+ SABRPartMedia = 21,+ SABRPartMediaEnd = 22,+ SABRPartNextRequestPolicy = 35,+ SABRPartFormatInit = 42, // FORMAT_INITIALIZATION_METADATA+ SABRPartRedirect = 43, // SABR_REDIRECT (new URL)+ SABRPartError = 44, // SABR_ERROR+ SABRPartReload = 46, // RELOAD_PLAYER_RESPONSE+ SABRPartContextUpdate = 57, // SABR_CONTEXT_UPDATE+ SABRPartStreamProtection = 58, // STREAM_PROTECTION_STATUS+};++// SABR_REDIRECT (part 43) payload: #1 = the replacement videoplayback URL (string).+static const uint64_t kSABRRedirectURL = 1;++// Parse a UMP stream, invoking `handler` per part with (type, payload). Returns+// bytes consumed. Payload for MEDIA parts still includes the leading headerId+// varint (caller strips it).+static NSUInteger SABRParseUMP(NSData *data, void (^handler)(uint64_t type, const uint8_t *payload, NSUInteger size)) {+ const uint8_t *b = (const uint8_t *)data.bytes; NSUInteger len = data.length, pos = 0;+ while (pos < len) {+ uint64_t type = 0, size = 0;+ NSUInteger c1 = SABRReadUMPVarint(b, len, pos, &type); if (!c1) break; pos += c1;+ NSUInteger c2 = SABRReadUMPVarint(b, len, pos, &size); if (!c2) break; pos += c2;+ if (pos + size > len) break;+ if (handler) handler(type, b + pos, (NSUInteger)size);+ pos += (NSUInteger)size;+ }+ return pos;+}++#pragma mark - SABR protobuf field map++// VideoPlaybackAbrRequest top-level fields.+static const uint64_t kSABRReqClientAbrState = 1; // keep verbatim; only #28 player_time overridden+static const uint64_t kSABRReqSelectedFormats = 2; // "initialized" echo list (empty until init metadata arrives)+static const uint64_t kSABRReqBufferedRanges = 3; // what we already hold (drives advancement)+static const uint64_t kSABRReqPlayerTimeMs = 4; // top-level player time+static const uint64_t kSABRReqUstreamerConfig = 5; // ustreamer/policy blob; also carries the available-format list+static const uint64_t kSABRReqPreferredAudio = 16; // preferred_audio_format_ids — the AUDIO download target+static const uint64_t kSABRReqPreferredVideo = 17; // preferred_video_format_ids — the VIDEO download target+// (#19 streamer_context is kept verbatim via the copy-everything-else path.)++static const uint64_t kSABRAbrStatePlayerTimeMs = 28; // ClientAbrState.player_time_ms++// #5 -> #1 -> #6 repeated FormatId = the full available-format list (source of lastModified + xtags).+static const uint64_t kSABRAvailInner = 1; // #5.#1+static const uint64_t kSABRAvailList = 6; // #5.#1.#6 repeated FormatId++// FormatId { #1 itag, #2 last_modified, #3 xtags }.+static const uint64_t kSABRFmtItag = 1;+static const uint64_t kSABRFmtLastMod = 2;+static const uint64_t kSABRFmtXtags = 3;++// BufferedRange { #1 formatId, #2 start_time_ms, #3 duration_ms, #4 start_segment_index,+// #5 end_segment_index, #6 TimeRange } ; TimeRange { #1 start, #2 duration, #3 timescale }.+static const uint64_t kSABRBufFormatId = 1;+static const uint64_t kSABRBufStartMs = 2;+static const uint64_t kSABRBufDurationMs = 3;+static const uint64_t kSABRBufStartSeg = 4;+static const uint64_t kSABRBufEndSeg = 5;+static const uint64_t kSABRBufTimeRange = 6;+static const uint64_t kSABRTimeRangeStart = 1;+static const uint64_t kSABRTimeRangeDur = 2;+static const uint64_t kSABRTimeRangeScale = 3;+static const uint64_t kSABRMsPerSecond = 1000; // ms timebase (also the timescale we emit)++// MediaHeader (UMP part 20) fields. On 21.29 the scalar start/duration (#11/#12) are+// absent and their values come from the #15 TimeRange instead.+static const uint64_t kSABRHdrHeaderId = 1;+static const uint64_t kSABRHdrItag = 3;+static const uint64_t kSABRHdrIsInit = 8;+static const uint64_t kSABRHdrSequence = 9;+static const uint64_t kSABRHdrStartMs = 11; // segment start (ms), scalar — when present+static const uint64_t kSABRHdrDurationMs = 12; // segment duration (ms), scalar — when present+static const uint64_t kSABRHdrFormatId = 13; // fallback FormatId (has itag/xtags)+static const uint64_t kSABRHdrContentLength = 14;+static const uint64_t kSABRHdrTimeRange = 15; // TimeRange { startTicks, durationTicks, timescale }+static const uint64_t kSABRTRStartTicks = 1;+static const uint64_t kSABRTRDurationTicks = 2;+static const uint64_t kSABRTRTimescale = 3;++// FormatInitializationMetadata (UMP part 42) — a track's total length. #1 is the+// video_id string; the FormatId is at #2.+static const uint64_t kSABRInitFormatId = 2; // FormatId { itag, lastModified, xtags }+static const uint64_t kSABRInitEndTimeMs = 3; // total duration ms+static const uint64_t kSABRInitEndSegment = 4; // last segment index++// Cap on request round-trips per download (safety backstop, never hit in practice).+static const int kSABRMaxRequests = 400;+// Bail after this many CONSECUTIVE rounds with no new media (a policy-only round is+// normal; a run of them means the download is genuinely stuck).+static const int kSABRMaxEmptyRounds = 4;++#pragma mark - Protobuf helpers (base-128 varint; distinct from the UMP varint above)++// Protobuf wire types (low 3 bits of a field key).+static const int kProtoWireVarint = 0;+static const int kProtoWire64Bit = 1;+static const int kProtoWireLengthDelimited = 2;+static const int kProtoWire32Bit = 5;++// Read a base-128 varint. Returns bytes consumed (0 on malformed/truncated input).+static NSUInteger SABRReadProtoVarint(const uint8_t *b, NSUInteger len, NSUInteger pos, uint64_t *out) {+ uint64_t v = 0; int sh = 0; NSUInteger start = pos;+ while (pos < len) {+ uint8_t by = b[pos++];+ v |= ((uint64_t)(by & 0x7f)) << sh;+ if (!(by & 0x80)) { if (out) *out = v; return pos - start; }+ sh += 7; if (sh >= 64) return 0;+ }+ return 0;+}++static void SABRAppendProtoVarint(NSMutableData *d, uint64_t v) {+ uint8_t buf[10]; int n = 0;+ do { uint8_t by = v & 0x7f; v >>= 7; if (v) by |= 0x80; buf[n++] = by; } while (v);+ [d appendBytes:buf length:n];+}+static void SABRAppendVarintField(NSMutableData *d, uint64_t field, uint64_t v) {+ SABRAppendProtoVarint(d, (field << 3) | 0); SABRAppendProtoVarint(d, v);+}+static void SABRAppendBytesField(NSMutableData *d, uint64_t field, NSData *bytes) {+ SABRAppendProtoVarint(d, (field << 3) | 2); SABRAppendProtoVarint(d, bytes.length); [d appendData:bytes];+}++// Walk ONE level of a protobuf message. handler receives each field's number, wire+// type, the byte span of the whole field (tag..end), and its payload span. Return NO+// from handler to stop early. Returns YES only if the buffer parsed cleanly+// end-to-end (a malformed field aborts with NO).+static BOOL SABRIterateTopLevel(NSData *data, BOOL (^handler)(uint64_t field, int wire, NSUInteger fieldStart, NSUInteger fieldEnd, NSUInteger payloadStart, NSUInteger payloadLen)) {+ const uint8_t *b = (const uint8_t *)data.bytes; NSUInteger len = data.length, pos = 0;+ while (pos < len) {+ NSUInteger fieldStart = pos;+ uint64_t key = 0; NSUInteger kc = SABRReadProtoVarint(b, len, pos, &key); if (!kc) return NO; pos += kc;+ uint64_t field = key >> 3; int wire = key & 0x7;+ NSUInteger payloadStart = pos, payloadLen = 0;+ if (wire == kProtoWireVarint) { uint64_t v; NSUInteger c = SABRReadProtoVarint(b, len, pos, &v); if (!c) return NO; payloadLen = c; pos += c; }+ else if (wire == kProtoWire64Bit) { if (pos + 8 > len) return NO; payloadLen = 8; pos += 8; }+ else if (wire == kProtoWireLengthDelimited) { uint64_t l; NSUInteger c = SABRReadProtoVarint(b, len, pos, &l); if (!c || pos + c + l > len) return NO; payloadStart = pos + c; payloadLen = (NSUInteger)l; pos += c + l; }+ else if (wire == kProtoWire32Bit) { if (pos + 4 > len) return NO; payloadLen = 4; pos += 4; }+ else return NO;+ if (handler && !handler(field, wire, fieldStart, pos, payloadStart, payloadLen)) return YES;+ }+ return YES;+}++// Read one varint field's value from a message (first match). Returns whether found.+static BOOL SABRReadVarintField(NSData *msg, uint64_t field, uint64_t *out) {+ const uint8_t *b = (const uint8_t *)msg.bytes; NSUInteger len = msg.length;+ __block BOOL got = NO; __block uint64_t val = 0;+ SABRIterateTopLevel(msg, ^BOOL(uint64_t f, int w, NSUInteger fs, NSUInteger fe, NSUInteger ps, NSUInteger pl) {+ if (f == field && w == kProtoWireVarint) { uint64_t v = 0; if (SABRReadProtoVarint(b, len, ps, &v)) { val = v; got = YES; return NO; } }+ return YES;+ });+ if (got && out) *out = val;+ return got;+}++// Return a copy of `msg` with varint `field` set to `value` (replacing an existing+// one in place, or appended if absent). Non-target fields are copied byte-for-byte.+static NSData *SABRSetVarintField(NSData *msg, uint64_t field, uint64_t value) {+ const uint8_t *b = (const uint8_t *)msg.bytes;+ NSMutableData *out = [NSMutableData data];+ __block BOOL replaced = NO;+ BOOL ok = SABRIterateTopLevel(msg, ^BOOL(uint64_t f, int w, NSUInteger fs, NSUInteger fe, NSUInteger ps, NSUInteger pl) {+ if (f == field && w == kProtoWireVarint) { SABRAppendVarintField(out, field, value); replaced = YES; }+ else [out appendBytes:b + fs length:fe - fs];+ return YES;+ });+ if (!ok) return [msg copy]; // don't corrupt a body we can't parse+ if (!replaced) SABRAppendVarintField(out, field, value);+ return out;+}++#pragma mark - Available formats (#5) → {lastModified, xtags} for a chosen itag++// A resolved download target: itag + the lastModified/xtags copied verbatim from #5.+@interface YMSABRFormat : NSObject+@property (nonatomic, assign) uint64_t itag;+@property (nonatomic, assign) uint64_t lastModified;+@property (nonatomic, strong) NSData *xtags; // may be empty; always emitted (matches the real client)+@property (nonatomic, assign) BOOL found;+@end+@implementation YMSABRFormat @end++// Parse a FormatId message → {itag, lastModified, xtags}.+static YMSABRFormat *SABRParseFormatId(NSData *fmt) {+ YMSABRFormat *r = [YMSABRFormat new]; r.xtags = [NSData data];+ const uint8_t *b = (const uint8_t *)fmt.bytes; NSUInteger len = fmt.length;+ SABRIterateTopLevel(fmt, ^BOOL(uint64_t f, int w, NSUInteger fs, NSUInteger fe, NSUInteger ps, NSUInteger pl) {+ if (f == kSABRFmtItag && w == kProtoWireVarint) { uint64_t v = 0; if (SABRReadProtoVarint(b, len, ps, &v)) r.itag = v; }+ else if (f == kSABRFmtLastMod && w == kProtoWireVarint) { uint64_t v = 0; if (SABRReadProtoVarint(b, len, ps, &v)) r.lastModified = v; }+ else if (f == kSABRFmtXtags && w == kProtoWireLengthDelimited) { r.xtags = [fmt subdataWithRange:NSMakeRange(ps, pl)]; }+ return YES;+ });+ return r;+}++// Resolve a download target for `itag` from the available-format list (#5.#1.#6).+// Some itags appear twice — a plain entry and an xtags-tagged variant (distinct+// formats, not versions). We prefer the xtags variant because that's what the app+// itself selects (our capture played 251 with xtags), and we copy {itag,+// lastModified, xtags} as one consistent triple so server-side matching lines up.+static YMSABRFormat *SABRResolveFormat(NSData *body, uint64_t itag) {+ YMSABRFormat *result = [YMSABRFormat new];+ SABRIterateTopLevel(body, ^BOOL(uint64_t f5, int w5, NSUInteger fs, NSUInteger fe, NSUInteger ps5, NSUInteger pl5) {+ if (f5 != kSABRReqUstreamerConfig || w5 != kProtoWireLengthDelimited) return YES;+ NSData *avail = [body subdataWithRange:NSMakeRange(ps5, pl5)];+ SABRIterateTopLevel(avail, ^BOOL(uint64_t f1, int w1, NSUInteger fs1, NSUInteger fe1, NSUInteger ps1, NSUInteger pl1) {+ if (f1 != kSABRAvailInner || w1 != kProtoWireLengthDelimited) return YES;+ NSData *inner = [avail subdataWithRange:NSMakeRange(ps1, pl1)];+ SABRIterateTopLevel(inner, ^BOOL(uint64_t f6, int w6, NSUInteger fs6, NSUInteger fe6, NSUInteger ps6, NSUInteger pl6) {+ if (f6 != kSABRAvailList || w6 != kProtoWireLengthDelimited) return YES;+ YMSABRFormat *fmt = SABRParseFormatId([inner subdataWithRange:NSMakeRange(ps6, pl6)]);+ if (fmt.itag == itag) {+ // Keep the first match, but upgrade to an entry that carries xtags.+ if (!result.found || (result.xtags.length == 0 && fmt.xtags.length > 0)) {+ result.itag = fmt.itag; result.lastModified = fmt.lastModified;+ result.xtags = fmt.xtags; result.found = YES;+ }+ }+ return YES;+ });+ return YES;+ });+ return NO; // only the first #5+ });+ return result;+}++// Encode a FormatId submessage { #1 itag, #2 lastModified, #3 xtags }. xtags is+// always emitted (empty string if none) — matches YTKACE / the real client.+static NSData *SABREncodeFormatId(YMSABRFormat *fmt) {+ NSMutableData *d = [NSMutableData data];+ SABRAppendVarintField(d, kSABRFmtItag, fmt.itag);+ SABRAppendVarintField(d, kSABRFmtLastMod, fmt.lastModified);+ SABRAppendBytesField(d, kSABRFmtXtags, fmt.xtags ?: [NSData data]);+ return d;+}++// Encode a BufferedRange reporting the REAL extent just received for a track:+// segments [startSeg..endSeg] spanning [startMs, startMs+durationMs). Reporting the+// true extent (not player_time) is essential — overstating it makes the server think+// the track is fully buffered and stop sending its remaining segments.+static NSData *SABREncodeBufferedRange(YMSABRFormat *fmt, uint64_t startSeg, uint64_t endSeg, uint64_t startMs, uint64_t durationMs) {+ NSMutableData *tr = [NSMutableData data];+ SABRAppendVarintField(tr, kSABRTimeRangeStart, startMs);+ SABRAppendVarintField(tr, kSABRTimeRangeDur, durationMs);+ SABRAppendVarintField(tr, kSABRTimeRangeScale, kSABRMsPerSecond);++ NSMutableData *br = [NSMutableData data];+ SABRAppendBytesField(br, kSABRBufFormatId, SABREncodeFormatId(fmt));+ SABRAppendVarintField(br, kSABRBufStartMs, startMs);+ SABRAppendVarintField(br, kSABRBufDurationMs, durationMs);+ SABRAppendVarintField(br, kSABRBufStartSeg, startSeg);+ SABRAppendVarintField(br, kSABRBufEndSeg, endSeg);+ SABRAppendBytesField(br, kSABRBufTimeRange, tr);+ return br;+}++#pragma mark - Response part decoders (MEDIA_HEADER / FORMAT_INIT)++// Decoded MEDIA_HEADER (UMP part 20): maps a headerId to a format + segment.+@interface YMSABRMediaHeader : NSObject+@property (nonatomic, assign) uint64_t headerId;+@property (nonatomic, assign) uint64_t itag;+@property (nonatomic, assign) uint64_t sequence;+@property (nonatomic, assign) uint64_t startMs;+@property (nonatomic, assign) uint64_t durationMs;+@property (nonatomic, assign) uint64_t contentLength;+@property (nonatomic, assign) BOOL isInit;+@end+@implementation YMSABRMediaHeader @end++// Convert a TimeRange tick count to milliseconds (rounded).+static uint64_t SABRTicksToMs(uint64_t ticks, uint64_t timescale) {+ if (timescale == 0) return 0;+ return (uint64_t)(((double)ticks / (double)timescale) * (double)kSABRMsPerSecond + 0.5);+}++static YMSABRMediaHeader *SABRDecodeMediaHeader(const uint8_t *payload, NSUInteger size) {+ NSData *msg = [NSData dataWithBytesNoCopy:(void *)payload length:size freeWhenDone:NO];+ YMSABRMediaHeader *h = [YMSABRMediaHeader new];+ const uint8_t *b = (const uint8_t *)msg.bytes; NSUInteger len = msg.length;+ SABRIterateTopLevel(msg, ^BOOL(uint64_t f, int w, NSUInteger fs, NSUInteger fe, NSUInteger ps, NSUInteger pl) {+ if (f == kSABRHdrHeaderId && w == kProtoWireVarint) { uint64_t v=0; if (SABRReadProtoVarint(b,len,ps,&v)) h.headerId = v; }+ else if (f == kSABRHdrItag && w == kProtoWireVarint) { uint64_t v=0; if (SABRReadProtoVarint(b,len,ps,&v)) h.itag = v; }+ else if (f == kSABRHdrIsInit && w == kProtoWireVarint) { uint64_t v=0; if (SABRReadProtoVarint(b,len,ps,&v)) h.isInit = (v != 0); }+ else if (f == kSABRHdrSequence && w == kProtoWireVarint) { uint64_t v=0; if (SABRReadProtoVarint(b,len,ps,&v)) h.sequence = v; }+ else if (f == kSABRHdrStartMs && w == kProtoWireVarint) { uint64_t v=0; if (SABRReadProtoVarint(b,len,ps,&v)) h.startMs = v; }+ else if (f == kSABRHdrDurationMs && w == kProtoWireVarint) { uint64_t v=0; if (SABRReadProtoVarint(b,len,ps,&v)) h.durationMs = v; }+ else if (f == kSABRHdrContentLength && w == kProtoWireVarint){ uint64_t v=0; if (SABRReadProtoVarint(b,len,ps,&v)) h.contentLength = v; }+ else if (f == kSABRHdrFormatId && w == kProtoWireLengthDelimited && h.itag == 0) { // fallback itag from nested FormatId+ YMSABRFormat *fmt = SABRParseFormatId([msg subdataWithRange:NSMakeRange(ps, pl)]);+ if (fmt.itag) h.itag = fmt.itag;+ }+ else if (f == kSABRHdrTimeRange && w == kProtoWireLengthDelimited) { // TimeRange — the start/duration source on 21.29+ NSData *tr = [msg subdataWithRange:NSMakeRange(ps, pl)];+ uint64_t startTicks = 0, durTicks = 0, timescale = 0;+ SABRReadVarintField(tr, kSABRTRStartTicks, &startTicks);+ SABRReadVarintField(tr, kSABRTRDurationTicks, &durTicks);+ SABRReadVarintField(tr, kSABRTRTimescale, ×cale);+ if (timescale > 0) {+ if (h.durationMs == 0 && durTicks) h.durationMs = SABRTicksToMs(durTicks, timescale);+ if (h.startMs == 0 && startTicks) h.startMs = SABRTicksToMs(startTicks, timescale);+ }+ }+ return YES;+ });+ return h;+}++// FORMAT_INITIALIZATION_METADATA (part 42): the authoritative end-of-track marker.+static void SABRDecodeFormatInit(const uint8_t *payload, NSUInteger size, uint64_t *itag, uint64_t *endSeg, uint64_t *endTimeMs) {+ NSData *msg = [NSData dataWithBytesNoCopy:(void *)payload length:size freeWhenDone:NO];+ const uint8_t *b = (const uint8_t *)msg.bytes; NSUInteger len = msg.length;+ __block uint64_t it = 0;+ SABRIterateTopLevel(msg, ^BOOL(uint64_t f, int w, NSUInteger fs, NSUInteger fe, NSUInteger ps, NSUInteger pl) {+ if (f == kSABRInitFormatId && w == kProtoWireLengthDelimited) { YMSABRFormat *fmt = SABRParseFormatId([msg subdataWithRange:NSMakeRange(ps, pl)]); if (fmt.itag) it = fmt.itag; }+ else if (f == kSABRInitEndSegment && w == kProtoWireVarint) { uint64_t v=0; if (SABRReadProtoVarint(b,len,ps,&v) && endSeg) *endSeg = v; }+ else if (f == kSABRInitEndTimeMs && w == kProtoWireVarint) { uint64_t v=0; if (SABRReadProtoVarint(b,len,ps,&v) && endTimeMs) *endTimeMs = v; }+ return YES;+ });+ if (itag) *itag = it;+}++#pragma mark - Per-track download state++// Accumulates one track's media (keyed by ITAG, not headerId — the init segment and+// media segments of a track arrive under different headerIds). Written to `fileURL`.+@interface YMSABRTrack : NSObject+@property (nonatomic, strong) YMSABRFormat *format;+@property (nonatomic, strong) NSURL *fileURL;+@property (nonatomic, strong) NSFileHandle *handle;+@property (nonatomic, assign) uint64_t downloadedMs; // real total downloaded duration (sum of segment durations)+@property (nonatomic, assign) uint64_t lastSequence; // highest segment index written+// Per-round window of NEW segments (for the buffered_range we report each round —+// the reference sends a delta window, not a cumulative 0..N range).+@property (nonatomic, assign) uint64_t roundStartMs;+@property (nonatomic, assign) uint64_t roundDurationMs;+@property (nonatomic, assign) uint64_t roundFirstSeq;+@property (nonatomic, assign) uint64_t roundLastSeq;+@property (nonatomic, assign) BOOL roundHasMedia;+@property (nonatomic, assign) uint64_t endSegment; // from FORMAT_INIT (0 = unknown)+@property (nonatomic, assign) uint64_t endTimeMs; // from FORMAT_INIT (0 = unknown)+@property (nonatomic, assign) BOOL initWritten;+@property (nonatomic, assign) BOOL complete;+@property (nonatomic, assign) unsigned long long bytesWritten;+@end+@implementation YMSABRTrack @end++#pragma mark - Capture layer (permanent): the app's live signed videoplayback request++// Captured request material — tracks the MOST-RECENT videoplayback request, i.e. the+// currently watched video, so switching videos re-captures the new one. Capturing+// mid-playback is safe: the engine rebuilds the buffered ranges (#3) and selected+// formats from scratch and never depends on the captured body's own ranges.+// Touched only on SABRQueue.+static NSURL *gCapURL;+static NSData *gCapPlainBody; // pre-Brotli body (from -HTTPBody)+static NSDictionary *gCapHeaders;+static NSTimeInterval gCapExpire; // from the URL's expire= param+static BOOL gSABRCancel; // set to abort the active download loop (touched on SABRQueue)++static NSTimeInterval SABRExpireFromURL(NSURL *url) {+ for (NSURLQueryItem *item in [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:NO].queryItems)+ if ([item.name isEqualToString:@"expire"]) return item.value.doubleValue;+ return 0;+}++%hook HAMDataLoadRequest+- (NSURLRequest *)buildURLRequest {+ NSURLRequest *r = %orig;+ if (!SABR_ENABLED()) return r;+ @try {+ NSString *host = r.URL.host ?: @""; NSString *path = r.URL.path ?: @"";+ if ([host containsString:@"googlevideo"] && [path containsString:@"videoplayback"] &&+ [r.HTTPMethod isEqualToString:@"POST"]) {+ id me = self;+ NSData *plain = nil; @try { plain = [me HTTPBody]; } @catch (id ex) {}+ NSURL *url = r.URL;+ NSData *plainCopy = [plain copy];+ NSMutableDictionary *hdrs = [r.allHTTPHeaderFields mutableCopy] ?: [NSMutableDictionary dictionary];+ dispatch_async(SABRQueue(), ^{+ // Most-recent-wins: always track the latest videoplayback request (the+ // current video), so switching videos captures the new one.+ gCapURL = url; gCapPlainBody = plainCopy; gCapHeaders = hdrs; gCapExpire = SABRExpireFromURL(url);+ });+ }+ } @catch (id ex) {}+ return r;+}+%end++#pragma mark - Request builder++// Build one request body targeting `videoFmt` + `audioFmt`:+// #16 = preferred audio FormatId, #17 = preferred video FormatId (the real+// download targets — sent every request).+// #2 = the "initialized" echo list (empty until formats initialize).+// #3 = buffered ranges we already hold (empty = stream from start).+// #1.#28 + #4 = player_time_ms (advances the stream).+// #1 / #5 / #19 kept byte-for-byte (auth/session/config stay intact).+// `bufferedRanges` / `selectedFormats` are pre-encoded FormatId/BufferedRange+// submessages (nil/empty on the first request).+static NSData *SABRBuildRequestBody(NSData *orig, YMSABRFormat *videoFmt, YMSABRFormat *audioFmt,+ uint64_t playerTimeMs, NSArray<NSData *> *bufferedRanges,+ NSArray<NSData *> *selectedFormats) {+ const uint8_t *b = (const uint8_t *)orig.bytes;+ NSMutableData *out = [NSMutableData data];+ BOOL parsed = SABRIterateTopLevel(orig, ^BOOL(uint64_t field, int wire, NSUInteger fs, NSUInteger fe, NSUInteger ps, NSUInteger pl) {+ // Drop the fields we rebuild; copy everything else verbatim.+ if (field == kSABRReqSelectedFormats || field == kSABRReqBufferedRanges ||+ field == kSABRReqPreferredAudio || field == kSABRReqPreferredVideo ||+ field == kSABRReqPlayerTimeMs) return YES;+ if (field == kSABRReqClientAbrState && wire == 2) {+ // Override player_time_ms (#28) inside the ClientAbrState, keep the rest.+ NSData *state = SABRSetVarintField([orig subdataWithRange:NSMakeRange(ps, pl)], kSABRAbrStatePlayerTimeMs, playerTimeMs);+ SABRAppendBytesField(out, kSABRReqClientAbrState, state);+ return YES;+ }+ [out appendBytes:b + fs length:fe - fs];+ return YES;+ });+ if (!parsed) return nil;++ SABRAppendVarintField(out, kSABRReqPlayerTimeMs, playerTimeMs);+ if (audioFmt) SABRAppendBytesField(out, kSABRReqPreferredAudio, SABREncodeFormatId(audioFmt));+ if (videoFmt) SABRAppendBytesField(out, kSABRReqPreferredVideo, SABREncodeFormatId(videoFmt));+ for (NSData *sel in selectedFormats) SABRAppendBytesField(out, kSABRReqSelectedFormats, sel);+ for (NSData *br in bufferedRanges) SABRAppendBytesField(out, kSABRReqBufferedRanges, br);+ return out;+}++#pragma mark - Download engine (permanent)++// One network round-trip: POST `body` uncompressed to the captured signed URL,+// return the raw UMP response. Called ON SABRQueue (it reads gCapHeaders); the+// NSURLSession completion runs on an arbitrary queue, so the caller's completion+// block must hop back to SABRQueue before touching shared state.+static void SABRPostOnce(NSURL *url, NSData *body, void (^completion)(NSData *data, NSHTTPURLResponse *http, NSError *err)) {+ NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];+ req.HTTPMethod = @"POST";+ req.HTTPBody = body;+ [gCapHeaders enumerateKeysAndObjectsUsingBlock:^(NSString *k, NSString *v, BOOL *stop) {+ if ([k caseInsensitiveCompare:@"Content-Encoding"] == NSOrderedSame) return; // no Brotli+ if ([k caseInsensitiveCompare:@"Content-Length"] == NSOrderedSame) return; // session sets it+ [req setValue:v forHTTPHeaderField:k];+ }];+ NSURLSession *s = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration ephemeralSessionConfiguration]];+ [[s dataTaskWithRequest:req completionHandler:^(NSData *data, NSURLResponse *resp, NSError *err) {+ completion(data, [resp isKindOfClass:NSHTTPURLResponse.class] ? (NSHTTPURLResponse *)resp : nil, err);+ }] resume];+}++// Parse one UMP response, routing media to whichever track (by itag) it belongs to.+// Writes init segments (once) + media segments, updates each track's lastSequence,+// downloaded duration, per-round window, and FORMAT_INIT markers, and reports any+// redirect URL / reload flag via out-params.+static void SABRIngestResponse(NSData *data, NSDictionary<NSNumber *, YMSABRTrack *> *tracks,+ NSString **redirectURL, BOOL *reload) {+ NSMutableDictionary<NSNumber *, YMSABRMediaHeader *> *headers = [NSMutableDictionary dictionary]; // headerId -> header+ __block NSString *redirect = nil; __block BOOL sawReload = NO;++ // Reset each track's per-round window; it's rebuilt from the real headers below.+ for (NSNumber *itag in tracks) {+ YMSABRTrack *t = tracks[itag];+ t.roundHasMedia = NO; t.roundStartMs = 0; t.roundDurationMs = 0; t.roundFirstSeq = 0; t.roundLastSeq = 0;+ }++ SABRParseUMP(data, ^(uint64_t type, const uint8_t *payload, NSUInteger size) {+ if (type == SABRPartMediaHeader) {+ YMSABRMediaHeader *h = SABRDecodeMediaHeader(payload, size);+ headers[@(h.headerId)] = h;+ } else if (type == SABRPartMedia && size > 0) {+ uint64_t hid = 0; NSUInteger hc = SABRReadUMPVarint(payload, size, 0, &hid);+ if (hc == 0 || hc > size) return;+ YMSABRMediaHeader *h = headers[@(hid)];+ YMSABRTrack *track = h ? tracks[@(h.itag)] : nil;+ if (!track) return; // media for a format we're not collecting+ if (h.isInit) {+ if (!track.initWritten) { [track.handle writeData:[NSData dataWithBytes:payload + hc length:size - hc]]; track.bytesWritten += size - hc; track.initWritten = YES; }+ return;+ }+ // A segment can arrive more than once (same sequence, different headerId)+ // when pacing changes; only sequences beyond the high-water mark are new.+ // Writing a duplicate would corrupt the elementary stream.+ if (h.sequence <= track.lastSequence) return;+ [track.handle writeData:[NSData dataWithBytes:payload + hc length:size - hc]];+ track.bytesWritten += size - hc;+ } else if (type == SABRPartMediaEnd && size > 0) {+ YMSABRMediaHeader *h = headers[@(payload[0])];+ YMSABRTrack *track = h ? tracks[@(h.itag)] : nil;+ if (!track || h.isInit) return;+ if (h.sequence <= track.lastSequence) return; // duplicate segment: don't double-count+ track.lastSequence = h.sequence;+ track.downloadedMs += h.durationMs; // real total from #15-derived duration+ // Extend this round's contiguous window with the segment's real timing.+ if (!track.roundHasMedia) { track.roundHasMedia = YES; track.roundStartMs = h.startMs; track.roundFirstSeq = h.sequence; }+ track.roundDurationMs += h.durationMs;+ track.roundLastSeq = h.sequence;+ } else if (type == SABRPartFormatInit) {+ uint64_t it = 0, endSeg = 0, endMs = 0;+ SABRDecodeFormatInit(payload, size, &it, &endSeg, &endMs);+ YMSABRTrack *track = tracks[@(it)];+ if (track) { if (endSeg) track.endSegment = endSeg; if (endMs) track.endTimeMs = endMs; }+ } else if (type == SABRPartRedirect) {+ NSData *msg = [NSData dataWithBytesNoCopy:(void *)payload length:size freeWhenDone:NO];+ SABRIterateTopLevel(msg, ^BOOL(uint64_t f, int w, NSUInteger fs, NSUInteger fe, NSUInteger ps, NSUInteger pl) {+ // -copy detaches from the transient no-copy payload.+ if (f == kSABRRedirectURL && w == kProtoWireLengthDelimited) redirect = [[[NSString alloc] initWithData:[msg subdataWithRange:NSMakeRange(ps, pl)] encoding:NSUTF8StringEncoding] copy];+ return NO;+ });+ } else if (type == SABRPartReload) {+ sawReload = YES;+ }+ });++ if (redirectURL) *redirectURL = redirect;+ if (reload) *reload = sawReload;+}++// A track is complete once it has reached its last segment (authoritative), or its+// real downloaded duration has reached the total (belt-and-suspenders).+static BOOL SABRTrackDone(YMSABRTrack *track) {+ if (!track.endSegment && !track.endTimeMs) return NO; // no markers yet → not done+ if (track.endSegment && track.lastSequence >= track.endSegment) return YES;+ if (track.endTimeMs && track.downloadedMs + 500 >= track.endTimeMs) return YES;+ return NO;+}++// Open a fresh unique temp file for a track (unique per download so a stale or+// concurrent run can't collide/overwrite).+static YMSABRTrack *SABRMakeTrack(YMSABRFormat *fmt, NSString *ext) {+ NSString *name = [NSString stringWithFormat:@"sabr_%llu_%@.%@", fmt.itag, [NSUUID UUID].UUIDString, ext];+ NSString *path = [NSTemporaryDirectory() stringByAppendingPathComponent:name];+ [[NSFileManager defaultManager] createFileAtPath:path contents:nil attributes:nil];+ YMSABRTrack *t = [YMSABRTrack new];+ t.format = fmt;+ t.fileURL = [NSURL fileURLWithPath:path];+ t.handle = [NSFileHandle fileHandleForWritingAtPath:path];+ return t;+}++// Orchestrator: download the video itag + audio itag together (both requested every+// round; media routed to a file per track by itag) until every track reaches its+// last segment, then call `completion(videoURL, audioURL, err)` on the main queue.+// Pass videoItag == 0 for an audio-only download (videoURL is then nil).+// NB: named SABRRunDownload, not SABRDownload — the latter is a settings-key macro.+static void SABRRunDownload(uint64_t videoItag, uint64_t audioItag,+ void (^progress)(float fraction, unsigned long long bytesDownloaded, BOOL isAudio),+ void (^completion)(NSURL *videoURL, NSURL *audioURL, NSString *err)) {+ dispatch_async(SABRQueue(), ^{+ if (!gCapURL || !gCapPlainBody.length) {+ dispatch_async(dispatch_get_main_queue(), ^{ completion(nil, nil, @"No request captured yet — play the video for a few seconds first."); });+ return;+ }+ BOOL wantVideo = videoItag != 0;+ YMSABRFormat *videoFmt = wantVideo ? SABRResolveFormat(gCapPlainBody, videoItag) : nil;+ YMSABRFormat *audioFmt = SABRResolveFormat(gCapPlainBody, audioItag);+ if ((wantVideo && !videoFmt.found) || !audioFmt.found) {+ NSString *videoState = !wantVideo ? @"n/a" : (videoFmt.found ? @"ok" : @"missing");+ dispatch_async(dispatch_get_main_queue(), ^{ completion(nil, nil, [NSString stringWithFormat:@"format not available (video %llu:%@, audio %llu:%@)", videoItag, videoState, audioItag, audioFmt.found?@"ok":@"missing"]); });+ return;+ }++ gSABRCancel = NO;+ YMSABRTrack *videoTrack = wantVideo ? SABRMakeTrack(videoFmt, @"mp4") : nil;+ YMSABRTrack *audioTrack = SABRMakeTrack(audioFmt, @"m4a");+ // Ordered [video?, audio]; `mainTrack` (first = video when present, else audio)+ // drives player_time, matching the reference's "drive off the main format".+ NSArray<YMSABRTrack *> *trackList = wantVideo ? @[videoTrack, audioTrack] : @[audioTrack];+ YMSABRTrack *mainTrack = trackList.firstObject;+ NSMutableDictionary<NSNumber *, YMSABRTrack *> *tracks = [NSMutableDictionary dictionary];+ for (YMSABRTrack *t in trackList) tracks[@(t.format.itag)] = t;++ __block int requestCount = 0;+ __block int emptyRounds = 0; // consecutive rounds with no new media (SABR may send policy-only rounds)+ __block BOOL finished = NO;+ __block NSURL *currentURL = gCapURL;+ // Recursive loop across async network callbacks: hold the block in a heap box+ // and recurse through it (a direct capture is an ARC retain-cycle error);+ // `finish` empties the box to free the loop.+ NSMutableArray *box = [NSMutableArray arrayWithObject:[NSNull null]];+ void (^callRound)(void) = ^{ id r = box.firstObject; if (r && r != [NSNull null]) ((void (^)(void))r)(); };+ void (^finish)(NSString *) = ^(NSString *err) {+ if (finished) return; // idempotent: never double-close / double-complete+ finished = YES;+ [box removeAllObjects];+ for (YMSABRTrack *t in trackList) [t.handle closeFile];+ if (err) { // failed/cancelled → don't leave partial files behind+ for (YMSABRTrack *t in trackList) [[NSFileManager defaultManager] removeItemAtURL:t.fileURL error:nil];+ }+ dispatch_async(dispatch_get_main_queue(), ^{+ if (err) completion(nil, nil, err);+ else completion(videoTrack.fileURL, audioTrack.fileURL, nil);+ });+ };+ void (^round)(void) = ^{+ if (gSABRCancel) { finish(@"cancelled"); return; }+ if (requestCount++ >= kSABRMaxRequests) { finish(@"exceeded request cap"); return; }++ // Each requested format stays in its preferred field (#16/#17) for the whole+ // session; a finished track is silenced only by its buffered_ranges (which+ // tell the server it is fully buffered). Removing a completed format from+ // #16/#17 instead would change the request shape and stall the other track.+ NSMutableArray<NSData *> *buffered = [NSMutableArray array];+ NSMutableArray<NSData *> *selected = [NSMutableArray array];+ // Report each track's REAL per-round window (the delta of segments received+ // last round: real start/duration/first/last from #15 time_range), as the+ // reference does — never player_time. Overstating a track's buffered extent+ // makes the server treat it as complete and stop sending its tail segments.+ for (YMSABRTrack *t in trackList) {+ if (t.roundHasMedia) {+ [buffered addObject:SABREncodeBufferedRange(t.format, t.roundFirstSeq, t.roundLastSeq, t.roundStartMs, t.roundDurationMs)];+ }+ if (t.lastSequence > 0) [selected addObject:SABREncodeFormatId(t.format)];+ }+ // Drive player_time off the main track's real downloaded total (video when+ // present, else audio). The playhead stays at/ahead of each track's buffered+ // edge and pulls the remaining segments forward.+ uint64_t driveTime = mainTrack.downloadedMs;+ NSData *body = SABRBuildRequestBody(gCapPlainBody, videoFmt, audioFmt, driveTime, buffered, selected);+ if (!body) { finish(@"failed to build request body"); return; }++ SABRPostOnce(currentURL, body, ^(NSData *data, NSHTTPURLResponse *http, NSError *err) {+ dispatch_async(SABRQueue(), ^{+ if (err || !http) { finish([NSString stringWithFormat:@"network error: %@", err.localizedDescription ?: @"no response"]); return; }+ if (http.statusCode != 200 || !data.length) { finish([NSString stringWithFormat:@"HTTP %ld (%lu bytes)", (long)http.statusCode, (unsigned long)data.length]); return; }++ NSMutableDictionary<NSNumber *, NSNumber *> *beforeSeq = [NSMutableDictionary dictionary];+ for (YMSABRTrack *t in trackList) beforeSeq[@(t.format.itag)] = @(t.lastSequence);+ NSString *redirect = nil; BOOL reload = NO;+ SABRIngestResponse(data, tracks, &redirect, &reload);++ if (reload) { finish(@"session expired (RELOAD) — replay the video and try again"); return; }+ if (redirect.length) currentURL = [NSURL URLWithString:redirect] ?: currentURL;++ BOOL allDone = YES; float fracSum = 0; unsigned long long bytesTotal = 0;+ for (YMSABRTrack *t in trackList) {+ t.complete = SABRTrackDone(t);+ if (!t.complete) allDone = NO;+ fracSum += t.endTimeMs ? MIN(1.0f, (float)t.downloadedMs / (float)t.endTimeMs) : 0;+ bytesTotal += t.bytesWritten;+ }+ BOOL isAudio = (videoTrack != nil && videoTrack.complete && audioTrack != nil && !audioTrack.complete);+ if (progress) progress(fracSum / (float)trackList.count, bytesTotal, isAudio);+ if (allDone) { finish(nil); return; }+ // Stall guard keys off SEQUENCE advancement, not raw bytes: a request+ // that can't make progress still returns the same segment (nonzero+ // bytes, no new sequence), so a bytes check would never trip. Bail+ // after several CONSECUTIVE rounds where no INCOMPLETE track advanced.+ BOOL advanced = NO;+ for (YMSABRTrack *t in trackList)+ if (!t.complete && t.lastSequence > beforeSeq[@(t.format.itag)].unsignedLongLongValue) advanced = YES;+ emptyRounds = advanced ? 0 : (emptyRounds + 1);+ if (emptyRounds >= kSABRMaxEmptyRounds) { finish(@"stalled — no forward progress for several rounds"); return; }+ callRound();+ });+ });+ };+ box[0] = round;+ round();+ });+}++#pragma mark - Public entry (called from Download.x)++// Download the chosen mp4 video itag + m4a audio itag on-device via SABR, producing+// two elementary files. `progress` (0..1) and `completion` are always delivered on+// the main queue. The caller hands the two files to its existing muxer.+@implementation YMSABR++ (void)downloadVideoItag:(int)videoItag audioItag:(int)audioItag+ progress:(void (^)(float fraction, unsigned long long bytesDownloaded, BOOL isAudio))progress+ completion:(void (^)(NSURL *videoURL, NSURL *audioURL, NSString *err))completion {+ SABRRunDownload((uint64_t)videoItag, (uint64_t)audioItag,+ ^(float f, unsigned long long bytes, BOOL isAudio) { if (progress) dispatch_async(dispatch_get_main_queue(), ^{ progress(f, bytes, isAudio); }); },+ completion); // SABRRunDownload already delivers completion on the main queue+}++ (void)downloadAudioItag:(int)audioItag+ progress:(void (^)(float fraction, unsigned long long bytesDownloaded))progress+ completion:(void (^)(NSURL *audioURL, NSString *err))completion {+ // videoItag 0 → audio-only; deliver just the audio file.+ SABRRunDownload(0, (uint64_t)audioItag,+ ^(float f, unsigned long long bytes, BOOL isAudio) { if (progress) dispatch_async(dispatch_get_main_queue(), ^{ progress(f, bytes); }); },+ ^(NSURL *videoURL, NSURL *audioURL, NSString *err) { completion(audioURL, err); });+}++ (void)cancelCurrent {+ dispatch_async(SABRQueue(), ^{ gSABRCancel = YES; }); // loop aborts at its next round+}+@enddiff --git a/vendor/YouMod/Files/Settings.x b/vendor/YouMod/Files/Settings.xnew file mode 100644index 0000000..4e6a77c--- /dev/null+++ b/vendor/YouMod/Files/Settings.x@@ -0,0 +1,652 @@+// Settings.x+// Thanks to the original codes from YTUHD by PoomSmart - https://github.com/PoomSmart/YTUHD/blob/0e735616fd8fc6546339da7fdc78466f16f23ffd/Settings.x+#import "Headers.h"++#define TweakName @"YouMod"++#define YMLOC(x) [YouModBundle() localizedStringForKey:x value:nil table:nil]+#define STRINGIFY(x) #x+#define TOSTRING(x) STRINGIFY(x)++static const NSInteger TweakSection = 'ytmo';++@interface YMSettingsItem : NSObject+- (BOOL)isVisible;+- (BOOL)isVisibleWithDefaults:(NSUserDefaults *)defaults;+- (instancetype)visibleWhenKey:(NSString *)key equals:(NSInteger)value;+- (instancetype)visibleWhenKey:(NSString *)key isNotEqualTo:(NSInteger)value;+- (instancetype)visibleWhenKey:(NSString *)key isGreaterThan:(NSInteger)value;+- (instancetype)visibleWhenKey:(NSString *)key isGreaterThanOrEqualTo:(NSInteger)value;+- (instancetype)visibleWhenKey:(NSString *)key isLessThan:(NSInteger)value;+- (instancetype)visibleWhenKey:(NSString *)key isLessThanOrEqualTo:(NSInteger)value;+- (instancetype)visibleWhenKey:(NSString *)key inValues:(NSArray<NSNumber *> *)values;+- (instancetype)visibleWhenKey:(NSString *)key notInValues:(NSArray<NSNumber *> *)values;+- (instancetype)visibleWhenKeyDictionary:(NSDictionary<NSString *, NSNumber *> *)keyValues;+- (instancetype)visibleWhenBoolKey:(NSString *)key equals:(BOOL)value;+- (instancetype)visibleWhenBoolKey:(NSString *)key;+- (instancetype)visibleWhenBoolKeys:(NSArray<NSString *> *)keys;+- (instancetype)visibleWhenBoolKeys:(NSArray<NSString *> *)keys allEqualTo:(BOOL)value;+- (instancetype)visibleWhenAnyBoolKey:(NSArray<NSString *> *)keys;+- (instancetype)visibleWhenBoolDictionary:(NSDictionary<NSString *, NSNumber *> *)keyValues;+- (instancetype)visibleWhen:(BOOL (^)(NSUserDefaults *defaults))block;+- (instancetype)requireAnyCondition;+@end+extern void YMPushSubSettings(NSString *title, NSArray<YMSettingsItem *> *items, id settingsVC, id parentResponder);+extern YMSettingsItem *YMToggle(NSString *title, NSString *subtitle, NSString *key);+extern YMSettingsItem *YMSlider(NSString *title, NSString *subtitle, NSString *key, float min, float max, float step, float defaultValue);+extern YMSettingsItem *YMPicker(NSString *title, NSString *subtitle, NSString *key, NSArray<NSString *> *options, NSInteger defaultValue);+extern YMSettingsItem *YMAction(NSString *title, NSString *subtitle, void (^action)(UIViewController *vc));+extern YMSettingsItem *YMHeader(NSString *title);+extern YMSettingsItem *YMSegment(NSString *title, NSString *key, NSArray<NSNumber *> *icons, NSInteger defaultValue);+extern YMSettingsItem *YMTextSegment(NSString *title, NSString *key, NSArray<NSString *> *labels, NSInteger defaultValue);+extern YMSettingsItem *YMImageSegment(NSString *title, NSString *key, NSArray<UIImage *> *images, NSInteger defaultValue);+extern void YMPushTabOrder(id settingsVC, id parentResponder);+extern void YMPushOverlayButtonOrder(id settingsVC, id parentResponder);+extern void YMRegisterSettingsGroup(NSString *title, NSArray<YMSettingsItem *> *items);+extern void YMPushSettingsSearch(id settingsVC, id parentResponder);++@interface YTSettingsSectionItemManager (YouMod)+- (void)updateYouModSectionWithEntry:(id)entry;+- (void)updateSponsorBlockSectionWithEntry:(id)entry;+@end++static NSString *GetCacheSize() { // YTLite - @dayanch96+ NSString *cachePath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject;+ NSArray *filesArray = [[NSFileManager defaultManager] subpathsOfDirectoryAtPath:cachePath error:nil];+ unsigned long long int folderSize = 0;+ for (NSString *fileName in filesArray) {+ NSString *filePath = [cachePath stringByAppendingPathComponent:fileName];+ NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];+ folderSize += [fileAttributes fileSize];+ }+ NSByteCountFormatter *formatter = [[NSByteCountFormatter alloc] init];+ formatter.countStyle = NSByteCountFormatterCountStyleFile;+ return [formatter stringFromByteCount:folderSize];+}++%hook YTSettingsGroupData++- (NSArray <NSNumber *> *)orderedCategories {+ if (self.type != 1 || class_getClassMethod(objc_getClass("YTSettingsGroupData"), @selector(tweaks))) {+ return %orig;+ }+ NSArray *temp = %orig;+ NSMutableArray *mutableCategories = temp.mutableCopy;+ [mutableCategories insertObject:@(TweakSection) atIndex:0];+ return mutableCategories.copy;+}++%end++%hook YTAppSettingsPresentationData+++ (NSArray <NSNumber *> *)settingsCategoryOrder {+ NSArray <NSNumber *> *order = %orig;+ NSUInteger insertIndex = [order indexOfObject:@(1)];+ if (insertIndex != NSNotFound) {+ NSMutableArray <NSNumber *> *mutableOrder = [order mutableCopy];+ [mutableOrder insertObject:@(TweakSection) atIndex:insertIndex + 1];+ order = mutableOrder.copy;+ }+ return order;+}++%end++%hook YTSettingsSectionItemManager++%new(v@:@)+- (void)updateYouModSectionWithEntry:(id)entry {+ NSMutableArray <YTSettingsSectionItem *> *sectionItems = [NSMutableArray array];+ Class YTSettingsSectionItemClass = %c(YTSettingsSectionItem);+ YTSettingsViewController *settingsViewController = [self valueForKey:@"_settingsViewControllerDelegate"];++ // Tweak Version (at the top)+ // Thanks to the original codes from YTweaks by fosterbarnes - https://github.com/fosterbarnes/YTweaks/blob/e921591a89b87256a2b37c4788bd99282f70d9c2/Settings.x+ YTSettingsSectionItem *tweakVersion = [YTSettingsSectionItemClass itemWithTitle:@"YouMod v2.0.0"+ titleDescription:nil+ accessibilityIdentifier:nil+ detailTextBlock:nil+ selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ return NO;+ }];+ [sectionItems addObject:tweakVersion];++ // Section 0+ // Github+ YTSettingsSectionItem *github = [YTSettingsSectionItemClass itemWithTitle:nil+ titleDescription:@"Github"+ accessibilityIdentifier:nil+ detailTextBlock:nil+ selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ return NO;+ }];+ [sectionItems addObject:github];++ // Issues+ YTSettingsSectionItem *issues = [YTSettingsSectionItemClass itemWithTitle:YMLOC(@"NEW_ISSUES")+ titleDescription:YMLOC(@"NEW_ISSUES_DESC") // Found bug or Feature request -> Report Issues+ accessibilityIdentifier:nil+ detailTextBlock:nil+ selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ return [%c(YTUIUtils) openURL:[NSURL URLWithString:@"https://github.com/Tonwalter888/YouMod/issues/new/choose"]];+ }+ ];+ [sectionItems addObject:issues];++ // Sources codes+ YTSettingsSectionItem *sourceCodes = [YTSettingsSectionItemClass itemWithTitle:YMLOC(@"SOURCE_CODES")+ titleDescription:YMLOC(@"SOURCE_CODES_DESC") // Take a look+ accessibilityIdentifier:nil+ detailTextBlock:nil+ selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ return [%c(YTUIUtils) openURL:[NSURL URLWithString:@"https://github.com/Tonwalter888/YouMod"]];+ }+ ];+ [sectionItems addObject:sourceCodes];++ // ?+ YTSettingsSectionItem *blank = [YTSettingsSectionItemClass itemWithTitle:nil+ titleDescription:YMLOC(@"EXTRA")+ accessibilityIdentifier:nil+ detailTextBlock:nil+ selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ return NO;+ }];+ [sectionItems addObject:blank];++ // Fix playback issues+ YTSettingsSectionItem *fixPlaybackissues = [YTSettingsSectionItemClass switchItemWithTitle:YMLOC(@"FIX_PLAYBACK_ISSUES")+ titleDescription:YMLOC(@"FIX_PLAYBACK_ISSUES_DESC")+ accessibilityIdentifier:nil+ switchOn:IS_ENABLED(FixPlaybackIssues)+ switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {+ [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:FixPlaybackIssues];+ return YES;+ }+ settingItemId:0];+ [sectionItems addObject:fixPlaybackissues];++ // Settings+ YTSettingsSectionItem *settings = [YTSettingsSectionItemClass itemWithTitle:nil+ titleDescription:YMLOC(@"SETTINGS")+ accessibilityIdentifier:nil+ detailTextBlock:nil+ selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ return NO;+ }];+ [sectionItems addObject:settings];++ // Search — opens the global settings search page. The top-level list is YouTube's+ // native settings collection view, which we can't attach a live search bar to+ // without triggering YouTube's own search mode (it hijacks the pane), so global+ // search lives on a pushed page whose own search bar is focused on appear.+ // No settingIcon: YouTube already uses the magnifier (YT_SEARCH) for the Navbar+ // row, so an icon here would duplicate it. The row's title carries the meaning.+ YTSettingsSectionItem *search = [YTSettingsSectionItemClass itemWithTitle:YMLOC(@"SEARCH")+ titleDescription:YMLOC(@"SEARCH_DESC")+ accessibilityIdentifier:nil+ detailTextBlock:nil+ selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ YMPushSettingsSearch(settingsViewController, [self parentResponder]);+ return YES;+ }];+ [sectionItems addObject:search];++ // Section 1+ // Downloading+ NSArray<YMSettingsItem *> *downloadingItems = @[+ YMToggle(YMLOC(@"DOWNLOAD_MANAGER"), YMLOC(@"DOWNLOAD_MANAGER_DESC"), DownloadManager),+ YMToggle(YMLOC(@"ADD_SHORTS_DOWNLOAD"), YMLOC(@"ADD_SHORTS_DOWNLOAD_DESC"), AddDownloadToShorts),+ [YMTextSegment(YMLOC(@"POST_DOWNLOAD_ACTION"), PostDownloadAction, (@[YMLOC(@"POST_ACTION_SAVE_PHOTOS"), YMLOC(@"POST_ACTION_SHARE"), YMLOC(@"POST_ACTION_ASK")]), 0) visibleWhenAnyBoolKey:@[DownloadManager, AddDownloadToShorts, DownloadComment, DownloadPost]],+ [[YMTextSegment(YMLOC(@"AUDIO_TRACK"), AudioPreferIndex, (@[YMLOC(@"SHOW_OPTIONS"), YMLOC(@"ORIGINAL"), YMLOC(@"ENGLISH")]), 0) visibleWhenKey:DownloadMethod equals:0] visibleWhenAnyBoolKey:@[DownloadManager, AddDownloadToShorts]],+ [YMPicker(YMLOC(@"DOWNLOAD_METHOD"), YMLOC(@"DOWNLOAD_METHOD_DESC"), DownloadMethod, (@[YMLOC(@"METHOD_DIRECT"), YMLOC(@"METHOD_SERVER"), YMLOC(@"METHOD_ONDEVICE")]), 0) visibleWhenAnyBoolKey:@[DownloadManager, AddDownloadToShorts]],+ [[YMPicker(YMLOC(@"DOWNLOAD_SERVER"), YMLOC(@"CHOOSE_DOWNLOAD_SERVER"), DownloadServerIndex, (@[YMLOC(@"SERVER_EUROPRE1"), YMLOC(@"SERVER_ASIA1")]), 0) visibleWhenKey:DownloadMethod equals:1] visibleWhenAnyBoolKey:@[DownloadManager, AddDownloadToShorts]],+ YMToggle(YMLOC(@"DOWNLOAD_COMMENT"), YMLOC(@"DOWNLOAD_COMMENT_DESC"), DownloadComment),+ YMToggle(YMLOC(@"DOWNLOAD_POST"), YMLOC(@"DOWNLOAD_POST_DESC"), DownloadPost),+ ];+ YMRegisterSettingsGroup(YMLOC(@"DOWNLOADING"), downloadingItems);+ YTSettingsSectionItem *downloadinggroup = [YTSettingsSectionItemClass itemWithTitle:YMLOC(@"DOWNLOADING") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ YMPushSubSettings(YMLOC(@"DOWNLOADING"), downloadingItems, settingsViewController, [self parentResponder]);+ return YES;+ }];+ YTIIcon *downloadIcon = [%c(YTIIcon) new];+ downloadIcon.iconType = 57;+ downloadinggroup.settingIcon = downloadIcon;+ [sectionItems addObject:downloadinggroup];++ // Section 2+ // Appearance+ NSArray<YMSettingsItem *> *appearanceItems = @[+ YMToggle(YMLOC(@"OLED_THEME"), YMLOC(@"OLED_THEME_DESC"), OLEDTheme),+ YMToggle(YMLOC(@"OLED_KEYBOARD"), YMLOC(@"OLED_KEYBOARD_DESC"), OLEDKeyboard),+ ];+ YMRegisterSettingsGroup(YMLOC(@"APPEARANCE"), appearanceItems);+ YTSettingsSectionItem *appergroup = [YTSettingsSectionItemClass itemWithTitle:YMLOC(@"APPEARANCE") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ YMPushSubSettings(YMLOC(@"APPEARANCE"), appearanceItems, settingsViewController, [self parentResponder]);+ return YES;+ }];+ YTIIcon *icon0 = [%c(YTIIcon) new];+ icon0.iconType = 921;+ appergroup.settingIcon = icon0;+ [sectionItems addObject:appergroup];++ // Section 3+ // Navigation bar+ NSArray<YMSettingsItem *> *navbarItems = @[+ YMToggle(YMLOC(@"STICKY_NAVBAR"), YMLOC(@"STICKY_NAVBAR_DESC"), StickyNavBar),+ YMToggle(YMLOC(@"HIDE_NOTIFICATION_BUTTON"), YMLOC(@"HIDE_NOTIFICATION_BUTTON_DESC"), HideNoti),+ YMToggle(YMLOC(@"HIDE_SEARCH_BUTTON"), YMLOC(@"HIDE_SEARCH_BUTTON_DESC"), HideSearch),+ YMToggle(YMLOC(@"HIDE_VOICE_SEARCH_BUTTON"), YMLOC(@"HIDE_VOICE_SEARCH_BUTTON_DESC"), HideVoiceSearch),+ YMToggle(YMLOC(@"HIDE_CAST_BUTTON_NAVBAR"), YMLOC(@"HIDE_CAST_BUTTON_NAVBAR_DESC"), HideCastButtonNav),+ YMPicker(YMLOC(@"NAVIGATION_ICON"), YMLOC(@"NAVIGATION_ICON_DESC"), YTLogoIndex, (@[YMLOC(@"DEFAULT"), YMLOC(@"PREMIUM"), YMLOC(@"YOUTUBE"), YMLOC(@"REMOVE_YTLOGO")]), 0),+ ];+ YMRegisterSettingsGroup(YMLOC(@"NAVBAR"), navbarItems);+ YTSettingsSectionItem *navbargroup = [YTSettingsSectionItemClass itemWithTitle:YMLOC(@"NAVBAR") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ YMPushSubSettings(YMLOC(@"NAVBAR"), navbarItems, settingsViewController, [self parentResponder]);+ return YES;+ }];+ YTIIcon *icon1 = [%c(YTIIcon) new];+ icon1.iconType = 60;+ navbargroup.settingIcon = icon1;+ [sectionItems addObject:navbargroup];++ // Section 4+ // Feed+ NSArray<YMSettingsItem *> *feedItems = @[+ YMToggle(YMLOC(@"HIDE_SUBBAR"), YMLOC(@"HIDE_SUBBAR_DESC"), HideSubbar),+ YMToggle(YMLOC(@"HIDE_HORI_SHELF"), YMLOC(@"HIDE_HORI_SHELF_DESC"), HideHoriShelf),+ YMToggle(YMLOC(@"HIDE_MUSIC_PLAYLISTS"), YMLOC(@"HIDE_MUSIC_PLAYLISTS_DESC"), HideGenMusicShelf),+ YMToggle(YMLOC(@"HIDE_SURVEYS"), YMLOC(@"HIDE_SURVEYS_DESC"), HideSurveys),+ YMToggle(YMLOC(@"HIDE_FEED_POST"), YMLOC(@"HIDE_FEED_POST_DESC"), HideFeedPost),+ YMToggle(YMLOC(@"HIDE_PLAYABLES"), YMLOC(@"HIDE_PLAYABLES_DESC"), HidePlayables),+ YMToggle(YMLOC(@"HIDE_SHORTS_SHELF"), YMLOC(@"HIDE_SHORTS_SHELF_DESC"), HideShortsShelf),+ YMToggle(YMLOC(@"KEEP_SHORTS_SUBSCRIPT"), YMLOC(@"KEEP_SHORTS_SUBSCRIPT_DESC"), KeepShortsSubscript),+ YMToggle(YMLOC(@"HIDE_SEARCH_HISTORY"), YMLOC(@"HIDE_SEARCH_HISTORY_DESC"), HideSearchHis),+ YMToggle(YMLOC(@"REMOVE_CHANNEL_COMMUNITY_BUTTON"), YMLOC(@"REMOVE_CHANNEL_COMMUNITY_BUTTON_DESC"), RemoveChannelCommunityButton),+ YMToggle(YMLOC(@"REMOVE_CHANNEL_SPONSOR_BUTTON"), YMLOC(@"REMOVE_CHANNEL_SPONSOR_BUTTON_DESC"), RemoveChannelSponsorAll),+ ];+ YMRegisterSettingsGroup(YMLOC(@"FEED"), feedItems);+ YTSettingsSectionItem *feedgroup = [YTSettingsSectionItemClass itemWithTitle:YMLOC(@"FEED") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ YMPushSubSettings(YMLOC(@"FEED"), feedItems, settingsViewController, [self parentResponder]);+ return YES;+ }];+ YTIIcon *icon2 = [%c(YTIIcon) new];+ icon2.iconType = 193;+ feedgroup.settingIcon = icon2;+ [sectionItems addObject:feedgroup];++ // Section 5+ // Player+ NSArray<YMSettingsItem *> *playerItems = @[+ YMPicker(YMLOC(@"QUALITY_WIFI"), YMLOC(@"QUALITY_WIFI_DESC"), WifiQualityIndex, (@[YMLOC(@"DEFAULT"), YMLOC(@"BEST"), @"2160p", @"1440p", @"1080p", @"720p", @"480p", @"360p", @"240p", @"144p"]), 0),+ YMPicker(YMLOC(@"QUALITY_CELLULAR"), YMLOC(@"QUALITY_CELLULAR_DESC"), CellQualityIndex, (@[YMLOC(@"DEFAULT"), YMLOC(@"BEST"), @"2160p", @"1440p", @"1080p", @"720p", @"480p", @"360p", @"240p", @"144p"]), 0),+ YMPicker(YMLOC(@"QUALITY_LOW_POWER"), YMLOC(@"QUALITY_LOW_POWER_DESC"), LowPowerQualityIndex, (@[YMLOC(@"DEFAULT"), YMLOC(@"BEST"), @"2160p", @"1440p", @"1080p", @"720p", @"480p", @"360p", @"240p", @"144p"]), 0),+ YMTextSegment(YMLOC(@"AUDIO_TRACK"), AudioTrack, (@[YMLOC(@"DEFAULT"), YMLOC(@"ORIGINAL"), YMLOC(@"SELECT_MANUALLY")]), 0),+ [YMPicker(YMLOC(@"AUDIO_TRACK_SELECT"), YMLOC(@"AUDIO_TRACK_SELECT_DESC"), AudioTrackLangIndex, getAllSystemLanguageTitles(), 0) visibleWhenKey:AudioTrack equals:2],+ [YMToggle(YMLOC(@"NO_AUTO_DUBBED"), YMLOC(@"NO_AUTO_DUBBED_DESC"), NoDubbedAudioTrack) visibleWhenKey:AudioTrack equals:2],+ YMTextSegment(YMLOC(@"CAPTION_TRACK"), CaptionTrack, (@[YMLOC(@"DEFAULT"), YMLOC(@"DISABLED"), YMLOC(@"SELECT_MANUALLY")]), 0),+ [YMPicker(YMLOC(@"CAPTION_TRACK_SELECT"), YMLOC(@"CAPTION_TRACK_SELECT_DESC"), CaptionTrackLangIndex, getAllSystemLanguageTitles(), 0) visibleWhenKey:CaptionTrack equals:2],+ [YMToggle(YMLOC(@"DISABLES_CAPTION_TRACK"), YMLOC(@"DISABLES_CAPTION_TRACK_DESC"), DisablesCaptionTrack) visibleWhenKey:CaptionTrack equals:2],+ YMHeader(@""),+ YMPicker(YMLOC(@"HOLD_TO_SPEED"), YMLOC(@"HOLD_TO_SPEED_DESC"), HoldToSpeedIndex, (@[YMLOC(@"DEFAULT"), @"0.25x", @"0.5x", @"0.75x", @"1x", @"1.25x", @"1.5x", @"1.75x", @"2x", @"3x", @"4x", @"5x"]), 0),+ [YMToggle(YMLOC(@"LOCK_SPEED"), YMLOC(@"LOCK_SPEED_DESC"), LockSpeed) visibleWhenKey:HoldToSpeedIndex isGreaterThan:0],+ YMHeader(YMLOC(@"INTERFACE")),+ YMAction(YMLOC(@"MANAGE_OVERLAY_BUTTONS"), YMLOC(@"MANAGE_OVERLAY_BUTTONS_DESC"), ^(UIViewController *vc) {+ (void)vc;+ YMPushOverlayButtonOrder(settingsViewController, [self parentResponder]);+ }),+ YMToggle(YMLOC(@"HIDE_AUTOPLAY"), YMLOC(@"HIDE_AUTOPLAY_DESC"), HideAutoPlayToggle),+ YMToggle(YMLOC(@"HIDE_FULL_VID_TITLE"), YMLOC(@"HIDE_FULL_VID_TITLE_DESC"), HideFullvidTitle),+ YMToggle(YMLOC(@"HIDE_CAPTIONS_BUTTON"), YMLOC(@"HIDE_CAPTIONS_BUTTON_DESC"), HideCaptionsButton),+ YMToggle(YMLOC(@"HIDE_CAST_BUTTON_PLAYER"), YMLOC(@"HIDE_CAST_BUTTON_PLAYER_DESC"), HideCastButtonPlayer),+ YMToggle(YMLOC(@"HIDE_NEXT_AND_PREV_BUTTON"), YMLOC(@"HIDE_NEXT_AND_PREV_BUTTON_DESC"), HideNextAndPrevButtons),+ [YMToggle(YMLOC(@"REPLACE_PREVNEXT_BUTTONS"), YMLOC(@"REPLACE_PREVNEXT_BUTTONS_DESC"), ReplacePrevNextButtons) visibleWhenBoolKey:HideNextAndPrevButtons equals:NO],+ YMToggle(YMLOC(@"REMOVE_AMBIANT"), YMLOC(@"REMOVE_AMBIANT_DESC"), RemoveAmbiant),+ YMToggle(YMLOC(@"REMOVE_DARK_OVERLAY"), YMLOC(@"REMOVE_DARK_OVERLAY_DESC"), RemoveDarkOverlay),+ YMToggle(YMLOC(@"HIDE_END_SCREEN"), YMLOC(@"HIDE_END_SCREEN_DESC"), HideEndScreenCards),+ YMToggle(YMLOC(@"HIDE_SUGGESTED_VIDEO"), YMLOC(@"HIDE_SUGGESTED_VIDEO_DESC"), HideSuggestedVideo),+ YMToggle(YMLOC(@"HIDE_PAID_OVERLAY"), YMLOC(@"HIDE_PAID_OVERLAY_DESC"), HidePaidPromoOverlay),+ YMToggle(YMLOC(@"HIDE_WATERMARK"), YMLOC(@"HIDE_WATERMARK_DESC"), HideWaterMark),+ YMToggle(YMLOC(@"HIDE_FULLSCREEN_ACTIONS"), YMLOC(@"HIDE_FULLSCREEN_ACTIONS_DESC"), HideFullAction),+ YMToggle(YMLOC(@"FORCE_SEEKBAR"), YMLOC(@"FORCE_SEEKBAR_DESC"), AlwaysShowSeekbar),+ YMToggle(YMLOC(@"DISABLES_SHOW_REMAINING"), YMLOC(@"DISABLES_SHOW_REMAINING_DESC"), DisablesShowRemaining),+ YMToggle(YMLOC(@"ALWAYS_SHOW_REMAINING"), YMLOC(@"ALWAYS_SHOW_REMAINING_DESC"), AlwaysShowRemaining),+ YMToggle(YMLOC(@"SHOW_REMAINING_EXTRA"), YMLOC(@"SHOW_REMAINING_EXTRA_DESC"), ShowExtraTimeRemaining),+ [YMToggle(YMLOC(@"USES_24_HOURS_TIME"), YMLOC(@"USES_24_HOURS_TIME_DESC"), Uses24HoursTime) visibleWhenBoolKey:ShowExtraTimeRemaining],+ YMToggle(YMLOC(@"OLD_QUALITY_PICKER"), YMLOC(@"OLD_QUALITY_PICKER_DESC"), OldQualityPicker),+ YMToggle(YMLOC(@"EXTRA_SPEED"), YMLOC(@"EXTRA_SPEED_DESC"), ExtraSpeed),+ YMToggle(YMLOC(@"PORTRAIT_FULLSCREEN"), YMLOC(@"PORTRAIT_FULLSCREEN_DESC"), PortFull),+ YMToggle(YMLOC(@"HIDE_RELATED_VIDEOS"), YMLOC(@"HIDE_RELATED_VIDEOS_DESC"), HideRelatedVideos),+ YMToggle(YMLOC(@"HIDE_COMMENTS_SECTION"), YMLOC(@"HIDE_COMMENTS_SECTION_DESC"), HideCommentsSection),+ YMToggle(YMLOC(@"HIDE_COMMENTS_PREVIEW"), YMLOC(@"HIDE_COMMENTS_PREVIEW_DESC"), HideCommentsPreview),+ YMPicker(YMLOC(@"DRC_AUDIO_OPTIONS"), YMLOC(@"DRC_AUDIO_OPTIONS_DESC"), AutoDRCAudioIndex, (@[YMLOC(@"DEFAULT"), YMLOC(@"ENABLED"), YMLOC(@"DISABLED")]), 0),+ YMToggle(YMLOC(@"REMOVE_VIDEO_LIKE_BUTTON"), YMLOC(@"REMOVE_VIDEO_LIKE_BUTTON_DESC"), RemoveVideoLikeButton),+ YMToggle(YMLOC(@"REMOVE_VIDEO_DISLIKE_BUTTON"), YMLOC(@"REMOVE_VIDEO_DISLIKE_BUTTON_DESC"), RemoveVideoDislikeButton),+ YMToggle(YMLOC(@"REMOVE_VIDEO_SHARE_BUTTON"), YMLOC(@"REMOVE_VIDEO_SHARE_BUTTON_DESC"), RemoveVideoShareButton),+ YMToggle(YMLOC(@"REMOVE_VIDEO_SAVE_BUTTON"), YMLOC(@"REMOVE_VIDEO_SAVE_BUTTON_DESC"), RemoveVideoSaveButton),+ YMToggle(YMLOC(@"REMOVE_VIDEO_DOWNLOAD_BUTTON"), YMLOC(@"REMOVE_VIDEO_DOWNLOAD_BUTTON_DESC"), RemoveVideoDownloadButton),+ YMToggle(YMLOC(@"REMOVE_VIDEO_CLIP_BUTTON"), YMLOC(@"REMOVE_VIDEO_CLIP_BUTTON_DESC"), RemoveVideoClipButton),+ YMToggle(YMLOC(@"REMOVE_VIDEO_REMIX_BUTTON"), YMLOC(@"REMOVE_VIDEO_REMIX_BUTTON_DESC"), RemoveVideoRemixButton),+ YMToggle(YMLOC(@"REMOVE_VIDEO_LIVE_CHAT_BUTTON"), YMLOC(@"REMOVE_VIDEO_LIVE_CHAT_BUTTON_DESC"), RemoveVideoLiveChatButton),+ YMHeader(YMLOC(@"CONTROL_CENTER")),+ YMToggle(YMLOC(@"SKIP_BACKWARD"), YMLOC(@"SKIP_BACKWARD_DESC"), SkipBackwardEnabled),+ [YMSlider(YMLOC(@"REWIND_SECONDS"), nil, RewindSeconds, 5, 60, 5, 10) visibleWhenBoolKey:SkipBackwardEnabled],+ YMToggle(YMLOC(@"SKIP_FORWARD"), YMLOC(@"SKIP_FORWARD_DESC"), SkipForwardEnabled),+ [YMSlider(YMLOC(@"FORWARD_SECONDS"), nil, ForwardSeconds, 5, 60, 5, 10) visibleWhenBoolKey:SkipForwardEnabled],+ YMHeader(YMLOC(@"PLAYER_ACTIONS")),+ YMPicker(YMLOC(@"DEFAULT_SPEED"), YMLOC(@"DEFAULT_SPEED_DESC"), AutoSpeedIndex, (@[YMLOC(@"DISABLED"), @"0.25x", @"0.5x", @"0.75x", @"1x", @"1.25x", @"1.5x", @"1.75x", @"2x", @"3x", @"4x", @"5x"]), 0),+ YMToggle(YMLOC(@"FORCE_MINIPLAYER"), YMLOC(@"FORCE_MINIPLAYER_DESC"), ForceMiniPlayer),+ YMToggle(YMLOC(@"HIDE_CONTENT_WARNING"), YMLOC(@"HIDE_CONTENT_WARNING_DESC"), HideContentWarning),+ YMToggle(YMLOC(@"STOP_AUTOPLAY_VIDEO"), YMLOC(@"STOP_AUTOPLAY_VIDEO_DESC"), StopAutoplayVideo),+ YMToggle(YMLOC(@"AUTO_FULLSCREEN"), YMLOC(@"AUTO_FULLSCREEN_DESC"), AutoFullScreen),+ YMToggle(YMLOC(@"AUTO_EXIT_FULLSCREEN"), YMLOC(@"AUTO_EXIT_FULLSCREEN_DESC"), AutoExitFullScreen),+ YMToggle(YMLOC(@"AUTO_FEED_MUTE"), YMLOC(@"AUTO_FEED_MUTE_DESC"), AutoFeedMute),+ YMHeader(YMLOC(@"GESTURE_HEADER")),+ YMToggle(YMLOC(@"GESTURES"), YMLOC(@"GESTURES_DESC"), GestureControls),+ [YMPicker(YMLOC(@"GESTURE_AREA"), YMLOC(@"GESTURE_AREA_DESC"), GestureActivationArea, (@[@"10%", @"15%", @"20%", @"25%", @"30%", @"35%", @"40%", @"45%", @"50%"]), 1) visibleWhenBoolKey:GestureControls],+ [YMPicker(YMLOC(@"LEFT_SIDE_GESTURE"), nil, LeftSideGesture, (@[YMLOC(@"GESTURE_NONE"), YMLOC(@"GESTURE_BRIGHTNESS"), YMLOC(@"GESTURE_VOLUME"), YMLOC(@"GESTURE_SPEED")]), 1) visibleWhenBoolKey:GestureControls],+ [YMPicker(YMLOC(@"RIGHT_SIDE_GESTURE"), nil, RightSideGesture, (@[YMLOC(@"GESTURE_NONE"), YMLOC(@"GESTURE_BRIGHTNESS"), YMLOC(@"GESTURE_VOLUME"), YMLOC(@"GESTURE_SPEED")]), 2) visibleWhenBoolKey:GestureControls],+ [YMToggle(YMLOC(@"GESTURE_HUD"), YMLOC(@"GESTURE_HUD_DESC"), GestureHUD) visibleWhenBoolKey:GestureControls],+ [[YMPicker(YMLOC(@"GESTURE_HUD_SIZE"), YMLOC(@"GESTURE_HUD_SIZE_DESC"), GestureHUDSize, (@[YMLOC(@"SMALL"), YMLOC(@"NORMAL"), YMLOC(@"LARGE"), YMLOC(@"EXTRALARGE"), YMLOC(@"MAX")]), 1) visibleWhenBoolKey:GestureControls] visibleWhenBoolKey:GestureHUD],+ [[YMPicker(YMLOC(@"GESTURE_HUD_POSITION"), YMLOC(@"GESTURE_HUD_POSITION_DESC"), GestureHUDPosition, (@[YMLOC(@"TOP"), YMLOC(@"MIDDLE"), YMLOC(@"BOTTOM")]), 0) visibleWhenBoolKey:GestureControls] visibleWhenBoolKey:GestureHUD],+ YMHeader(@""),+ YMToggle(YMLOC(@"TAP_TO_SEEK"), YMLOC(@"TAP_TO_SEEK_DESC"), TapToSeek),+ YMToggle(YMLOC(@"SEEK_ON_OVERLAY"), YMLOC(@"SEEK_ON_OVERLAY_DESC"), SeekOnOverlay),+ YMToggle(YMLOC(@"PAUSE_TWO_FINGERS"), YMLOC(@"PAUSE_TWO_FINGERS_DESC"), PauseTwoFingers),+ YMToggle(YMLOC(@"PAUSE_ON_OVERLAY"), YMLOC(@"PAUSE_ON_OVERLAY_DESC"), PauseOnOverlay),+ YMToggle(YMLOC(@"COPY_TIMESTAMP_ON_PAUSE"), YMLOC(@"COPY_TIMESTAMP_ON_PAUSE_DESC"), CopyWithTimestampOnPause),+ YMToggle(YMLOC(@"DISABLES_DOUBLE_TAP"), YMLOC(@"DISABLES_DOUBLE_TAP_DESC"), DisablesDoubleTap),+ YMToggle(YMLOC(@"DISABLES_LONG_HOLD"), YMLOC(@"DISABLES_LONG_HOLD_DESC"), DisablesLongHold),+ YMToggle(YMLOC(@"DISABLES_ZOOM"), YMLOC(@"DISABLES_ZOOM_DESC"), DisablesFreeZoom),+ YMToggle(YMLOC(@"DISABLES_SNAP_TO_CHAPTER"), YMLOC(@"DISABLES_SNAP_TO_CHAPTER_DESC"), DontSnapToChapter),+ YMToggle(YMLOC(@"DISABLES_ENGAGE_PANEL"), YMLOC(@"DISABLES_ENGAGE_PANEL_DESC"), DisablesEngagementPanel),+ ];+ YMRegisterSettingsGroup(YMLOC(@"PLAYER"), playerItems);+ YTSettingsSectionItem *playergroup = [YTSettingsSectionItemClass itemWithTitle:YMLOC(@"PLAYER") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ YMPushSubSettings(YMLOC(@"PLAYER"), playerItems, settingsViewController, [self parentResponder]);+ return YES;+ }];+ YTIIcon *icon3 = [%c(YTIIcon) new];+ icon3.iconType = 658;+ playergroup.settingIcon = icon3;+ [sectionItems addObject:playergroup];++ // Section 6+ // Shorts+ NSArray<YMSettingsItem *> *shortsItems = @[+ YMTextSegment(YMLOC(@"SHORTS_ACTION"), ShortsActionIndex, (@[YMLOC(@"LOOP"), YMLOC(@"SKIP_TO_NEXT_SHORTS"), YMLOC(@"PAUSE_SHORTS")]), 0),+ YMToggle(YMLOC(@"ENABLES_SHORTS_QUALITY"), YMLOC(@"ENABLES_SHORTS_QUALITY_DESC"), EnablesShortsQuality),+ YMToggle(YMLOC(@"SHOW_SHORTS_SEEKBAR"), YMLOC(@"SHOW_SHORTS_SEEKBAR_DESC"), ShowShortsSeekbar),+ YMToggle(YMLOC(@"SHORTS_ONLY"), YMLOC(@"SHORTS_ONLY_DESC"), ShortsOnly),+ YMToggle(YMLOC(@"SHORTS_FULLSCREEN"), YMLOC(@"SHORTS_FULLSCREEN_DESC"), FullScreenShorts),+ YMToggle(YMLOC(@"REMOVE_LIVE_SHORTS"), YMLOC(@"REMOVE_LIVE_SHORTS_DESC"), RemoveShortsLive),+ YMToggle(YMLOC(@"REMOVE_POSTS_SHORTS"), YMLOC(@"REMOVE_POSTS_SHORTS_DESC"), RemoveShortsPosts),+ YMHeader(YMLOC(@"INTERFACE")),+ YMToggle(YMLOC(@"HIDE_SHORTS_TOPBAR"), YMLOC(@"HIDE_SHORTS_TOPBAR_DESC"), HideShortsTopbar),+ YMToggle(YMLOC(@"HIDE_SHORTS_SUBBAR"), YMLOC(@"HIDE_SHORTS_SUBBAR_DESC"), HideShortsSubbar),+ YMToggle(YMLOC(@"HIDE_SHORTS_PRODUCT"), YMLOC(@"HIDE_SHORTS_PRODUCT_DESC"), HideShortsProducts),+ YMToggle(YMLOC(@"HIDE_SHORTS_RECBAR"), YMLOC(@"HIDE_SHORTS_RECBAR_DESC"), HideShortsRecbar),+ YMToggle(YMLOC(@"HIDE_SHORTS_DISCLOSURE"), YMLOC(@"HIDE_SHORTS_DISCLOSURE_DESC"), RemoveShortsDisclosure),+ YMToggle(YMLOC(@"REMOVE_SHORTS_LIKE_BUTTON"), YMLOC(@"REMOVE_SHORTS_LIKE_BUTTON_DESC"), RemoveShortsLikeButton),+ YMToggle(YMLOC(@"REMOVE_SHORTS_COMMENT_BUTTON"), YMLOC(@"REMOVE_SHORTS_COMMENT_BUTTON_DESC"), RemoveShortsCommentButton),+ YMToggle(YMLOC(@"REMOVE_SHORTS_SHARE_BUTTON"), YMLOC(@"REMOVE_SHORTS_SHARE_BUTTON_DESC"), RemoveShortsShareButton),+ YMToggle(YMLOC(@"REMOVE_SHORTS_REMIX_BUTTON"), YMLOC(@"REMOVE_SHORTS_REMIX_BUTTON_DESC"), RemoveShortsRemixButton),+ YMToggle(YMLOC(@"REMOVE_SHORTS_SOUNDMETADATA_BUTTON"), YMLOC(@"REMOVE_SHORTS_SOUNDMETADATA_BUTTON_DESC"), RemoveShortsSoundMetadataButton),+ YMToggle(YMLOC(@"REMOVE_SHORTS_PAUSED_SUB_BUTTON"), YMLOC(@"REMOVE_SHORTS_PAUSED_SUB_BUTTON_DESC"), RemoveShortsPausedSubButton),+ YMToggle(YMLOC(@"REMOVE_SHORTS_PAUSED_LIVE_BUTTON"), YMLOC(@"REMOVE_SHORTS_PAUSED_LIVE_BUTTON_DESC"), RemoveShortsPausedLiveButton),+ YMToggle(YMLOC(@"REMOVE_SHORTS_PAUSED_LENS_BUTTON"), YMLOC(@"REMOVE_SHORTS_PAUSED_LENS_BUTTON_DESC"), RemoveShortsPausedLensButton),+ YMToggle(YMLOC(@"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON"), YMLOC(@"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON_DESC"), RemoveShortsPausedTrendsButton),+ ];+ YMRegisterSettingsGroup(YMLOC(@"SHORTS"), shortsItems);+ YTSettingsSectionItem *shortsgroup = [YTSettingsSectionItemClass itemWithTitle:YMLOC(@"SHORTS") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ YMPushSubSettings(YMLOC(@"SHORTS"), shortsItems, settingsViewController, [self parentResponder]);+ return YES;+ }];+ YTIIcon *icon4 = [%c(YTIIcon) new];+ icon4.iconType = 769;+ shortsgroup.settingIcon = icon4;+ [sectionItems addObject:shortsgroup];++ // Section 7+ // Tab bar+ YTSettingsSectionItem *tabgroup = [YTSettingsSectionItemClass itemWithTitle:YMLOC(@"TABBAR") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ // Build dynamic image list from enabled tabs (standard + custom)+ NSDictionary *tabYTIconMap = @{@"home": @(65), @"shorts": @(769), @"subscriptions": @(66), @"library": @(61)};+ NSDictionary *tabBundleIconMap = @{@"history": @"icons/history", @"gaming": @"icons/gaming", @"sports": @"icons/sports", @"notifications": @"icons/noti", @"news": @"icons/news", @"music": @"icons/music", @"watchlater": @"icons/watchlater", @"playlist": @"icons/playlist", @"like": @"icons/like", @"live": @"icons/live", @"post": @"icons/post", @"video": @"icons/video", @"movie": @"icons/movie", @"course": @"icons/course", @"minigame": @"icons/minigame", @"fashion": @"icons/fashion", @"learning": @"icons/learning"};+ YTAssetLoader *assetLoader = [[%c(YTAssetLoader) alloc] initWithBundle:YouModBundle()];++ NSMutableArray<UIImage *> *defaultTabImages = [NSMutableArray array];+ NSArray *savedOrder = [[NSUserDefaults standardUserDefaults] arrayForKey:TabOrder];+ if (savedOrder.count > 0) {+ for (NSDictionary *entry in savedOrder) {+ if (![entry[@"enabled"] boolValue]) continue;+ NSString *tabID = entry[@"id"];+ if ([tabID isEqualToString:@"create"]) continue;+ NSNumber *ytIconType = tabYTIconMap[tabID];+ if (ytIconType) {+ UIImage *img = YouModYTIconImage([ytIconType intValue], YES, [UIColor whiteColor]);+ if (img) [defaultTabImages addObject:img];+ } else {+ NSString *bundleName = tabBundleIconMap[tabID];+ if (bundleName) {+ UIImage *img = [assetLoader imageNamed:bundleName];+ if (img) {+ UIImage *whiteImg = [img imageWithTintColor:[UIColor whiteColor] renderingMode:UIImageRenderingModeAlwaysOriginal];+ [defaultTabImages addObject:whiteImg];+ }+ }+ }+ }+ }+ if (defaultTabImages.count == 0) {+ NSArray *fallbackIcons = @[@(65), @(769), @(66), @(61)];+ for (NSNumber *iconType in fallbackIcons) {+ UIImage *img = YouModYTIconImage([iconType intValue], YES, [UIColor whiteColor]);+ if (img) [defaultTabImages addObject:img];+ }+ }++ YMPushSubSettings(YMLOC(@"TABBAR"), @[+ YMImageSegment(YMLOC(@"DEFAULT_TAB"), DefaultTab, defaultTabImages, 0),+ YMTextSegment(YMLOC(@"FORSTED_TAB_BAR"), UseFrostedTabBar, (@[YMLOC(@"DEFAULT"),YMLOC(@"ENABLED"), YMLOC(@"DISABLED")]), 0),+ YMToggle(YMLOC(@"HIDE_TAB_INDI"), YMLOC(@"HIDE_TAB_INDI_DESC"), HideTabIndi),+ YMToggle(YMLOC(@"HIDE_TAB_LABELS"), YMLOC(@"HIDE_TAB_LABELS_DESC"), HideTabLabels),+ YMAction(YMLOC(@"MANAGE_TABS"), YMLOC(@"MANAGE_TABS_DESC"), ^(UIViewController *vc) {+ (void)vc;+ YMPushTabOrder(settingsViewController, [self parentResponder]);+ }),+ ], settingsViewController, [self parentResponder]);+ return YES;+ }];+ YTIIcon *icon5 = [%c(YTIIcon) new];+ icon5.iconType = 66;+ tabgroup.settingIcon = icon5;+ [sectionItems addObject:tabgroup];++ // Section 8+ // Miscellaneous+ NSArray<YMSettingsItem *> *miscItems = @[+ YMToggle(YMLOC(@"BACKGROUND_PLAYBACK"), YMLOC(@"BACKGROUND_PLAYBACK_DESC"), BackgroundPlayback),+ YMToggle(YMLOC(@"DISABLES_SHORTS_PIP"), YMLOC(@"DISABLES_SHORTS_PIP_DESC"), DisablesShortsPiP),+ YMToggle(YMLOC(@"DISABLE_HINTS"), YMLOC(@"DISABLE_HINTS_DESC"), DisableHints),+ YMToggle(YMLOC(@"BLOCK_UPGRADE_DIALOGS"), YMLOC(@"BLOCK_UPGRADE_DIALOGS_DESC"), BlockUpgradeDialogs),+ YMToggle(YMLOC(@"ARE_YOU_THERE_DIALOG"), YMLOC(@"ARE_YOU_THERE_DIALOG_DESC"), HideAreYouThereDialog),+ YMToggle(YMLOC(@"FIXES_SLOW_MINIPLAYER"), YMLOC(@"FIXES_SLOW_MINIPLAYER_DESC"), FixesSlowMiniPlayer),+ YMToggle(YMLOC(@"DISABLES_NEW_MINIPLAYER"), YMLOC(@"DISABLES_NEW_MINIPLAYER_DESC"), DisablesNewMiniPlayer),+ YMToggle(YMLOC(@"DISABLES_SNACK_BAR"), YMLOC(@"DISABLES_SNACK_BAR_DESC"), DisablesSnackBar),+ YMToggle(YMLOC(@"HIDE_STARTUP_ANIMATIONS"), YMLOC(@"HIDE_STARTUP_ANIMATIONS_DESC"), HideStartupAni),+ YMToggle(YMLOC(@"HIDE_LIKE_DISLIKE_VOTES"), YMLOC(@"HIDE_LIKE_DISLIKE_VOTES_DESC"), HideLikeDislikeVotes),+ YMToggle(YMLOC(@"HIDE_COMMU_GUIDE"), YMLOC(@"HIDE_COMMU_GUIDE_DESC"), HideCommuGuide),+ YMToggle(YMLOC(@"HIDE_ENGAGEMENT_SUBBAR"), YMLOC(@"HIDE_ENGAGEMENT_SUBBAR_DESC"), HideEngagementSubbar),+ YMToggle(YMLOC(@"FLOATING_KEYBOARD"), YMLOC(@"FLOATING_KEYBOARD_DESC"), FloatingKeyboard),+ YMToggle(YMLOC(@"DISABLES_RTL"), YMLOC(@"DISABLES_RTL_DESC"), DisablesRTL),+ YMHeader(@""),+ YMTextSegment(YMLOC(@"DEVICE_UI"), DeviceUIIndex, (@[YMLOC(@"DEFAULT"), @"iPad", @"iPhone"]), 0),+ YMToggle(YMLOC(@"AUTO_OPEN_LINK"), YMLOC(@"AUTO_OPEN_LINK_DESC"), AutoOpenLink),+ YMHeader(YMLOC(@"FLYOUT_MENU")),+ YMToggle(YMLOC(@"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION"), YMLOC(@"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION_DESC"), RemovePlayInNextQueueOption),+ YMToggle(YMLOC(@"REMOVE_PLAY_IN_LAST_QUEUE_OPTION"), YMLOC(@"REMOVE_PLAY_IN_LAST_QUEUE_OPTION_DESC"), RemoveAddToLastQueueOption),+ YMToggle(YMLOC(@"REMOVE_DOWNLOAD_OPTION"), YMLOC(@"REMOVE_DOWNLOAD_OPTION_DESC"), RemoveDownloadOption),+ YMToggle(YMLOC(@"REMOVE_WATCH_LATER_OPTION"), YMLOC(@"REMOVE_WATCH_LATER_OPTION_DESC"), RemoveWatchLaterOption),+ YMToggle(YMLOC(@"REMOVE_SAVE_OPTION"), YMLOC(@"REMOVE_SAVE_OPTION_DESC"), RemoveSaveOption),+ YMToggle(YMLOC(@"REMOVE_REMOVE_FROM_PLAYLIST_OPTION"), YMLOC(@"REMOVE_REMOVE_FROM_PLAYLIST_OPTION_DESC"), RemoveRemoveFromPlaylistOption),+ YMToggle(YMLOC(@"REMOVE_SHARE_OPTION"), YMLOC(@"REMOVE_SHARE_OPTION_DESC"), RemoveShareOption),+ YMToggle(YMLOC(@"REMOVE_NOT_INTERESTED_OPTION"), YMLOC(@"REMOVE_NOT_INTERESTED_OPTION_DESC"), RemoveNotInterestedOption),+ YMToggle(YMLOC(@"REMOVE_DONT_RECOMMEND_OPTION"), YMLOC(@"REMOVE_DONT_RECOMMEND_OPTION_DESC"), RemoveDontRecommendOption),+ YMToggle(YMLOC(@"REMOVE_INFO_OPTION"), YMLOC(@"REMOVE_INFO_OPTION_DESC"), RemoveInfoOption),+ YMToggle(YMLOC(@"REMOVE_FILTER_OPTION"), YMLOC(@"REMOVE_FILTER_OPTION_DESC"), RemoveFilterOption),+ YMToggle(YMLOC(@"REMOVE_REPORT_OPTION"), YMLOC(@"REMOVE_REPORT_OPTION_DESC"), RemoveReportOption),+ YMToggle(YMLOC(@"REMOVE_YOUTUBE_MUSIC_OPTION"), YMLOC(@"REMOVE_YOUTUBE_MUSIC_OPTION_DESC"), RemoveYouTubeMusicOption),+ YMToggle(YMLOC(@"REMOVE_FEED_BACK_OPTION"), YMLOC(@"REMOVE_FEED_BACK_OPTION_DESC"), RemoveFeedBackOption),+ YMToggle(YMLOC(@"REMOVE_CAST_OPTION"), YMLOC(@"REMOVE_CAST_OPTION_DESC"), RemoveCastOption),+ YMToggle(YMLOC(@"REMOVE_SHUFFLE_OPTION"), YMLOC(@"REMOVE_SHUFFLE_OPTION_DESC"), RemoveShuffleOption),+ YMToggle(YMLOC(@"REMOVE_UN_SUB_OPTION"), YMLOC(@"REMOVE_UN_SUB_OPTION_DESC"), RemoveUnSubOption),+ YMToggle(YMLOC(@"REMOVE_HIDE_FROM_PLAYLIST_OPTION"), YMLOC(@"REMOVE_HIDE_FROM_PLAYLIST_OPTION_DESC"), RemoveHideFromPlaylistOption),+ YMToggle(YMLOC(@"REMOVE_HELP_OPTION"), YMLOC(@"REMOVE_HELP_OPTION_DESC"), RemoveHelpOption),+ YMToggle(YMLOC(@"REMOVE_NOTIFY_OPTION"), YMLOC(@"REMOVE_NOTIFY_OPTION_DESC"), RemoveNotifyOption),+ YMToggle(YMLOC(@"REMOVE_CLEARSCREEN_OPTION"), YMLOC(@"REMOVE_CLEARSCREEN_OPTION_DESC"), RemoveClearScreenOption),+ ];+ YMRegisterSettingsGroup(YMLOC(@"MISCELLANEOUS"), miscItems);+ YTSettingsSectionItem *othergroup = [YTSettingsSectionItemClass itemWithTitle:YMLOC(@"MISCELLANEOUS") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ YMPushSubSettings(YMLOC(@"MISCELLANEOUS"), miscItems, settingsViewController, [self parentResponder]);+ return YES;+ }];+ YTIIcon *icon6 = [%c(YTIIcon) new];+ icon6.iconType = 1101;+ othergroup.settingIcon = icon6;+ [sectionItems addObject:othergroup];++ // Section: SponsorBlock+ YTSettingsSectionItem *sponsorblockgroup = [YTSettingsSectionItemClass itemWithTitle:@"SponsorBlock" accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ [self updateSponsorBlockSectionWithEntry:entry];+ return YES;+ }];+ YTIIcon *iconSB = [%c(YTIIcon) new];+ iconSB.iconType = 610;+ sponsorblockgroup.settingIcon = iconSB;+ [sectionItems addObject:sponsorblockgroup];++ // Section 9+ // Perferences+ YTSettingsSectionItem *perfgroup = [YTSettingsSectionItemClass itemWithTitle:YMLOC(@"PERFER_HEADER") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {+ YMPushSubSettings(YMLOC(@"PERFER_HEADER"), @[+ YMHeader(YMLOC(@"PERFER")),+ YMAction(YMLOC(@"IMPORT"), YMLOC(@"IMPORT_DESC"), ^(UIViewController *vc) {+ Class alertClass = NSClassFromString(@"YTAlertView");+ YTAlertView *alertView = [alertClass confirmationDialogWithAction:^{+ [[YouModPrefsManager sharedManager] importYouModSettingsFromVC:vc];+ } actionTitle:YMLOC(@"YES")];+ alertView.title = YMLOC(@"WARNING");+ alertView.subtitle = YMLOC(@"OVERRIDE");+ alertView.shouldDismissOnBackgroundTap = YES;+ [alertView show];+ }),+ YMAction(YMLOC(@"EXPORT"), YMLOC(@"EXPORT_DESC"), ^(UIViewController *vc) {+ [[YouModPrefsManager sharedManager] exportYouModSettingsFromVC:vc];+ }),+ YMAction(YMLOC(@"RESTORE"), YMLOC(@"RESTORE_DESC"), ^(UIViewController *vc) {+ [[YouModPrefsManager sharedManager] restoreYouModDefaults];+ }),+ YMHeader(YMLOC(@"CACHE")),+ YMAction(YMLOC(@"CLEARCACHE"), GetCacheSize(), ^(UIViewController *vc) {+ __weak UIViewController *weakVC = vc;+ NSString *clearTitle = YMLOC(@"CLEARCACHE");+ dispatch_async(dispatch_get_main_queue(), ^{+ __strong UIViewController *strongVC = weakVC;+ if (!strongVC) return;+ if ([strongVC respondsToSelector:@selector(items)] && [strongVC respondsToSelector:@selector(tableView)]) {+ NSArray *items = [(id)strongVC items];+ for (id item in items) {+ if ([[item title] isEqualToString:clearTitle]) {+ [item setSubtitle:@""];+ break;+ }+ }+ UITableView *tableView = [(id)strongVC tableView];+ [tableView reloadData];+ for (UITableViewCell *cell in tableView.visibleCells) {+ if ([cell.textLabel.text isEqualToString:clearTitle]) {+ UIActivityIndicatorView *indicator = [cell viewWithTag:0xC0FFEE];+ if (!indicator) {+ indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleMedium];+ indicator.tag = 0xC0FFEE;+ [indicator startAnimating];+ cell.accessoryView = indicator;+ }+ cell.detailTextLabel.text = @"";+ break;+ }+ }+ }+ });++ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{+ NSString *cachePath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject;+ [[NSFileManager defaultManager] removeItemAtPath:cachePath error:nil];+ dispatch_async(dispatch_get_main_queue(), ^{+ __strong UIViewController *strongVC = weakVC;+ if (!strongVC) return;+ if ([strongVC respondsToSelector:@selector(tableView)]) {+ UITableView *tableView = [(id)strongVC tableView];+ for (UITableViewCell *cell in tableView.visibleCells) {+ if ([cell.textLabel.text isEqualToString:YMLOC(@"CLEARCACHE")]) {+ cell.accessoryView = nil;+ break;+ }+ }+ }+ if ([strongVC respondsToSelector:@selector(items)] && [strongVC respondsToSelector:@selector(tableView)]) {+ NSArray *items = [(id)strongVC items];+ for (id item in items) {+ if ([[item title] isEqualToString:clearTitle]) {+ [item setSubtitle:@"0 KB"];+ break;+ }+ }+ [[(id)strongVC tableView] reloadData];+ }+ });+ });+ }),+ YMToggle(YMLOC(@"AUTO_CLEARCACHE"), YMLOC(@"AUTO_CLEARCACHE_DESC"), AutoClearCache),+ ], settingsViewController, [self parentResponder]);+ return YES;+ }];+ YTIIcon *icon7 = [%c(YTIIcon) new];+ icon7.iconType = 530;+ perfgroup.settingIcon = icon7;+ [sectionItems addObject:perfgroup];++ if ([settingsViewController respondsToSelector:@selector(setSectionItems:forCategory:title:icon:titleDescription:headerHidden:)]) {+ YTIIcon *icon = [%c(YTIIcon) new];+ icon.iconType = YT_TUNE;+ [settingsViewController setSectionItems:sectionItems forCategory:TweakSection title:TweakName icon:icon titleDescription:nil headerHidden:NO];+ } else+ [settingsViewController setSectionItems:sectionItems forCategory:TweakSection title:TweakName titleDescription:nil headerHidden:NO];+}++- (void)updateSectionForCategory:(NSUInteger)category withEntry:(id)entry {+ if (category == TweakSection) {+ [self updateYouModSectionWithEntry:entry];+ return;+ }+ %orig;+}++%end++%ctor {+ [[NSUserDefaults standardUserDefaults] registerDefaults:@{+ AutoClearCache: @YES,+ DownloadMethod: @2,+ YTLogoIndex: @1,+ BackgroundPlayback: @YES,+ DownloadManager: @YES,+ SBButtonKey: @YES,+ DisableHints: @YES,+ RewindSeconds: @10.0,+ ForwardSeconds: @10.0,+ }];+ %init;+}diff --git a/vendor/YouMod/Files/Shorts.x b/vendor/YouMod/Files/Shorts.xnew file mode 100644index 0000000..4e4b34a--- /dev/null+++ b/vendor/YouMod/Files/Shorts.x@@ -0,0 +1,302 @@+#import "Headers.h"++// Enables shorts quality - works best with YTClassicVideoQuality+%hook YTHotConfig+- (BOOL)enableOmitAdvancedMenuInShortsVideoQualityPicker { return IS_ENABLED(EnablesShortsQuality) ? YES : %orig; }+- (BOOL)enableShortsVideoQualityPicker { return IS_ENABLED(EnablesShortsQuality) ? YES : %orig; }+- (BOOL)iosEnableImmersiveLivePlayerVideoQuality { return IS_ENABLED(EnablesShortsQuality) ? YES : %orig; }+- (BOOL)iosEnableShortsPlayerVideoQuality { return IS_ENABLED(EnablesShortsQuality) ? YES : %orig; }+- (BOOL)iosEnableShortsPlayerVideoQualityRestartVideo { return IS_ENABLED(EnablesShortsQuality) ? YES : %orig; }+- (BOOL)iosEnableSimplerTitleInShortsVideoQualityPicker { return IS_ENABLED(EnablesShortsQuality) ? YES : %orig; }+- (BOOL)enablePlayerBarForVerticalVideoWhenControlsHiddenInFullscreen { return IS_ENABLED(ShowShortsSeekbar) ? YES : %orig; }+%end++// Always show Shorts seekbar+%hook YTShortsPlayerViewController+- (BOOL)shouldAlwaysEnablePlayerBar { return IS_ENABLED(ShowShortsSeekbar) ? YES : %orig; }+- (BOOL)shouldEnablePlayerBarOnlyOnPause { return IS_ENABLED(ShowShortsSeekbar) ? NO : %orig; }+%end++%hook YTReelPlayerViewControllerSub+- (BOOL)shouldAlwaysEnablePlayerBar { return IS_ENABLED(ShowShortsSeekbar) ? YES : %orig; }+- (BOOL)shouldEnablePlayerBarOnlyOnPause { return IS_ENABLED(ShowShortsSeekbar) ? NO : %orig; }+%end++%hook YTColdConfig+- (BOOL)iosEnableVideoPlayerScrubber { return IS_ENABLED(ShowShortsSeekbar) ? YES : %orig; }+- (BOOL)mobileShortsTablnlinedExpandWatchOnDismiss { return IS_ENABLED(ShowShortsSeekbar) ? YES : %orig; }+%end++static void YouModMakeAShortsAction(YTReelPlayerViewController *self, YTSingleVideoController *video, YTSingleVideoTime *time) {+ if (INTFORVAL(ShortsActionIndex) == 0) return;++ if (floor(time.time) >= floor(video.totalMediaTime)) {+ if (INTFORVAL(ShortsActionIndex) == 1) {+ [self reelContentViewRequestsAdvanceToNextVideo:nil];+ } else if (INTFORVAL(ShortsActionIndex) == 2) {+ [self reelContentViewRequestsPlayPauseToggle:nil];+ }+ }+}++static BOOL isShortsOnlyOn = YES;+static BOOL isFullscreenEnabled = NO;++%hook YTReelPlayerViewController+- (BOOL)shouldAlwaysEnablePlayerBar { return IS_ENABLED(ShowShortsSeekbar) ? YES : %orig; }+- (BOOL)shouldEnablePlayerBarOnlyOnPause { return IS_ENABLED(ShowShortsSeekbar) ? NO : %orig; }+- (void)singleVideo:(YTSingleVideoController *)video currentVideoTimeDidChange:(YTSingleVideoTime *)time {+ %orig;+ YouModMakeAShortsAction(self, video, time);+}+- (void)loadPlayerBar {+ %orig;+ if ((isShortsOnlyOn && IS_ENABLED(ShortsOnly)) || (isFullscreenEnabled && IS_ENABLED(FullScreenShorts))) [[self valueForKey:@"_pivotBarProvider"] performSelector:@selector(hidePivotBar)];+ YTPlayerViewController *main = self.player;+ if (INTFORVAL(CaptionTrack) != 0) [main performSelector:@selector(YouModAutoCaptions) withObject:nil afterDelay:0.5];+ if (INTFORVAL(AutoSpeedIndex) != 0) [main performSelector:@selector(YouModSetAutoSpeed) withObject:nil afterDelay:0.5];+ if (INTFORVAL(AudioTrack) != 0) [self performSelector:@selector(YouModAutoAudioTrack:) withObject:main afterDelay:0.5];+}+%new+- (void)YouModAutoAudioTrack:(YTPlayerViewController *)pv {+ NSInteger selectedIndex = INTFORVAL(AudioTrackLangIndex);+ NSArray *langCodes = getAllSystemLanguageValues();+ NSString *userTargetLang = langCodes[selectedIndex];+ id switchcon = self.audioTrackController;+ NSArray *availableTracks = [switchcon valueForKey:@"_availableAudioTracks"];+ if (!availableTracks || availableTracks.count == 0) return;+ YTIAudioTrack *matchedTrack = nil;++ if (INTFORVAL(AudioTrack) == 1) {+ // Loop for all tracks+ for (YTIAudioTrack *track in availableTracks) {+ if ([track.id_p hasSuffix:@".4"]) {+ matchedTrack = track;+ break;+ }+ }+ } else if (INTFORVAL(AudioTrack) == 2) {+ // Loop for all tracks+ for (YTIAudioTrack *track in availableTracks) {+ if ([track.id_p hasPrefix:userTargetLang]) {+ matchedTrack = track;+ break;+ }+ }++ // Check if it's dubbed+ if (matchedTrack && [matchedTrack isAutoDubbed] && IS_ENABLED(NoDubbedAudioTrack)) matchedTrack = nil;++ if (!matchedTrack && IS_ENABLED(NoDubbedAudioTrack)) {+ for (YTIAudioTrack *track in availableTracks) {+ if ([track.id_p hasSuffix:@".4"]) {+ matchedTrack = track;+ break;+ }+ }+ }+ }++ // If found, change to it+ if (matchedTrack) {+ [pv setAudioTrack:matchedTrack source:0];+ }+}+%end++%hook YTReelTopBarView+- (void)didMoveToWindow {+ %orig;+ if (IS_ENABLED(HideShortsTopbar)) {+ if (self.superview) {+ [self removeFromSuperview];+ }+ } else if (IS_ENABLED(HideShortsSubbar)) {+ UIView *subbar = [self valueForKey:@"_pausedStateCarouselView"];+ if (subbar && subbar.superview) {+ [subbar removeFromSuperview];+ }+ }+}+%end++extern void YouModConfigureDownloadButton(_ASDisplayView *view);++static void YouModFilterShortsButtons(_ASDisplayView *self, NSString *iden) {+ NSDictionary *buttonsList = @{+ @"id.reel_like_button": @(IS_ENABLED(RemoveShortsLikeButton)),+ @"id.reel_like_toggled_button": @(IS_ENABLED(RemoveShortsLikeButton)),+ @"id.reel_comment_button": @(IS_ENABLED(RemoveShortsCommentButton)),+ @"id.reel_share_button": @(IS_ENABLED(RemoveShortsShareButton)),+ @"id.reel_remix_button" : @(IS_ENABLED(RemoveShortsRemixButton)),+ @"id.reel_pivot_button": @(IS_ENABLED(RemoveShortsSoundMetadataButton))+ };+ for (NSString *button in buttonsList) {+ if ([iden isEqualToString:button] && [buttonsList[button] boolValue]) {+ _ASDisplayView *mainView = (_ASDisplayView *)self.superview;+ ASDisplayNode *node = mainView.keepalive_node;+ for (_ASDisplayView *view in node.yogaChildren) {+ if ([[view description] containsString:button]) {+ [node removeYogaChild:view];+ [self removeFromSuperview];+ break;+ }+ }+ break;+ }+ }+}++static void YouModFilterShortsPausedHeader(_ASDisplayView *self, NSString *iden) {+ NSDictionary *buttonsList = @{+ @"id.ui.shorts_paused_state.subscriptions_button": @(IS_ENABLED(RemoveShortsPausedSubButton)),+ @"id.ui.shorts_paused_state.live_button": @(IS_ENABLED(RemoveShortsPausedLiveButton)),+ @"id.ui.shorts_paused_state.lens_button": @(IS_ENABLED(RemoveShortsPausedLensButton)),+ @"id.ui.shorts_paused_state.trends_button" : @(IS_ENABLED(RemoveShortsPausedTrendsButton))+ };+ for (NSString *button in buttonsList) {+ if ([iden isEqualToString:button] && [buttonsList[button] boolValue]) {+ ASScrollView *mainView = (ASScrollView *)self.superview;+ ASDisplayNode *node = mainView.scrollNode;+ for (_ASDisplayView *view in node.yogaChildren) {+ if ([[view description] containsString:button]) {+ [node removeYogaChild:view];+ [self removeFromSuperview];+ break;+ }+ }+ break;+ }+ }+}++static void YouModFilterShortsDisclosure(_ASDisplayView *self, NSString *iden) {+ if (![self.accessibilityIdentifier isEqualToString:@"eml.shorts-disclosures"] || !IS_ENABLED(RemoveShortsDisclosure)) return;+ _ASDisplayView *dpView = (_ASDisplayView *)self.superview;+ ASDisplayNode *node = dpView.keepalive_node;+ _ASDisplayView *maindpView = (_ASDisplayView *)dpView.superview;+ ASDisplayNode *mainNode = maindpView.keepalive_node;+ [mainNode removeYogaChild:node];+ [maindpView removeFromSuperview];+}++// _ASDisplayView filters+%hook _ASDisplayView+- (void)didMoveToWindow {+ %orig;+ YouModConfigureDownloadButton(self);+ NSString *iden = self.accessibilityIdentifier;+ if (!iden || iden.length == 0) return;+ NSDictionary *elements = @{+ @"product_sticker.main_target": @(IS_ENABLED(HideShortsProducts)),+ @"product_sticker.secondary_target": @(IS_ENABLED(HideShortsProducts)),+ @"id.elements.components.suggested_action": @(IS_ENABLED(HideShortsRecbar))+ };+ if ([elements[iden] boolValue]) {+ [self removeFromSuperview];+ return;+ }+ if ([iden isEqualToString:@"eml.reel_sponsor_button"] && IS_ENABLED(RemoveChannelSponsorAll)) {+ [self.superview removeFromSuperview];+ return;+ }++ YouModFilterShortsButtons(self, iden);+ YouModFilterShortsPausedHeader(self, iden);+ YouModFilterShortsDisclosure(self, iden);+}+%end++%hook YTAppDelegate+- (void)appDidBecomeActive {+ %orig;+ if ((isFullscreenEnabled && IS_ENABLED(FullScreenShorts)) || (isShortsOnlyOn && IS_ENABLED(ShortsOnly))) {+ [[self valueForKey:@"_appViewController"] performSelector:@selector(hidePivotBar)];+ }+}+%end++%hook YTReelWatchPlaybackOverlayView+%property (nonatomic, retain) UIPinchGestureRecognizer *YouModFullscreenGesture;+- (void)didMoveToWindow {+ %orig;+ if (!IS_ENABLED(FullScreenShorts)) return;+ if (!self.YouModFullscreenGesture) {+ self.YouModFullscreenGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(YouModFullscrrenGestureHandler:)];+ self.YouModFullscreenGesture.delegate = (id<UIGestureRecognizerDelegate>)self;+ [self.superview addGestureRecognizer:self.YouModFullscreenGesture];+ }+}+%new+- (void)YouModFullscrrenGestureHandler:(UIPinchGestureRecognizer *)gesture {+ if (gesture.state != UIGestureRecognizerStateBegan || (isShortsOnlyOn && IS_ENABLED(ShortsOnly))) return;+ UIViewController *appVC = [self valueForKey:@"_pivotBarProvider"];+ BOOL isTabBarHidden = [appVC performSelector:@selector(isPivotBarHidden)];+ if (gesture.scale > 1.0) {+ if (!isTabBarHidden) {+ [appVC performSelector:@selector(hidePivotBar)];+ [UIView animateWithDuration:0.3 animations:^{+ self.alpha = 0;+ }];+ isFullscreenEnabled = YES;+ }+ } else if (gesture.scale < 1.0) {+ if (isTabBarHidden) {+ [appVC performSelector:@selector(showPivotBar)];+ [UIView animateWithDuration:0.3 animations:^{+ self.alpha = 1;+ }];+ isFullscreenEnabled = NO;+ }+ }+}+%new+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {+ if (gestureRecognizer == self.YouModFullscreenGesture) {+ return YES;+ }+ return NO;+}+%end++%hook YTReelContentView+%property (nonatomic, retain) UILongPressGestureRecognizer *YouModExitShortsOnlyGesture;+- (void)setPlaybackView:(id)arg1 {+ %orig;+ self.playbackOverlay.alpha = !isFullscreenEnabled;+ if (!IS_ENABLED(ShortsOnly)) return;+ if (isShortsOnlyOn) {+ self.YouModExitShortsOnlyGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(YouModTurnOffShortsOnly:)];+ self.YouModExitShortsOnlyGesture.numberOfTouchesRequired = 2;+ self.YouModExitShortsOnlyGesture.minimumPressDuration = 0.5;+ self.YouModExitShortsOnlyGesture.delegate = (id<UIGestureRecognizerDelegate>)self;+ [self addGestureRecognizer:self.YouModExitShortsOnlyGesture];+ }+}+%new+- (void)YouModTurnOffShortsOnly:(UILongPressGestureRecognizer *)gesture {+ if (gesture.state != UIGestureRecognizerStateBegan) return;+ isShortsOnlyOn = NO;+ UIView *parent = sbGetNotificationParent();+ [SBSkipNotificationView showSuccessInView:parent message:LOC(@"SHORTS_ONLY_DISABLED") duration:3.0];++ [[[[self valueForKey:@"_parentResponder"] valueForKey:@"_delegate"] valueForKey:@"_pivotBarProvider"] performSelector:@selector(showPivotBar)];+ [UIView animateWithDuration:0.3 animations:^{+ self.playbackOverlay.alpha = 1;+ }];+}+%new+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {+ if (gestureRecognizer == self.YouModExitShortsOnlyGesture && [otherGestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]]) {+ return YES;+ }+ return NO;+}+%new+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {+ if (gestureRecognizer == self.YouModExitShortsOnlyGesture) {+ return NO;+ }+ return YES;+}+%end\ No newline at end of filediff --git a/vendor/YouMod/Files/Sideloading.x b/vendor/YouMod/Files/Sideloading.xnew file mode 100644index 0000000..7e46717--- /dev/null+++ b/vendor/YouMod/Files/Sideloading.x@@ -0,0 +1,172 @@+// All Codes are adapt from YTLite and uYouEnhanced + Some of my research+#import "Headers.h"++// AccessGroupID+static NSString *accessGroupID() {+ NSDictionary *query = [NSDictionary dictionaryWithObjectsAndKeys:+ (__bridge NSString *)kSecClassGenericPassword, (__bridge NSString *)kSecClass,+ @"bundleSeedID", kSecAttrAccount,+ @"", kSecAttrService,+ (id)kCFBooleanTrue, kSecReturnAttributes,+ nil];+ CFDictionaryRef result = nil;+ OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, (CFTypeRef *)&result);+ if (status == errSecItemNotFound) {+ status = SecItemAdd((__bridge CFDictionaryRef)query, (CFTypeRef *)&result);+ if (status != errSecSuccess) {+ return nil;+ }+ }+ NSString *accessGroup = [(__bridge NSDictionary *)result objectForKey:(__bridge NSString *)kSecAttrAccessGroup];+ return accessGroup;+}++// IAmYouTube (https://github.com/PoomSmart/IAmYouTube)+%hook YTVersionUtils++ (NSString *)appName { return YT_NAME; }++ (NSString *)appID { return YT_BUNDLE_ID; }+%end++%hook GCKBUtils++ (NSString *)appIdentifier { return YT_BUNDLE_ID; }+%end++%hook GPCDeviceInfo++ (NSString *)bundleId { return YT_BUNDLE_ID; }+%end++%hook OGLBundle++ (NSString *)shortAppName { return YT_NAME; }+%end++%hook GVROverlayView++ (NSString *)appName { return YT_NAME; }+%end++%hook OGLPhenotypeFlagServiceImpl+- (NSString *)bundleId { return YT_BUNDLE_ID; }+%end++%hook APMAEU++ (BOOL)isFAS { return YES; }+%end++%hook GULAppEnvironmentUtil++ (BOOL)isFromAppStore { return YES; }+%end++%hook SSOClientLogin++ (NSString *)defaultSourceString { return YT_BUNDLE_ID; }+%end++%hook SSOConfiguration+- (id)initWithClientID:(id)clientID supportedAccountServices:(id)supportedAccountServices {+ self = %orig;+ [self setValue:YT_NAME forKey:@"_shortAppName"];+ [self setValue:YT_BUNDLE_ID forKey:@"_applicationIdentifier"];+ return self;+}+%end++%hook YTHotConfig+- (BOOL)clientInfraClientConfigIosEnableFillingEncodedHacksInnertubeContext { return NO; }+%end++%hook NSBundle++ (NSBundle *)bundleWithIdentifier:(NSString *)identifier {+ if ([identifier isEqualToString:YT_BUNDLE_ID])+ return NSBundle.mainBundle;+ return %orig(identifier);+}+- (NSString *)bundleIdentifier {+ return [self isEqual:NSBundle.mainBundle] ? YT_BUNDLE_ID : %orig;+}+- (NSDictionary *)infoDictionary {+ NSDictionary *dict = %orig;+ if (![self isEqual:NSBundle.mainBundle])+ return %orig;+ NSMutableDictionary *info = [dict mutableCopy];+ if (info[@"CFBundleIdentifier"]) info[@"CFBundleIdentifier"] = YT_BUNDLE_ID;+ if (info[@"CFBundleDisplayName"]) info[@"CFBundleDisplayName"] = YT_NAME;+ if (info[@"CFBundleName"]) info[@"CFBundleName"] = YT_NAME;+ return info;+}+- (id)objectForInfoDictionaryKey:(NSString *)key {+ if (![self isEqual:NSBundle.mainBundle])+ return %orig;+ if ([key isEqualToString:@"CFBundleIdentifier"])+ return YT_BUNDLE_ID;+ if ([key isEqualToString:@"CFBundleDisplayName"] || [key isEqualToString:@"CFBundleName"])+ return YT_NAME;+ return %orig;+}+%end++// AccessGroupID+%hook SSOKeychainHelper++ (id)accessGroup { return accessGroupID(); }++ (id)sharedAccessGroup { return accessGroupID(); }+%end++%hook SSOFolsomKeychainUtils+- (id)sharedAccessGroup { return accessGroupID(); }+%end++%hook GULKeychainStorage+- (void)getObjectForKey:(id)key objectClass:(Class)objectClass accessGroup:(id)accessGroup completionHandler:(id)handler {+ accessGroup = accessGroupID();+ %orig(key, objectClass, accessGroup, handler);+}+- (void)setObject:(id)object forKey:(id)key accessGroup:(id)accessGroup completionHandler:(id)handler {+ accessGroup = accessGroupID();+ %orig(object, key, accessGroup, handler);+}+- (void)removeObjectForKey:(id)key accessGroup:(id)accessGroup completionHandler:(id)handler {+ accessGroup = accessGroupID();+ %orig(key, accessGroup, handler);+}+- (void)getObjectFromKeychainForKey:(id)key objectClass:(Class)objectClass accessGroup:(id)accessGroup completionHandler:(id)handler {+ accessGroup = accessGroupID();+ %orig(key, objectClass, accessGroup, handler);+}+- (id)keychainQueryWithKey:(id)key accessGroup:(id)accessGroup {+ accessGroup = accessGroupID();+ return %orig(key, accessGroup);+}+%end++%hook GNPEncryptionConfiguration+- (id)initWithKeychainAccessGroup:(id)arg {+ arg = accessGroupID();+ return %orig(arg);+}+- (id)keychainAccessGroup { return accessGroupID(); }+%end++%hook FIRInstallationsStore+- (id)initWithSecureStorage:(id)arg1 accessGroup:(id)arg2 {+ arg2 = accessGroupID();+ return %orig(arg1, arg2);+}+- (id)accessGroup { return accessGroupID(); }+%end++%hook CHMConfiguration+- (void)setKeychainAccessGroup:(id)arg {+ arg = accessGroupID();+ %orig(arg);+}+- (id)keychainAccessGroup { return accessGroupID(); }+%end++// Fixes crash/data saving+%hook NSFileManager+- (NSURL *)containerURLForSecurityApplicationGroupIdentifier:(NSString *)groupIdentifier {+ if (groupIdentifier != nil) {+ NSArray *paths = [[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask];+ NSURL *documentsURL = [paths lastObject];+ return [documentsURL URLByAppendingPathComponent:@"AppGroup"];+ }+ return %orig;+}+%enddiff --git a/vendor/YouMod/Files/SponsorBlock.x b/vendor/YouMod/Files/SponsorBlock.xnew file mode 100644index 0000000..dafc167--- /dev/null+++ b/vendor/YouMod/Files/SponsorBlock.x@@ -0,0 +1,620 @@+#import "Headers.h"+#import <AudioToolbox/AudioToolbox.h>++BOOL useBackwardIconForButton;++// System sound played on skip when haptic/audio feedback is enabled.+static const SystemSoundID SBSkipHapticSoundID = 1519;++// Skipping is suppressed within this many seconds of a segment's end, so a+// segment already almost over isn't re-triggered by a late time-change callback.+static const CGFloat SBSegmentEndGuardSeconds = 0.5;++// The skip banner is shown after this delay so the seek completes first —+// otherwise the following time-change callback dismisses it immediately.+static const NSTimeInterval SBSkipNotificationDelaySeconds = 0.3;++// Clamps a stored banner duration to the supported range, falling back to the+// default when unset or out of range.+static float SBClampedAlertDuration(NSString *key) {+ float duration = FLOAT_FOR_KEY(key);+ if (duration < SBAlertDurationMin || duration > SBAlertDurationMax) return SBAlertDurationDefault;+ return duration;+}++@interface SBPassthroughView : UIView+@end+@implementation SBPassthroughView+- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {+ UIView *hit = [super hitTest:point withEvent:event];+ return (hit == self) ? nil : hit;+}+@end++@interface SBPassthroughWindow : UIWindow+@end+@implementation SBPassthroughWindow+- (BOOL)_canBecomeKeyWindow { return NO; }+- (BOOL)_canAffectStatusBarAppearance { return NO; }+- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {+ UIView *rootView = self.rootViewController.view;+ if (!rootView) return nil;+ CGPoint convertedPoint = [rootView convertPoint:point fromView:self];+ UIView *hitView = [rootView hitTest:convertedPoint withEvent:event];+ if (!hitView || hitView == rootView) return nil;+ return hitView;+}+@end++static SBPassthroughWindow *sbOverlayWindow = nil;++void sbUpdateOverlayInsetForPivotBar() {+ if (!sbOverlayWindow) return;+ UIViewController *rootVC = sbOverlayWindow.rootViewController;+ if (!rootVC) return;++ // The overlay window's frame is set only at creation; the scene can change+ // size afterward (rotation, iPhone fullscreen exit) and this plain-UIViewController+ // window doesn't auto-resize with it. Re-syncing to the current scene bounds keeps+ // the pill safe-area math on the correct (e.g. portrait) size rather than a stale+ // landscape one — otherwise pills anchor to a mid-screen bottom edge.+ UIWindowScene *scene = sbOverlayWindow.windowScene;+ CGRect sceneBounds = scene ? scene.coordinateSpace.bounds : sbOverlayWindow.bounds;+ if (scene && !CGRectEqualToRect(sbOverlayWindow.frame, sceneBounds)) {+ sbOverlayWindow.frame = sceneBounds;+ }++ // Look up YouTube's root view controller in the SAME scene as our overlay+ // window — on iPad multi-window the app delegate's window may belong to a+ // different scene, so [delegate window] is not safe here.+ UIWindow *ytWindow = nil;+ for (UIWindow *win in sbOverlayWindow.windowScene.windows) {+ if ([win.rootViewController isKindOfClass:NSClassFromString(@"YTAppViewController")] || [win.rootViewController isKindOfClass:NSClassFromString(@"YTAppViewControllerImpl")]) {+ ytWindow = win;+ break;+ }+ }+ UIViewController *appVC = ytWindow.rootViewController;+ YTPivotBarViewController *pivotVC = (YTPivotBarViewController *)[appVC performSelector:@selector(pivotBarViewController)];+ YTPivotBarView *pivot = (YTPivotBarView *)pivotVC.view;++ // Measure the pivot bar's visible top edge in our overlay window's coords+ // and convert it into the inset our pills need above the device safe area.+ // This avoids reading pivot.bounds.size.height directly — that value+ // includes home-indicator padding on notched devices and would over-correct+ // the safe area, leaving the pill floating too high above the tabbar.+ CGFloat tabH = 0.0;+ if (pivot && pivot.window != nil && !pivot.hidden && pivot.alpha > 0.01) {+ UIView *overlayView = rootVC.view;+ CGRect pivotInOverlay = [overlayView convertRect:pivot.bounds fromView:pivot];+ CGFloat pivotTop = CGRectGetMinY(pivotInOverlay);+ // The scene bounds are the authoritative overlay height. overlayView.bounds+ // is avoided here because it only reflects a new window size once autoresizing+ // has propagated, which may lag within the current runloop.+ CGFloat overlayHeight = sceneBounds.size.height;+ CGFloat deviceSafeBottom = sbOverlayWindow.safeAreaInsets.bottom;+ CGFloat pivotHeight = pivot.bounds.size.height;+ // Clamp to the pivot bar's own height: a legitimate inset can never exceed+ // the bar it's clearing. If convertRect returns a stale value during a scene+ // transition (e.g. fullscreen exit), the raw result balloons toward the full+ // screen height — clamping to pivotHeight keeps the pill just above the safe+ // area instead of letting it drift to the middle of the screen.+ tabH = MAX(0.0, MIN(pivotHeight, overlayHeight - deviceSafeBottom - pivotTop));+ }+ UIEdgeInsets current = rootVC.additionalSafeAreaInsets;+ if (current.bottom != tabH) {+ rootVC.additionalSafeAreaInsets = UIEdgeInsetsMake(0, 0, tabH, 0);+ }+}++static const NSTimeInterval SBOverlayRestoreFadeDuration = 0.15;++// Hide the pill overlay instantly (non-animated): iOS captures the app-switcher+// snapshot synchronously as the app deactivates, so an animated hide wouldn't+// land in time and the pill would leak into the switcher card.+static void sbHideOverlayForSnapshot(void) {+ if (sbOverlayWindow) sbOverlayWindow.hidden = YES;+}++// Restore the overlay, fading it back in so the reappearance isn't a hard pop.+// Guarded to the hidden state so the two "became active" notifications don't+// each re-trigger the fade.+static void sbRestoreOverlayAfterSnapshot(void) {+ if (!sbOverlayWindow || !sbOverlayWindow.hidden) return;+ sbOverlayWindow.alpha = 0.0;+ sbOverlayWindow.hidden = NO;+ [UIView animateWithDuration:SBOverlayRestoreFadeDuration animations:^{+ sbOverlayWindow.alpha = 1.0;+ }];+}++// Tracks which scene's lifecycle is currently observed. When sbOverlayWindow is+// recreated for a different scene (after the original goes Unattached), we+// re-bind observers to the new scene rather than leaving stale registrations.+static UIWindowScene *sbObservedScene = nil;+static id sbSceneDeactivateObserver = nil;+static id sbSceneBackgroundObserver = nil;+static id sbSceneActivateObserver = nil;+static id sbAppResignObserver = nil;+static id sbAppBackgroundObserver = nil;+static id sbAppActivateObserver = nil;+static id sbOrientationObserver = nil;++static void sbRegisterOverlayLifecycleObservers(UIWindowScene *targetScene) {+ if (!targetScene || sbObservedScene == targetScene) return;+ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];++ if (sbSceneDeactivateObserver) [nc removeObserver:sbSceneDeactivateObserver];+ if (sbSceneBackgroundObserver) [nc removeObserver:sbSceneBackgroundObserver];+ if (sbSceneActivateObserver) [nc removeObserver:sbSceneActivateObserver];+ if (sbAppResignObserver) [nc removeObserver:sbAppResignObserver];+ if (sbAppBackgroundObserver) [nc removeObserver:sbAppBackgroundObserver];+ if (sbAppActivateObserver) [nc removeObserver:sbAppActivateObserver];+ if (sbOrientationObserver) [nc removeObserver:sbOrientationObserver];++ sbObservedScene = targetScene;++ // Hide on deactivation, restore on activation. Deactivation is the trigger+ // (not backgrounding) because invoking the app switcher only moves the app to+ // the inactive state — a background-only observer misses that path. queue:nil+ // runs the hide synchronously before the snapshot is captured. Scene+ // notifications are filtered to targetScene so one scene's interruption+ // doesn't hide another's overlay on iPad multi-window; the app-level+ // notifications (object:nil) are an app-wide backstop.+ sbSceneDeactivateObserver = [nc addObserverForName:UISceneWillDeactivateNotification object:targetScene queue:nil usingBlock:^(__unused NSNotification *note) {+ sbHideOverlayForSnapshot();+ }];+ sbSceneBackgroundObserver = [nc addObserverForName:UISceneDidEnterBackgroundNotification object:targetScene queue:nil usingBlock:^(__unused NSNotification *note) {+ sbHideOverlayForSnapshot();+ }];+ sbSceneActivateObserver = [nc addObserverForName:UISceneDidActivateNotification object:targetScene queue:nil usingBlock:^(__unused NSNotification *note) {+ sbRestoreOverlayAfterSnapshot();+ }];+ sbAppResignObserver = [nc addObserverForName:UIApplicationWillResignActiveNotification object:nil queue:nil usingBlock:^(__unused NSNotification *note) {+ sbHideOverlayForSnapshot();+ }];+ sbAppBackgroundObserver = [nc addObserverForName:UIApplicationDidEnterBackgroundNotification object:nil queue:nil usingBlock:^(__unused NSNotification *note) {+ sbHideOverlayForSnapshot();+ }];+ sbAppActivateObserver = [nc addObserverForName:UIApplicationDidBecomeActiveNotification object:nil queue:nil usingBlock:^(__unused NSNotification *note) {+ sbRestoreOverlayAfterSnapshot();+ }];++ // Recompute pivot-bar inset on rotation / dynamic tabbar height changes.+ // UIDeviceOrientationDidChangeNotification only fires when device-orientation+ // generation is enabled; this call is idempotent.+ [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];+ sbOrientationObserver = [nc addObserverForName:UIDeviceOrientationDidChangeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(__unused NSNotification *note) {+ sbUpdateOverlayInsetForPivotBar();+ }];+}++UIView *sbGetNotificationParent(void) {+ if (sbOverlayWindow && sbOverlayWindow.windowScene.activationState == UISceneActivationStateUnattached) {+ sbOverlayWindow = nil;+ }+ if (!sbOverlayWindow) {+ UIWindowScene *activeScene = nil;+ for (UIWindowScene *scene in [UIApplication sharedApplication].connectedScenes) {+ if (scene.activationState == UISceneActivationStateForegroundActive) {+ activeScene = scene;+ break;+ }+ }+ if (!activeScene) {+ activeScene = (UIWindowScene *)[[[UIApplication sharedApplication].connectedScenes allObjects] firstObject];+ }+ if (!activeScene) return nil;++ sbOverlayWindow = [[SBPassthroughWindow alloc] initWithWindowScene:activeScene];+ sbOverlayWindow.frame = activeScene.coordinateSpace.bounds;+ sbOverlayWindow.windowLevel = UIWindowLevelAlert - 1;+ sbOverlayWindow.backgroundColor = [UIColor clearColor];+ sbOverlayWindow.hidden = NO;++ UIViewController *rootVC = [[UIViewController alloc] init];+ rootVC.view = [[SBPassthroughView alloc] initWithFrame:sbOverlayWindow.bounds];+ rootVC.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;+ rootVC.view.backgroundColor = [UIColor clearColor];+ sbOverlayWindow.rootViewController = rootVC;++ sbRegisterOverlayLifecycleObservers(activeScene);+ sbUpdateOverlayInsetForPivotBar();+ }+ return sbOverlayWindow.rootViewController.view;+}++static NSMutableDictionary<NSString *, NSArray<SBSegment *> *> *sbSegmentCache;++NSArray<NSString *> *sbAllCategories(void) {+ static NSArray *cats;+ static dispatch_once_t onceToken;+ dispatch_once(&onceToken, ^{+ cats = @[@"sponsor", @"intro", @"outro", @"interaction", @"selfpromo",+ @"music_offtopic", @"preview", @"hook", @"poi_highlight", @"filler"];+ });+ return cats;+}++static NSArray<NSString *> *sbEnabledCategories() {+ NSMutableArray *enabled = [NSMutableArray array];+ for (NSString *cat in sbAllCategories()) {+ NSInteger action = [[NSUserDefaults standardUserDefaults] integerForKey:SB_ACTION_KEY(cat)];+ if (action != SBSegmentActionDisable) {+ [enabled addObject:cat];+ }+ }+ return enabled;+}++UIColor *SBColorFromHex(NSString *hexString) {+ if (!hexString || hexString.length < 7) return [UIColor whiteColor];+ unsigned int hex = 0;+ NSScanner *scanner = [NSScanner scannerWithString:[hexString substringFromIndex:1]];+ [scanner scanHexInt:&hex];+ return [UIColor colorWithRed:((hex >> 16) & 0xFF) / 255.0+ green:((hex >> 8) & 0xFF) / 255.0+ blue:(hex & 0xFF) / 255.0+ alpha:1.0];+}++#pragma mark - SBSegment Implementation++@implementation SBSegment+++ (instancetype)segmentWithUUID:(NSString *)UUID category:(NSString *)category start:(float)start end:(float)end action:(NSString *)actionType {+ SBSegment *seg = [[SBSegment alloc] init];+ seg.UUID = UUID;+ seg.category = category;+ seg.startTime = start;+ seg.endTime = end;+ seg.actionType = actionType;+ return seg;+}++- (SBSegmentAction)configuredAction {+ return (SBSegmentAction)[[NSUserDefaults standardUserDefaults] integerForKey:SB_ACTION_KEY(self.category)];+}++- (UIColor *)segmentColor {+ NSString *hex = [[NSUserDefaults standardUserDefaults] stringForKey:SB_COLOR_KEY(self.category)];+ return SBColorFromHex(hex);+}++@end++#pragma mark - SBRequest Implementation++@implementation SBRequest+++ (void)fetchSegmentsForVideoID:(NSString *)videoID completion:(void (^)(NSArray<SBSegment *> *))completion {+ if (!videoID || videoID.length == 0) {+ if (completion) completion(@[]);+ return;+ }++ @synchronized(sbSegmentCache) {+ NSArray *cached = sbSegmentCache[videoID];+ if (cached) {+ if (completion) completion(cached);+ return;+ }+ }++ NSArray *categories = sbEnabledCategories();+ if (categories.count == 0) {+ if (completion) completion(@[]);+ return;+ }++ NSData *catJSON = [NSJSONSerialization dataWithJSONObject:categories options:0 error:nil];+ NSString *catString = [[NSString alloc] initWithData:catJSON encoding:NSUTF8StringEncoding];+ NSString *encoded = [catString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];+ NSString *urlStr = [NSString stringWithFormat:@"https://sponsor.ajay.app/api/skipSegments?videoID=%@&categories=%@", videoID, encoded];+ NSURL *url = [NSURL URLWithString:urlStr];++ NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {+ NSMutableArray<SBSegment *> *segments = [NSMutableArray array];++ if (!error && data) {+ NSHTTPURLResponse *httpResp = (NSHTTPURLResponse *)response;+ if (httpResp.statusCode == 200) {+ NSArray *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];+ if ([json isKindOfClass:[NSArray class]]) {+ for (NSDictionary *item in json) {+ NSArray *segment = item[@"segment"];+ if (segment.count >= 2) {+ SBSegment *seg = [SBSegment segmentWithUUID:item[@"UUID"] ?: @""+ category:item[@"category"] ?: @""+ start:[segment[0] floatValue]+ end:[segment[1] floatValue]+ action:item[@"actionType"] ?: @"skip"];+ [segments addObject:seg];+ }+ }+ }+ }+ }++ dispatch_async(dispatch_get_main_queue(), ^{+ @synchronized(sbSegmentCache) {+ sbSegmentCache[videoID] = segments;+ }+ if (completion) completion(segments);+ });+ }];+ [task resume];+}++@end++#pragma mark - YTPlayerViewController Hooks++%hook YTPlayerViewController+%property (nonatomic, strong) NSString *sbLastVideoID;+%property (nonatomic, strong) NSArray *sbSegments;+%property (nonatomic, strong) NSMutableSet *sbSkippedSegments;+%property (nonatomic, strong) SBSkipNotificationView *sbNotificationView;+- (void)playbackController:(id)playbackController didActivateVideo:(id)video withPlaybackData:(id)playbackData {+ %orig;+ if (!IS_ENABLED(SBEnabled) || self.isPlayingAd) return;+ if ([self.parentViewController isKindOfClass:%c(YTShortsPlayerViewController)]) return;++ self.sbSkippedSegments = [NSMutableSet set];+ self.sbSegments = nil;++ [self.sbNotificationView dismiss];++ NSString *videoID = [self currentVideoID];+ if ([self.sbLastVideoID isEqualToString:videoID] && self.sbSegments.count > 0) return;+ self.sbLastVideoID = videoID;++ __weak typeof(self) weakSelf = self;+ [SBRequest fetchSegmentsForVideoID:videoID completion:^(NSArray<SBSegment *> *segments) {+ __strong typeof(weakSelf) strongSelf = weakSelf;+ if (!strongSelf) return;+ strongSelf.sbSegments = segments;+ [[NSNotificationCenter defaultCenter] postNotificationName:@"SBSegmentsDidLoad"+ object:strongSelf+ userInfo:@{@"segments": segments ?: @[]}];++ [strongSelf sbShowHighlightBannerIfNeeded:segments];+ }];+}++- (void)singleVideo:(YTSingleVideoController *)video currentVideoTimeDidChange:(YTSingleVideoTime *)time {+ %orig;+ [self sbCheckSegmentsAtCurrentTime];+}++// Time-change hook for YouTube versions that use the renamed selector.+- (void)potentiallyMutatedSingleVideo:(YTSingleVideoController *)video currentVideoTimeDidChange:(YTSingleVideoTime *)time {+ %orig;+ [self sbCheckSegmentsAtCurrentTime];+}++// Evaluates the loaded segments against the current playback time and performs+// the configured skip / ask action for the first matching segment. Shared by+// both time-change hooks so the skip logic lives in one place.+%new+- (void)sbCheckSegmentsAtCurrentTime {+ if (!IS_ENABLED(SBEnabled) || !IS_ENABLED(SBButtonKey) || self.isPlayingAd) return;+ if ([self.parentViewController isKindOfClass:%c(YTShortsPlayerViewController)]) return;++ CGFloat currentTime = [self currentVideoMediaTime];+ float minDuration = FLOAT_FOR_KEY(SBMinDuration);++ for (SBSegment *segment in self.sbSegments) {+ SBSegmentAction action = [segment configuredAction];+ if (action == SBSegmentActionDisable || action == SBSegmentActionDisplay) continue;++ BOOL isPoi = [segment.category isEqualToString:@"poi_highlight"];++ if (isPoi) {+ if (action == SBSegmentActionSkipTo) {+ NSString *segID = segment.UUID;+ if (![self.sbSkippedSegments containsObject:segID] && currentTime < segment.startTime) {+ [self.sbSkippedSegments addObject:segID];+ [self sbSkipToHighlight];+ break;+ }+ }+ continue;+ }++ if (action == SBSegmentActionSkipTo) continue;++ float duration = segment.endTime - segment.startTime;+ if (minDuration > 0 && duration < minDuration) continue;++ if (currentTime >= segment.startTime && currentTime < segment.endTime - SBSegmentEndGuardSeconds) {+ NSString *segID = segment.UUID;+ if ([self.sbSkippedSegments containsObject:segID]) continue;++ if (action == SBSegmentActionAutoSkip) {+ [self sbPerformSkip:segment];+ } else if (action == SBSegmentActionAsk) {+ [self sbShowAskNotification:segment];+ }+ break;+ }+ }+}++%new+- (void)sbPerformSkip:(SBSegment *)segment {+ [self.sbSkippedSegments addObject:segment.UUID];+ [self seekToTime:(CGFloat)segment.endTime];++ if (IS_ENABLED(SBAudioNotification)) {+ AudioServicesPlaySystemSound(SBSkipHapticSoundID);+ }++ if (IS_ENABLED(SBShowNotifications)) {+ useBackwardIconForButton = YES;+ NSBundle *bundle = YouModBundle();+ NSString *catName = [bundle localizedStringForKey:[NSString stringWithFormat:@"SB_CAT_%@", segment.category] value:segment.category table:nil];+ NSString *message = [NSString stringWithFormat:[bundle localizedStringForKey:@"SB_SKIPPED" value:@"%@ skipped" table:nil], catName];+ NSString *unskipTitle = [bundle localizedStringForKey:@"SB_UNSKIP" value:@"Unskip" table:nil];++ float alertDuration = SBClampedAlertDuration(SBUnskipAlertDuration);++ __weak typeof(self) weakSelf = self;+ // Delay notification so the seek completes before the banner is shown,+ // preventing the time-change callback from dismissing it immediately.+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(SBSkipNotificationDelaySeconds * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{+ __strong typeof(weakSelf) strongSelf = weakSelf;+ if (!strongSelf) return;+ UIView *parentView = sbGetNotificationParent();+ strongSelf.sbNotificationView = [SBSkipNotificationView showInView:parentView+ message:message+ buttonTitle:unskipTitle+ action:^{+ __strong typeof(weakSelf) ss = weakSelf;+ if (ss) [ss seekToTime:(CGFloat)segment.startTime];+ }+ duration:alertDuration];+ });+ }+}++%new+- (void)sbShowAskNotification:(SBSegment *)segment {+ [self.sbSkippedSegments addObject:segment.UUID];++ useBackwardIconForButton = NO;+ NSBundle *bundle = YouModBundle();+ NSString *catName = [bundle localizedStringForKey:[NSString stringWithFormat:@"SB_CAT_%@", segment.category] value:segment.category table:nil];+ NSString *message = [NSString stringWithFormat:[bundle localizedStringForKey:@"SB_DETECTED" value:@"%@ detected" table:nil], catName];++ float alertDuration = SBClampedAlertDuration(SBSkipAlertDuration);++ UIView *parentView = sbGetNotificationParent();+ __weak typeof(self) weakSelf = self;+ self.sbNotificationView = [SBSkipNotificationView showInView:parentView+ message:message+ buttonTitle:[bundle localizedStringForKey:@"SB_SKIP_NOW" value:@"Skip" table:nil]+ action:^{+ __strong typeof(weakSelf) ss = weakSelf;+ if (ss) [ss seekToTime:(CGFloat)segment.endTime];+ }+ duration:alertDuration];+}++%new+- (void)sbShowHighlightBannerIfNeeded:(NSArray<SBSegment *> *)segments {+ if (!IS_ENABLED(SBEnabled) || !IS_ENABLED(SBButtonKey) || self.isPlayingAd) return;+ if ([self.parentViewController isKindOfClass:%c(YTShortsPlayerViewController)]) return;++ for (SBSegment *seg in segments) {+ if ([seg.category isEqualToString:@"poi_highlight"]) {+ SBSegmentAction action = [seg configuredAction];+ CGFloat currentTime = [self currentVideoMediaTime];+ if (action == SBSegmentActionSkipTo) {+ if (currentTime < seg.startTime) {+ [self.sbSkippedSegments addObject:seg.UUID];+ [self sbSkipToHighlight];+ }+ break;+ } else if (action == SBSegmentActionAsk) {+ if (currentTime < seg.startTime) {+ useBackwardIconForButton = NO;+ NSBundle *bundle = YouModBundle();+ NSString *message = [bundle localizedStringForKey:@"SB_JUMP_TO_HIGHLIGHT" value:@"Highlight available. Jump to the point?" table:nil];+ NSString *skipTitle = [bundle localizedStringForKey:@"SB_SKIP_NOW" value:@"Skip" table:nil];++ float alertDuration = SBClampedAlertDuration(SBSkipAlertDuration);++ UIView *parentView = sbGetNotificationParent();+ SBSkipNotificationView *pill = [SBSkipNotificationView showInView:parentView+ message:message+ buttonTitle:skipTitle+ action:^{ [self sbSkipToHighlight]; }+ duration:alertDuration];+ if (pill) {+ pill.isHighlightPill = YES;+ self.sbNotificationView = pill;+ }+ }+ break;+ }+ }+ }+}++%new+- (void)sbSkipToHighlight {+ self.sbNotificationView.isHighlightPill = NO;++ for (SBSegment *segment in self.sbSegments) {+ if ([segment.category isEqualToString:@"poi_highlight"]) {+ CGFloat previousTime = [self currentVideoMediaTime];+ [self seekToTime:(CGFloat)segment.startTime];++ if (IS_ENABLED(SBShowNotifications)) {+ useBackwardIconForButton = YES;+ NSBundle *bundle = YouModBundle();+ NSString *message = [bundle localizedStringForKey:@"SB_JUMPED_TO_HIGHLIGHT" value:@"Jumped to highlight" table:nil];+ NSString *unskipTitle = [bundle localizedStringForKey:@"SB_UNSKIP" value:@"Unskip" table:nil];++ float alertDuration = SBClampedAlertDuration(SBUnskipAlertDuration);++ __weak typeof(self) weakSelf = self;+ SBSkipNotificationView *pill = [SBSkipNotificationView showInView:sbGetNotificationParent()+ message:message+ buttonTitle:unskipTitle+ action:^{+ __strong typeof(weakSelf) ss = weakSelf;+ if (ss) [ss seekToTime:previousTime];+ }+ duration:alertDuration];+ if (pill) {+ pill.isHighlightPill = YES;+ self.sbNotificationView = pill;+ }+ }+ break;+ }+ }+}++%end++// SponsorBlock's accent blue, reused for the toggle button's enabled state.+static UIColor *SBAccentColor() {+ return [UIColor colorWithRed:0.4 green:0.8 blue:1.0 alpha:1.0];+}++%ctor {+ sbSegmentCache = [NSMutableDictionary dictionary];+ %init;++ // Register the SponsorBlock toggle in the player overlay's custom button row.+ // sortOrder 100 keeps it right-most (directly under YouTube's settings gear).+ YMOverlayButtonSpec *toggle = [[YMOverlayButtonSpec alloc] init];+ toggle.identifier = @"sponsorblock.toggle";+ toggle.symbolName = @"shield.fill";+ toggle.settingsSymbolName = @"shield.fill";+ toggle.displayName = LOC(@"SPONSORBLOCK_BUTTON");+ toggle.tintColor = SBAccentColor();+ toggle.sortOrder = 100;+ toggle.isVisible = ^BOOL(YTPlayerViewController *player) {+ return IS_ENABLED(SBEnabled) && YMIsOverlayButtonEnabled(@"sponsorblock.toggle");+ };+ toggle.tintProvider = ^UIColor *(YTPlayerViewController *player) {+ return IS_ENABLED(SBButtonKey) ? SBAccentColor() : [UIColor grayColor];+ };+ toggle.onTap = ^(YTPlayerViewController *player, UIButton *button) {+ if (!player) return;+ BOOL newState = !IS_ENABLED(SBButtonKey);+ [[NSUserDefaults standardUserDefaults] setBool:newState forKey:SBButtonKey];+ button.tintColor = newState ? SBAccentColor() : [UIColor grayColor];++ NSArray *segments = newState ? (player.sbSegments ?: @[]) : @[];+ if (newState && segments.count == 0) return;+ [[NSNotificationCenter defaultCenter] postNotificationName:@"SBSegmentsDidLoad"+ object:player+ userInfo:@{@"segments": segments}];+ };+ YMRegisterOverlayButton(toggle);+}diff --git a/vendor/YouMod/Files/SponsorBlockSettings.x b/vendor/YouMod/Files/SponsorBlockSettings.xnew file mode 100644index 0000000..25ccbbd--- /dev/null+++ b/vendor/YouMod/Files/SponsorBlockSettings.x@@ -0,0 +1,917 @@+// SponsorBlockSettings.x — Custom UITableViewController matching YTLite's SponsorBlock UI+#import "Headers.h"+#import <objc/runtime.h>+#import <objc/message.h>++extern UIColor *SBColorFromHex(NSString *hexString);++// Purple accent used to tint the toggle switches and duration sliders on this+// page. (Distinct from the player overlay button's accent in SponsorBlock.x.)+static UIColor *SBControlTintColor(void) {+ return [UIColor colorWithRed:0.6 green:0.2 blue:0.9 alpha:1.0];+}++// Tag base for a slider row's value label, offset by the row index so each+// slider can find its own label via viewWithTag:.+static const NSInteger SBSliderValueLabelTagBase = 100;++// The localization key for a segment action's display name. Shared by the+// selected-action label and the action picker menu so the two never disagree.+static NSString *SBActionLocKey(SBSegmentAction action) {+ switch (action) {+ case SBSegmentActionAutoSkip: return @"SB_ACTION_AUTO_SKIP";+ case SBSegmentActionAsk: return @"SB_ACTION_ASK";+ case SBSegmentActionDisplay: return @"SB_ACTION_DISPLAY";+ case SBSegmentActionSkipTo: return @"SB_ACTION_SKIP_TO";+ default: return @"SB_ACTION_DISABLE";+ }+}++// One toggle row: the defaults key it controls and its localized title/description+// keys. This is the single source of truth for the toggle section — the row count,+// each cell's contents, and the value written on change all read from it, so a row+// can never display one setting while toggling another.+@interface SBToggleRow : NSObject+@property (nonatomic, copy) NSString *key;+@property (nonatomic, copy) NSString *titleKey;+@property (nonatomic, copy) NSString *descKey;+@end+@implementation SBToggleRow++ (instancetype)key:(NSString *)key title:(NSString *)titleKey desc:(NSString *)descKey {+ SBToggleRow *row = [SBToggleRow new];+ row.key = key; row.titleKey = titleKey; row.descKey = descKey;+ return row;+}+@end++static NSArray<SBToggleRow *> *sbToggleRows() {+ return @[+ [SBToggleRow key:SBEnabled title:@"SB_ENABLE" desc:@"SB_ENABLE_DESC"],+ [SBToggleRow key:SBShowButton title:@"SB_SHOW_BUTTON" desc:@"SB_SHOW_BUTTON_DESC"],+ [SBToggleRow key:SBShowNotifications title:@"SB_SHOW_NOTIFICATIONS" desc:@"SB_SHOW_NOTIFICATIONS_DESC"],+ [SBToggleRow key:SBSegmentsInPlayer title:@"SB_SEGMENTS_IN_PLAYER" desc:@"SB_SEGMENTS_IN_PLAYER_DESC"],+ [SBToggleRow key:SBSegmentsInFeed title:@"SB_SEGMENTS_IN_FEED" desc:@"SB_SEGMENTS_IN_FEED_DESC"],+ [SBToggleRow key:SBSegmentsInMiniPlayer title:@"SB_SEGMENTS_IN_MINIPLAYER" desc:@"SB_SEGMENTS_IN_MINIPLAYER_DESC"],+ [SBToggleRow key:SBAudioNotification title:@"SB_HAPTIC_FEEDBACK" desc:@"SB_HAPTIC_FEEDBACK_DESC"],+ [SBToggleRow key:SBShowDuration title:@"SB_SHOW_DURATION" desc:@"SB_SHOW_DURATION_DESC"],+ ];+}++static NSString *SBActionName(NSInteger action) {+ return LOC(SBActionLocKey((SBSegmentAction)action));+}++static NSString *SBHexFromColor(UIColor *color) {+ CGFloat r, g, b, a;+ [color getRed:&r green:&g blue:&b alpha:&a];+ return [NSString stringWithFormat:@"#%02X%02X%02X", (int)(r * 255), (int)(g * 255), (int)(b * 255)];+}++#pragma mark - Color Circle View (filled center + rainbow ring)++@interface SBColorCircleView : UIView+@property (nonatomic, strong) UIColor *fillColor;+@end++@implementation SBColorCircleView++- (instancetype)initWithFrame:(CGRect)frame color:(UIColor *)color {+ self = [super initWithFrame:frame];+ if (self) {+ self.fillColor = color;+ self.backgroundColor = [UIColor clearColor];+ }+ return self;+}++- (void)drawRect:(CGRect)rect {+ CGContextRef ctx = UIGraphicsGetCurrentContext();+ CGFloat size = MIN(rect.size.width, rect.size.height);+ CGRect square = CGRectMake((rect.size.width - size) / 2, (rect.size.height - size) / 2, size, size);+ CGFloat cx = CGRectGetMidX(square), cy = CGRectGetMidY(square);+ CGFloat ringWidth = 3.0;+ CGFloat radius = (size - ringWidth) / 2.0;++ // Draw rainbow ring by stroking arc segments at varying hues+ NSInteger segments = 64;+ CGFloat anglePerSegment = (2.0 * M_PI) / segments;+ for (NSInteger i = 0; i < segments; i++) {+ CGFloat startAngle = i * anglePerSegment - M_PI_2;+ CGFloat endAngle = startAngle + anglePerSegment + 0.02; // slight overlap to avoid gaps+ CGFloat hue = (CGFloat)i / segments;+ UIColor *color = [UIColor colorWithHue:hue saturation:1.0 brightness:1.0 alpha:1.0];+ CGContextSetStrokeColorWithColor(ctx, color.CGColor);+ CGContextSetLineWidth(ctx, ringWidth);+ CGContextAddArc(ctx, cx, cy, radius, startAngle, endAngle, 0);+ CGContextStrokePath(ctx);+ }++ // Filled center circle+ CGRect innerRect = CGRectInset(square, ringWidth + 2, ringWidth + 2);+ UIBezierPath *innerPath = [UIBezierPath bezierPathWithOvalInRect:innerRect];+ [self.fillColor setFill];+ [innerPath fill];+}++- (void)setFillColor:(UIColor *)fillColor {+ _fillColor = fillColor;+ [self setNeedsDisplay];+}++@end++#pragma mark - SBSettingsViewController++@interface SBSettingsViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, UIColorPickerViewControllerDelegate, UISearchBarDelegate>+- (UITableView *)tableView;+- (void)setTableView:(UITableView *)tv;+- (UISearchBar *)searchBar;+- (void)setSearchBar:(UISearchBar *)sb;+- (NSString *)activeColorKey;+- (void)setActiveColorKey:(NSString *)key;+- (NSIndexPath *)activeColorIndexPath;+- (void)setActiveColorIndexPath:(NSIndexPath *)ip;+- (UIColor *)sbTextColor;+- (UIColor *)sbSecondaryTextColor;+- (void)updateSearchBarTheme;+// Cell builders, also reused by the global settings search (sbSearchRows).+- (UITableViewCell *)toggleCellForRow:(NSInteger)row tableView:(UITableView *)tableView;+- (UITableViewCell *)sliderCellForRow:(NSInteger)row tableView:(UITableView *)tableView;+- (UITableViewCell *)actionCellForCategory:(NSString *)category name:(NSString *)catName tableView:(UITableView *)tableView;+- (UITableViewCell *)colorCellForCategory:(NSString *)category name:(NSString *)catName tableView:(UITableView *)tableView;+@end++// Flat list of all SB settings as search rows (declared before use by the per-page+// filter below; defined in the Settings Search section).+extern NSArray<YMSearchRow *> *sbFlatRowsWithRenderer(SBSettingsViewController *renderer);++static const void *kSBTableViewKey = &kSBTableViewKey;+static const void *kSBSearchBarKey = &kSBSearchBarKey;+static const void *kSBColorKeyKey = &kSBColorKeyKey;+static const void *kSBColorIndexPathKey = &kSBColorIndexPathKey;+static const void *kSBPageFilterKey = &kSBPageFilterKey;+static const void *kSBAllFlatRowsKey = &kSBAllFlatRowsKey;++@implementation SBSettingsViewController++- (UITableView *)tableView { return objc_getAssociatedObject(self, kSBTableViewKey); }+- (void)setTableView:(UITableView *)tv { objc_setAssociatedObject(self, kSBTableViewKey, tv, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }+- (UISearchBar *)searchBar { return objc_getAssociatedObject(self, kSBSearchBarKey); }+- (void)setSearchBar:(UISearchBar *)sb { objc_setAssociatedObject(self, kSBSearchBarKey, sb, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }+- (NSString *)activeColorKey { return objc_getAssociatedObject(self, kSBColorKeyKey); }+- (void)setActiveColorKey:(NSString *)key { objc_setAssociatedObject(self, kSBColorKeyKey, key, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }+- (NSIndexPath *)activeColorIndexPath { return objc_getAssociatedObject(self, kSBColorIndexPathKey); }+- (void)setActiveColorIndexPath:(NSIndexPath *)ip { objc_setAssociatedObject(self, kSBColorIndexPathKey, ip, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }++// Per-page search state. pageFilter is the active query (nil/empty = not filtering);+// while filtering, the page collapses to one flat section of matching search rows.+- (NSString *)pageFilter { return objc_getAssociatedObject(self, kSBPageFilterKey); }+- (void)setPageFilter:(NSString *)f { objc_setAssociatedObject(self, kSBPageFilterKey, f, OBJC_ASSOCIATION_COPY_NONATOMIC); }+- (NSArray<YMSearchRow *> *)allFlatRows { return objc_getAssociatedObject(self, kSBAllFlatRowsKey); }+- (void)setAllFlatRows:(NSArray<YMSearchRow *> *)r { objc_setAssociatedObject(self, kSBAllFlatRowsKey, r, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }++- (BOOL)isFiltering { return self.pageFilter.length > 0; }++- (NSArray<YMSearchRow *> *)filteredFlatRows {+ NSString *q = self.pageFilter;+ if (q.length == 0) return @[];+ NSMutableArray<YMSearchRow *> *matches = [NSMutableArray array];+ NSStringCompareOptions opts = NSCaseInsensitiveSearch | NSDiacriticInsensitiveSearch;+ for (YMSearchRow *row in self.allFlatRows) {+ if ([row.searchText rangeOfString:q options:opts].location != NSNotFound) [matches addObject:row];+ }+ return matches;+}++- (void)updateSearchBarTheme {+ UISearchBar *sb = self.searchBar;+ if (!sb) return;+ UIColor *bgColor = (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark)+ ? [%c(YTColor) black3]+ : [UIColor systemBackgroundColor];+ sb.backgroundColor = bgColor;+ sb.barTintColor = bgColor;+ if ([sb respondsToSelector:@selector(searchTextField)]) {+ UITextField *tf = sb.searchTextField;+ if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {+ tf.textColor = [UIColor whiteColor];+ tf.backgroundColor = [UIColor colorWithWhite:0.15 alpha:1.0];+ } else {+ tf.textColor = [UIColor labelColor];+ tf.backgroundColor = [UIColor colorWithWhite:0.94 alpha:1.0];+ }+ }+}++- (void)viewDidLoad {+ Class ytStyled = objc_getClass("YTStyledViewController");+ struct objc_super superStruct = { self, ytStyled ?: [UIViewController class] };+ ((void (*)(struct objc_super *, SEL))objc_msgSendSuper)(&superStruct, @selector(viewDidLoad));++ self.title = @"SponsorBlock";++ UIColor *bgColor = (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark)+ ? [%c(YTColor) black3]+ : [UIColor systemBackgroundColor];++ self.view.backgroundColor = bgColor;++ self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];+ self.tableView.translatesAutoresizingMaskIntoConstraints = NO;+ self.tableView.delegate = self;+ self.tableView.dataSource = self;+ self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;+ self.tableView.estimatedRowHeight = 60;+ self.tableView.rowHeight = UITableViewAutomaticDimension;+ self.tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;+ self.tableView.backgroundColor = bgColor;++ [self.view addSubview:self.tableView];++ // Pinned per-page search bar that filters this page's own rows. The flat row+ // list is built once with self as the renderer (its cells write straight to+ // NSUserDefaults, so reusing the live VC is safe).+ self.allFlatRows = sbFlatRowsWithRenderer(self);+ UISearchBar *sb = [[UISearchBar alloc] initWithFrame:CGRectZero];+ sb.translatesAutoresizingMaskIntoConstraints = NO;+ sb.placeholder = LOC(@"SEARCH");+ sb.searchBarStyle = UISearchBarStyleMinimal;+ sb.tintColor = SBControlTintColor();+ sb.delegate = self;+ sb.backgroundImage = [[UIImage alloc] init];+ [self.view addSubview:sb];+ self.searchBar = sb;+ [self updateSearchBarTheme];++ [NSLayoutConstraint activateConstraints:@[+ [sb.topAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor],+ [sb.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor],+ [sb.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor],++ [self.tableView.topAnchor constraintEqualToAnchor:sb.bottomAnchor],+ [self.tableView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor],+ [self.tableView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor],+ [self.tableView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor]+ ]];+}++- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {+ [super traitCollectionDidChange:previousTraitCollection];+ if (previousTraitCollection.userInterfaceStyle != self.traitCollection.userInterfaceStyle) {+ UIColor *bgColor = (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark)+ ? [%c(YTColor) black3]+ : [UIColor systemBackgroundColor];+ self.view.backgroundColor = bgColor;+ self.tableView.backgroundColor = bgColor;+ [self updateSearchBarTheme];+ [self.tableView reloadData];+ }+}++#pragma mark - UISearchBarDelegate++- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {+ self.pageFilter = [searchText stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];+ [self.tableView reloadData];+}++- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar {+ [searchBar setShowsCancelButton:YES animated:YES];+}++- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar {+ [searchBar setShowsCancelButton:NO animated:YES];+}++- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {+ [searchBar resignFirstResponder];+}++- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {+ searchBar.text = @"";+ self.pageFilter = @"";+ [searchBar resignFirstResponder];+ [self.tableView reloadData];+}++- (void)viewWillAppear:(BOOL)animated {+ Class ytStyled = objc_getClass("YTStyledViewController");+ struct objc_super superStruct = { self, ytStyled ?: [UIViewController class] };+ ((void (*)(struct objc_super *, SEL, BOOL))objc_msgSendSuper)(&superStruct, @selector(viewWillAppear:), animated);+}++- (void)viewDidLayoutSubviews {+ Class ytStyled = objc_getClass("YTStyledViewController");+ struct objc_super superStruct = { self, ytStyled ?: [UIViewController class] };+ ((void (*)(struct objc_super *, SEL))objc_msgSendSuper)(&superStruct, @selector(viewDidLayoutSubviews));+ YTQTMButton *backButton = [self valueForKey:@"_backButton"];++ if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {+ backButton.tintColor = [UIColor whiteColor];+ } else {+ backButton.tintColor = [UIColor blackColor];+ }+}++- (UIColor *)navBarForegroundColor {+ if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {+ return [UIColor whiteColor];+ }+ // Light mode: return a concrete colour rather than nil. nil lets YouTube tint the+ // nav-bar foreground (back chevron + title) with its default appearance, which is+ // system blue in light mode. labelColor keeps it black in light / white in dark.+ return [UIColor labelColor];+}++- (UIColor *)sbTextColor {+ return (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark)+ ? [UIColor whiteColor] : [UIColor labelColor];+}++- (UIColor *)sbSecondaryTextColor {+ return [UIColor colorWithWhite:0.55 alpha:1.0];+}++#pragma mark - Sections: 0=Main, 1=Sliders, 2=Segments++- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {+ return self.isFiltering ? 1 : 3; // one flat section of matches while searching+}++- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {+ if (self.isFiltering) return self.filteredFlatRows.count;+ if (section == 0) return sbToggleRows().count; // toggles+ if (section == 1) return 3; // sliders (skip alert, unskip alert, min duration)+ return sbAllCategories().count * 2; // action + color per category+}++- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {+ if (self.isFiltering) return nil; // headers dropped in the flat filtered list+ NSString *title = nil;+ if (section == 0) title = LOC(@"SB_SECTION_MAIN");+ else if (section == 2) title = LOC(@"SB_CATEGORIES_HEADER");+ if (!title) return nil;++ UIView *header = [[UIView alloc] init];+ UILabel *label = [[UILabel alloc] init];+ label.text = title;+ // Match the main YouMod settings section headers (ymSecondaryColor / size 14).+ label.textColor = [UIColor colorWithWhite:0.55 alpha:1.0];+ label.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];+ label.translatesAutoresizingMaskIntoConstraints = NO;+ [header addSubview:label];+ [NSLayoutConstraint activateConstraints:@[+ [label.leadingAnchor constraintEqualToAnchor:header.leadingAnchor constant:16],+ [label.bottomAnchor constraintEqualToAnchor:header.bottomAnchor constant:-6],+ ]];+ return header;+}++- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {+ if (self.isFiltering) return 0;+ if (section == 1) return 16;+ return 36;+}++- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {+ if (self.isFiltering) {+ CGFloat h = self.filteredFlatRows[indexPath.row].cellHeight;+ return h > 0 ? h : UITableViewAutomaticDimension;+ }+ if (indexPath.section == 1) return 70;+ if (indexPath.section == 2) {+ BOOL isActionRow = (indexPath.row % 2 == 0);+ NSInteger catIndex = indexPath.row / 2;+ if (isActionRow && catIndex > 0) return 64; // extra top spacing between groups+ return 48;+ }+ return UITableViewAutomaticDimension;+}++- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {+ if (self.isFiltering) return self.filteredFlatRows[indexPath.row].makeCell(tableView);+ if (indexPath.section == 0) return [self toggleCellForRow:indexPath.row tableView:tableView];+ if (indexPath.section == 1) return [self sliderCellForRow:indexPath.row tableView:tableView];+ return [self segmentCellForRow:indexPath.row tableView:tableView];+}++#pragma mark - Toggle Cells (Section 0)++- (UITableViewCell *)toggleCellForRow:(NSInteger)row tableView:(UITableView *)tableView {+ UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:nil];+ cell.backgroundColor = [UIColor clearColor];+ cell.selectionStyle = UITableViewCellSelectionStyleNone;+ cell.textLabel.textColor = [self sbTextColor];+ cell.textLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];+ cell.detailTextLabel.textColor = [self sbSecondaryTextColor];+ cell.detailTextLabel.font = [UIFont systemFontOfSize:13];+ cell.detailTextLabel.numberOfLines = 0;++ SBToggleRow *def = sbToggleRows()[row];++ cell.textLabel.text = LOC(def.titleKey);+ cell.detailTextLabel.text = LOC(def.descKey);++ UISwitch *sw = [[UISwitch alloc] init];+ sw.on = [[NSUserDefaults standardUserDefaults] boolForKey:def.key];+ sw.onTintColor = SBControlTintColor();+ sw.tag = row;+ [sw addTarget:self action:@selector(toggleChanged:) forControlEvents:UIControlEventValueChanged];+ cell.accessoryView = sw;++ return cell;+}++- (void)toggleChanged:(UISwitch *)sender {+ NSArray<SBToggleRow *> *rows = sbToggleRows();+ if (sender.tag < 0 || sender.tag >= (NSInteger)rows.count) return;+ NSString *key = rows[sender.tag].key;+ [[NSUserDefaults standardUserDefaults] setBool:sender.on forKey:key];+}++#pragma mark - Slider Cells (Section 1)++- (UITableViewCell *)sliderCellForRow:(NSInteger)row tableView:(UITableView *)tableView {+ UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];+ cell.backgroundColor = [UIColor clearColor];+ cell.selectionStyle = UITableViewCellSelectionStyleNone;++ NSString *title;+ NSString *key;+ float minVal = SBAlertDurationMin;+ float maxVal = SBAlertDurationMax;+ float currentVal = 0;++ if (row == 0) {+ title = LOC(@"SB_SKIP_ALERT_DURATION");+ key = SBSkipAlertDuration;+ currentVal = [[NSUserDefaults standardUserDefaults] floatForKey:key];+ if (currentVal <= 0) currentVal = SBAlertDurationDefault;+ } else if (row == 1) {+ title = LOC(@"SB_UNSKIP_ALERT_DURATION");+ key = SBUnskipAlertDuration;+ currentVal = [[NSUserDefaults standardUserDefaults] floatForKey:key];+ if (currentVal <= 0) currentVal = SBAlertDurationDefault;+ } else {+ title = LOC(@"SB_MIN_DURATION_SLIDER");+ key = SBMinDuration;+ minVal = 0.0;+ maxVal = 60.0;+ currentVal = [[NSUserDefaults standardUserDefaults] floatForKey:key];+ }++ UILabel *titleLabel = [[UILabel alloc] init];+ titleLabel.text = title;+ titleLabel.textColor = [self sbSecondaryTextColor];+ titleLabel.font = [UIFont systemFontOfSize:13];+ titleLabel.translatesAutoresizingMaskIntoConstraints = NO;++ UISlider *slider = [[UISlider alloc] init];+ slider.minimumValue = minVal;+ slider.maximumValue = maxVal;+ slider.value = currentVal;+ slider.minimumTrackTintColor = SBControlTintColor();+ slider.maximumTrackTintColor = [UIColor colorWithWhite:0.3 alpha:1.0];+ slider.translatesAutoresizingMaskIntoConstraints = NO;+ slider.tag = row;+ [slider addTarget:self action:@selector(sliderChanged:) forControlEvents:UIControlEventValueChanged];++ UILabel *valueLabel = [[UILabel alloc] init];+ NSDateComponentsFormatter *formatter = [[NSDateComponentsFormatter alloc] init];+ formatter.allowedUnits = NSCalendarUnitSecond;+ formatter.unitsStyle = NSDateComponentsFormatterUnitsStyleAbbreviated;++ valueLabel.text = [formatter stringFromTimeInterval:currentVal];+ valueLabel.textColor = [self sbSecondaryTextColor];+ valueLabel.font = [UIFont systemFontOfSize:13];+ valueLabel.textAlignment = NSTextAlignmentRight;+ valueLabel.translatesAutoresizingMaskIntoConstraints = NO;+ valueLabel.tag = SBSliderValueLabelTagBase + row;++ [cell.contentView addSubview:titleLabel];+ [cell.contentView addSubview:slider];+ [cell.contentView addSubview:valueLabel];++ [NSLayoutConstraint activateConstraints:@[+ [titleLabel.topAnchor constraintEqualToAnchor:cell.contentView.topAnchor constant:8],+ [titleLabel.leadingAnchor constraintEqualToAnchor:cell.contentView.leadingAnchor constant:16],++ [slider.topAnchor constraintEqualToAnchor:titleLabel.bottomAnchor constant:8],+ [slider.leadingAnchor constraintEqualToAnchor:cell.contentView.leadingAnchor constant:16],+ [slider.trailingAnchor constraintEqualToAnchor:valueLabel.leadingAnchor constant:-8],+ [slider.bottomAnchor constraintEqualToAnchor:cell.contentView.bottomAnchor constant:-8],++ [valueLabel.centerYAnchor constraintEqualToAnchor:slider.centerYAnchor],+ [valueLabel.trailingAnchor constraintEqualToAnchor:cell.contentView.trailingAnchor constant:-16],+ [valueLabel.widthAnchor constraintEqualToConstant:50],+ ]];++ return cell;+}++- (void)sliderChanged:(UISlider *)sender {+ NSString *key;+ if (sender.tag == 0) key = SBSkipAlertDuration;+ else if (sender.tag == 1) key = SBUnskipAlertDuration;+ else key = SBMinDuration;++ int rounded = (int)roundf(sender.value);+ sender.value = rounded;+ [[NSUserDefaults standardUserDefaults] setFloat:(float)rounded forKey:key];+ [[NSUserDefaults standardUserDefaults] synchronize];++ UILabel *valueLabel = (UILabel *)[sender.superview viewWithTag:SBSliderValueLabelTagBase + sender.tag];+ NSDateComponentsFormatter *formatter = [[NSDateComponentsFormatter alloc] init];+ formatter.allowedUnits = NSCalendarUnitSecond;+ formatter.unitsStyle = NSDateComponentsFormatterUnitsStyleAbbreviated;++ valueLabel.text = [formatter stringFromTimeInterval:rounded];+}++#pragma mark - Segment Cells (Section 2)++- (UITableViewCell *)segmentCellForRow:(NSInteger)row tableView:(UITableView *)tableView {+ NSInteger catIndex = row / 2;+ BOOL isColorRow = (row % 2 == 1);+ NSString *category = sbAllCategories()[catIndex];+ NSBundle *bundle = YouModBundle();+ NSString *catLocKey = [NSString stringWithFormat:@"SB_CAT_%@", category];+ NSString *catName = [bundle localizedStringForKey:catLocKey value:category table:nil];++ if (isColorRow) {+ return [self colorCellForCategory:category name:catName tableView:tableView];+ } else {+ return [self actionCellForCategory:category name:catName tableView:tableView];+ }+}++- (void)updateSBActionButton:(UIButton *)menuButton category:(NSString *)category catName:(NSString *)catName {+ BOOL isHighlight = [category isEqualToString:@"poi_highlight"];+ NSString *actionKey = SB_ACTION_KEY(category);+ NSInteger currentAction = [[NSUserDefaults standardUserDefaults] integerForKey:actionKey];+ NSString *currentTitle = SBActionName(currentAction);++ if (@available(iOS 15.0, *)) {+ UIButtonConfiguration *config = [UIButtonConfiguration plainButtonConfiguration];+ config.title = currentTitle;+ config.image = [UIImage systemImageNamed:@"chevron.up.chevron.down" withConfiguration:[UIImageSymbolConfiguration configurationWithPointSize:11 weight:UIImageSymbolWeightMedium]];+ config.imagePlacement = NSDirectionalRectEdgeTrailing;+ config.imagePadding = 6.0;+ config.baseForegroundColor = [self sbSecondaryTextColor];+ config.contentInsets = NSDirectionalEdgeInsetsMake(6, 8, 6, 8);+ menuButton.configuration = config;+ } else {+ [menuButton setTitle:currentTitle forState:UIControlStateNormal];+ [menuButton setTitleColor:[self sbSecondaryTextColor] forState:UIControlStateNormal];+ menuButton.titleLabel.font = [UIFont systemFontOfSize:15];+ [menuButton setImage:[UIImage systemImageNamed:@"chevron.up.chevron.down"] forState:UIControlStateNormal];+ menuButton.tintColor = [self sbSecondaryTextColor];+ menuButton.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;+ menuButton.imageEdgeInsets = UIEdgeInsetsMake(0, 6, 0, -6);+ }++ NSArray<NSNumber *> *actionOptions;+ if (isHighlight) {+ actionOptions = @[@(SBSegmentActionDisable), @(SBSegmentActionSkipTo), @(SBSegmentActionAsk), @(SBSegmentActionDisplay)];+ } else {+ actionOptions = @[@(SBSegmentActionDisable), @(SBSegmentActionAutoSkip), @(SBSegmentActionAsk), @(SBSegmentActionDisplay)];+ }++ NSMutableArray<UIMenuElement *> *menuActions = [NSMutableArray array];+ NSBundle *bundle = YouModBundle();+ __weak typeof(self) weakSelf = self;+ __weak typeof(menuButton) weakButton = menuButton;+ for (NSNumber *option in actionOptions) {+ NSInteger actionVal = [option integerValue];+ NSString *actionTitle = [bundle localizedStringForKey:SBActionLocKey((SBSegmentAction)actionVal) value:nil table:nil];++ UIAction *action = [UIAction actionWithTitle:actionTitle image:nil identifier:nil handler:^(__kindof UIAction *a) {+ [[NSUserDefaults standardUserDefaults] setInteger:actionVal forKey:actionKey];+ if (weakButton) {+ [weakSelf updateSBActionButton:weakButton category:category catName:catName];+ }+ }];+ action.state = (actionVal == currentAction) ? UIMenuElementStateOn : UIMenuElementStateOff;+ [menuActions addObject:action];+ }++ menuButton.menu = [UIMenu menuWithTitle:catName ?: @"" children:menuActions];+}++- (UITableViewCell *)actionCellForCategory:(NSString *)category name:(NSString *)catName tableView:(UITableView *)tableView {+ UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];+ cell.backgroundColor = [UIColor clearColor];+ cell.selectionStyle = UITableViewCellSelectionStyleNone;++ UILabel *titleLabel = [[UILabel alloc] init];+ titleLabel.text = catName;+ titleLabel.textColor = [self sbTextColor];+ titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];+ titleLabel.translatesAutoresizingMaskIntoConstraints = NO;+ [cell.contentView addSubview:titleLabel];++ UIButton *menuButton = [UIButton buttonWithType:UIButtonTypeSystem];+ menuButton.translatesAutoresizingMaskIntoConstraints = NO;+ menuButton.showsMenuAsPrimaryAction = YES;+ [menuButton setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];+ [menuButton setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];+ [cell.contentView addSubview:menuButton];++ [self updateSBActionButton:menuButton category:category catName:catName];++ [NSLayoutConstraint activateConstraints:@[+ [titleLabel.leadingAnchor constraintEqualToAnchor:cell.contentView.leadingAnchor constant:16],+ [titleLabel.centerYAnchor constraintEqualToAnchor:cell.contentView.centerYAnchor],+ [titleLabel.topAnchor constraintGreaterThanOrEqualToAnchor:cell.contentView.topAnchor constant:12],+ [titleLabel.bottomAnchor constraintLessThanOrEqualToAnchor:cell.contentView.bottomAnchor constant:-12],++ [menuButton.leadingAnchor constraintGreaterThanOrEqualToAnchor:titleLabel.trailingAnchor constant:12],+ [menuButton.trailingAnchor constraintEqualToAnchor:cell.contentView.trailingAnchor constant:-16],+ [menuButton.centerYAnchor constraintEqualToAnchor:cell.contentView.centerYAnchor],+ [menuButton.topAnchor constraintGreaterThanOrEqualToAnchor:cell.contentView.topAnchor constant:8],+ [menuButton.bottomAnchor constraintLessThanOrEqualToAnchor:cell.contentView.bottomAnchor constant:-8]+ ]];++ return cell;+}++- (UITableViewCell *)colorCellForCategory:(NSString *)category name:(NSString *)catName tableView:(UITableView *)tableView {+ UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];+ cell.backgroundColor = [UIColor clearColor];+ cell.selectionStyle = UITableViewCellSelectionStyleNone;+ cell.textLabel.text = [NSString stringWithFormat:@"%@ %@", catName, LOC(@"SB_SEGMENT_COLOR_SUFFIX")];+ cell.textLabel.textColor = [self sbTextColor];+ cell.textLabel.font = [UIFont systemFontOfSize:15];++ NSString *colorKey = SB_COLOR_KEY(category);+ NSString *hex = [[NSUserDefaults standardUserDefaults] stringForKey:colorKey];+ UIColor *color = SBColorFromHex(hex);++ SBColorCircleView *circle = [[SBColorCircleView alloc] initWithFrame:CGRectMake(0, 0, 34, 34) color:color];+ cell.accessoryView = circle;++ return cell;+}++- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {+ if (self.isFiltering) {+ // In the flat filtered list the row carries its own tap handler (colour rows+ // open the picker); route through it with a reload that refreshes results.+ YMSearchRow *row = self.filteredFlatRows[indexPath.row];+ [tableView deselectRowAtIndexPath:indexPath animated:YES];+ __weak typeof(self) weakSelf = self;+ if (row.onSelect) row.onSelect(self, ^{ [weakSelf.tableView reloadData]; });+ return;+ }+ if (indexPath.section != 2) return;+ if (indexPath.row % 2 != 1) return; // only color rows are tappable++ NSInteger catIndex = indexPath.row / 2;+ NSString *category = sbAllCategories()[catIndex];+ NSString *colorKey = SB_COLOR_KEY(category);++ self.activeColorKey = colorKey;+ self.activeColorIndexPath = indexPath;++ UIColorPickerViewController *picker = [[UIColorPickerViewController alloc] init];+ NSString *catName = [YouModBundle() localizedStringForKey:[NSString stringWithFormat:@"SB_CAT_%@", category] value:category table:nil];+ picker.title = [NSString stringWithFormat:@"%@ %@", catName, LOC(@"SB_SEGMENT_COLOR_SUFFIX")];+ NSString *currentHex = [[NSUserDefaults standardUserDefaults] stringForKey:colorKey];+ if (currentHex) picker.selectedColor = SBColorFromHex(currentHex);+ picker.supportsAlpha = NO;+ picker.delegate = self;++ [self presentViewController:picker animated:YES completion:nil];+}++#pragma mark - UIColorPickerViewControllerDelegate++- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController {+ UIColor *color = viewController.selectedColor;+ NSString *hex = SBHexFromColor(color);+ [[NSUserDefaults standardUserDefaults] setObject:hex forKey:self.activeColorKey];+ [self.tableView reloadRowsAtIndexPaths:@[self.activeColorIndexPath] withRowAnimation:UITableViewRowAnimationFade];+}++- (void)colorPickerViewController:(UIColorPickerViewController *)viewController didSelectColor:(UIColor *)color continuously:(BOOL)continuously {+ if (!continuously) {+ NSString *hex = SBHexFromColor(color);+ [[NSUserDefaults standardUserDefaults] setObject:hex forKey:self.activeColorKey];+ [self.tableView reloadRowsAtIndexPaths:@[self.activeColorIndexPath] withRowAnimation:UITableViewRowAnimationFade];+ }+}++#pragma mark - Footer spacing between category groups++- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {+ return (section == 2) ? 0 : 16;+}++- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {+ return [[UIView alloc] init];+}++@end++#pragma mark - Settings Search integration++// Retained delegate for a colour picker opened from a search result. The stock+// SBSettingsViewController colour flow reloads a specific SB-table index path,+// which doesn't exist in the search results table; this dedicated delegate writes+// the chosen colour and calls the search table's own reload instead. It is+// associated with the presented picker so it lives exactly as long as the picker.+@interface SBSearchColorDelegate : NSObject <UIColorPickerViewControllerDelegate>+@property (nonatomic, copy) NSString *colorKey;+@property (nonatomic, copy) void (^reload)(void);+@end+@implementation SBSearchColorDelegate+- (void)applyColor:(UIColor *)color {+ [[NSUserDefaults standardUserDefaults] setObject:SBHexFromColor(color) forKey:self.colorKey];+ if (self.reload) self.reload();+}+- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)vc { [self applyColor:vc.selectedColor]; }+- (void)colorPickerViewController:(UIColorPickerViewController *)vc didSelectColor:(UIColor *)color continuously:(BOOL)continuously {+ if (!continuously) [self applyColor:color];+}+@end++static const void *kSBSearchColorDelegateKey = &kSBSearchColorDelegateKey;++// Build the flat list of every SponsorBlock setting as YMSearchRows, each rendered+// by the given SBSettingsViewController's own cell builders. Shared by the global+// settings search (via sbSearchRows) and SponsorBlock's own per-page search filter.+NSArray<YMSearchRow *> *sbFlatRowsWithRenderer(SBSettingsViewController *renderer) {+ NSMutableArray<YMSearchRow *> *rows = [NSMutableArray array];+ // Weak so a row's makeCell block can't retain the renderer: on the SponsorBlock+ // page the renderer IS the presented VC, which also retains this row list, so a+ // strong capture would cycle and leak the VC on every visit. The renderer always+ // outlives cell rendering (it's the live VC or a retained child), so weak is safe.+ __weak SBSettingsViewController *renderer_w = renderer;++ // Section 0 — toggles.+ NSArray<SBToggleRow *> *toggles = sbToggleRows();+ for (NSInteger i = 0; i < (NSInteger)toggles.count; i++) {+ SBToggleRow *def = toggles[i];+ YMSearchRow *row = [YMSearchRow new];+ row.searchText = [NSString stringWithFormat:@"%@ %@", LOC(def.titleKey), LOC(def.descKey)];+ row.makeCell = ^UITableViewCell *(UITableView *tv) { return [renderer_w toggleCellForRow:i tableView:tv]; };+ [rows addObject:row];+ }++ // Section 1 — the alert-duration sliders & min duration slider.+ for (NSInteger i = 0; i < 3; i++) {+ YMSearchRow *row = [YMSearchRow new];+ if (i == 0) row.searchText = LOC(@"SB_SKIP_ALERT_DURATION");+ else if (i == 1) row.searchText = LOC(@"SB_UNSKIP_ALERT_DURATION");+ else row.searchText = LOC(@"SB_MIN_DURATION_SLIDER");+ row.cellHeight = 70;+ row.makeCell = ^UITableViewCell *(UITableView *tv) { return [renderer_w sliderCellForRow:i tableView:tv]; };+ [rows addObject:row];+ }++ // Section 2 — per category: an action picker and a colour circle.+ NSBundle *bundle = YouModBundle();+ for (NSString *category in sbAllCategories()) {+ NSString *catName = [bundle localizedStringForKey:[NSString stringWithFormat:@"SB_CAT_%@", category] value:category table:nil];++ YMSearchRow *actionRow = [YMSearchRow new];+ actionRow.searchText = catName;+ actionRow.cellHeight = 48;+ actionRow.makeCell = ^UITableViewCell *(UITableView *tv) { return [renderer_w actionCellForCategory:category name:catName tableView:tv]; };+ [rows addObject:actionRow];++ YMSearchRow *colorRow = [YMSearchRow new];+ colorRow.searchText = [NSString stringWithFormat:@"%@ %@", catName, LOC(@"SB_SEGMENT_COLOR_SUFFIX")];+ colorRow.cellHeight = 48;+ colorRow.makeCell = ^UITableViewCell *(UITableView *tv) { return [renderer_w colorCellForCategory:category name:catName tableView:tv]; };+ colorRow.onSelect = ^(UIViewController *presenter, void (^reload)(void)) {+ NSString *colorKey = SB_COLOR_KEY(category);+ UIColorPickerViewController *picker = [[UIColorPickerViewController alloc] init];+ picker.title = [NSString stringWithFormat:@"%@ %@", catName, LOC(@"SB_SEGMENT_COLOR_SUFFIX")];+ NSString *currentHex = [[NSUserDefaults standardUserDefaults] stringForKey:colorKey];+ if (currentHex) picker.selectedColor = SBColorFromHex(currentHex);+ picker.supportsAlpha = NO;++ SBSearchColorDelegate *delegate = [SBSearchColorDelegate new];+ delegate.colorKey = colorKey;+ delegate.reload = reload;+ picker.delegate = delegate;+ objc_setAssociatedObject(picker, kSBSearchColorDelegateKey, delegate, OBJC_ASSOCIATION_RETAIN_NONATOMIC);++ [presenter presentViewController:picker animated:YES completion:nil];+ };+ [rows addObject:colorRow];+ }++ return rows;+}++NSArray<YMSearchRow *> *sbSearchRows(UIViewController *host) {+ // One renderer builds every SB result cell. It's added as a child VC so the+ // cells inherit the host's trait collection (light/dark), and its tableView is+ // pointed at the host's (search results) table so SB's own cell handlers —+ // e.g. the action picker's [self.tableView reloadData] — refresh the visible+ // results rather than a table the renderer never presents.+ SBSettingsViewController *renderer = [[SBSettingsViewController alloc] init];+ [host addChildViewController:renderer];+ [renderer didMoveToParentViewController:host];+ if ([host respondsToSelector:@selector(tableView)]) {+ renderer.tableView = ((UITableView *(*)(id, SEL))objc_msgSend)(host, @selector(tableView));+ }+ return sbFlatRowsWithRenderer(renderer);+}++#pragma mark - Hook entry point++@interface YTSettingsSectionItemManager (SponsorBlock)+- (void)updateSponsorBlockSectionWithEntry:(id)entry;+@end++%hook YTSettingsSectionItemManager++%new(v@:@)+- (void)updateSponsorBlockSectionWithEntry:(id)entry {+ YTSettingsViewController *settingsVC = [self valueForKey:@"_settingsViewControllerDelegate"];+ // Use runtime-registered subclass of YTStyledViewController for YouTube's nav styling+ Class sbClass = objc_getClass("SBSettingsViewControllerStyled");+ if (!sbClass) sbClass = [SBSettingsViewController class];+ // initWithParentResponder: sets up YouTube's DI container (gimme) for nav bar theming+ id allocated = [sbClass alloc];+ SBSettingsViewController *sbVC = (SBSettingsViewController *)((id (*)(id, SEL, id))objc_msgSend)(allocated, @selector(initWithParentResponder:), settingsVC);+ [settingsVC pushViewController:sbVC];+}++%end++%ctor {+ // Register SBSettingsViewControllerStyled as a runtime subclass of YTStyledViewController+ // with all methods from SBSettingsViewController — gives us YouTube's nav bar styling+ Class ytStyled = %c(YTStyledViewController);+ if (ytStyled) {+ Class sbStyled = objc_allocateClassPair(ytStyled, "SBSettingsViewControllerStyled", 0);+ if (sbStyled) {+ // Copy all instance methods from our compiled SBSettingsViewController+ unsigned int count = 0;+ Method *methods = class_copyMethodList([SBSettingsViewController class], &count);+ for (unsigned int i = 0; i < count; i++) {+ SEL sel = method_getName(methods[i]);+ IMP imp = method_getImplementation(methods[i]);+ const char *types = method_getTypeEncoding(methods[i]);+ class_addMethod(sbStyled, sel, imp, types);+ }+ free(methods);++ // Copy properties (for @synthesize ivars)+ unsigned int propCount = 0;+ objc_property_t *props = class_copyPropertyList([SBSettingsViewController class], &propCount);+ for (unsigned int i = 0; i < propCount; i++) {+ unsigned int attrCount = 0;+ objc_property_attribute_t *attrs = property_copyAttributeList(props[i], &attrCount);+ class_addProperty(sbStyled, property_getName(props[i]), attrs, attrCount);+ free(attrs);+ }+ free(props);++ // Copy ivars won't work after registration, but properties use associated objects+ objc_registerClassPair(sbStyled);+ }+ }++ // Per-category default action and seek-bar color. Sponsor is the only+ // category that auto-skips out of the box; the rest are disabled until the+ // user opts in. The action/color default entries are generated from+ // sbAllCategories() below so this table stays the sole per-category source.+ NSDictionary<NSString *, NSArray *> *categoryDefaults = @{+ @"sponsor": @[@(SBSegmentActionAutoSkip), @"#00D400"],+ @"intro": @[@(SBSegmentActionDisable), @"#00FFFF"],+ @"outro": @[@(SBSegmentActionDisable), @"#0202ED"],+ @"interaction": @[@(SBSegmentActionDisable), @"#FF00F7"],+ @"selfpromo": @[@(SBSegmentActionDisable), @"#FFFF00"],+ @"music_offtopic": @[@(SBSegmentActionDisable), @"#FF9900"],+ @"preview": @[@(SBSegmentActionDisable), @"#0084D6"],+ @"hook": @[@(SBSegmentActionDisable), @"#395699"],+ @"poi_highlight": @[@(SBSegmentActionDisable), @"#FF006A"],+ @"filler": @[@(SBSegmentActionDisable), @"#7300FF"],+ };++ NSMutableDictionary *defaults = [@{+ SBEnabled: @YES,+ SBShowButton: @YES,+ SBShowNotifications: @YES,+ SBSegmentsInPlayer: @YES,+ SBSegmentsInFeed: @YES,+ SBSegmentsInMiniPlayer: @YES,+ SBSkipAlertDuration: @(SBAlertDurationDefault),+ SBUnskipAlertDuration: @(SBAlertDurationDefault),+ } mutableCopy];++ for (NSString *category in sbAllCategories()) {+ NSArray *def = categoryDefaults[category];+ if (!def) continue;+ defaults[SB_ACTION_KEY(category)] = def[0];+ defaults[SB_COLOR_KEY(category)] = def[1];+ }++ [[NSUserDefaults standardUserDefaults] registerDefaults:defaults];+ %init;+}diff --git a/vendor/YouMod/Files/SponsorBlockUI.x b/vendor/YouMod/Files/SponsorBlockUI.xnew file mode 100644index 0000000..bc9262c--- /dev/null+++ b/vendor/YouMod/Files/SponsorBlockUI.x@@ -0,0 +1,950 @@+#import "Headers.h"+#import <objc/message.h>++extern BOOL useBackwardIconForButton;++// Range segments render as a filled bar at least this wide so very short segments+// stay visible. Point segments (poi_highlight) have no duration, so they render as+// a fixed-width tick centered on their position via the x-offset.+static const CGFloat SBMarkerMinWidth = 2.0;+static const CGFloat SBPoiMarkerWidth = 3.0;+static const CGFloat SBPoiMarkerXOffset = 1.5;++#pragma mark - SBSkipNotificationView Implementation++@implementation SBSkipNotificationView++- (instancetype)initWithFrame:(CGRect)frame {+ self = [super initWithFrame:frame];+ if (self) {+ [[NSNotificationCenter defaultCenter] addObserver:self+ selector:@selector(appDidEnterBackground)+ name:UIApplicationDidEnterBackgroundNotification+ object:nil];+ [[NSNotificationCenter defaultCenter] addObserver:self+ selector:@selector(appWillEnterForeground)+ name:UIApplicationWillEnterForegroundNotification+ object:nil];+ }+ return self;+}++- (void)dealloc {+ [[NSNotificationCenter defaultCenter] removeObserver:self];+}++- (void)appDidEnterBackground {+ if (!self.isPaused) {+ [self pauseProgress];+ self.backgroundDate = [NSDate date];+ }+}++- (void)appWillEnterForeground {+ if (self.backgroundDate) {+ NSTimeInterval timeInBackground = [[NSDate date] timeIntervalSinceDate:self.backgroundDate];+ self.remainingDuration -= timeInBackground;+ self.backgroundDate = nil;++ if (self.remainingDuration <= 0) {+ [self removeFromSuperview];+ return;+ } else {+ CGFloat newScaleX = self.remainingDuration / self.totalDuration;+ newScaleX = MAX(0.001, MIN(newScaleX, 1.0));+ self.progressOverlay.transform = CGAffineTransformMakeScale(newScaleX, 1.0);+ self.progressOverlay.alpha = newScaleX;+ }+ }+ [self resumeProgress];+}+++ (instancetype)showInView:(UIView *)parentView message:(NSString *)message buttonTitle:(NSString *)buttonTitle action:(void (^)(void))action duration:(NSTimeInterval)duration {+ if (!parentView) return nil;++ for (UIView *sub in [parentView.subviews copy]) {+ if ([sub isKindOfClass:[SBSkipNotificationView class]]) {+ SBSkipNotificationView *existing = (SBSkipNotificationView *)sub;+ if (existing.isHighlightPill) return nil;+ [existing dismiss];+ }+ }++ SBSkipNotificationView *view = [[SBSkipNotificationView alloc] initWithFrame:CGRectZero];+ view.translatesAutoresizingMaskIntoConstraints = NO;+ view.clipsToBounds = YES;+ view.layer.cornerRadius = 22.0;+ view.onAction = action;+ view.totalDuration = duration;+ view.remainingDuration = duration;+ view.isPaused = NO;++ // Base layer (revealed as progress depletes)+ view.backgroundColor = [UIColor colorWithWhite:0.08 alpha:1.0];++ // Progress overlay (shrinks from right to left)+ UIView *progressOverlay = [[UIView alloc] initWithFrame:CGRectZero];+ progressOverlay.translatesAutoresizingMaskIntoConstraints = YES;+ progressOverlay.backgroundColor = [UIColor colorWithWhite:0.18 alpha:1.0];+ progressOverlay.userInteractionEnabled = NO;+ progressOverlay.layer.anchorPoint = CGPointMake(0, 0.5);+ progressOverlay.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;+ view.progressOverlay = progressOverlay;+ [view addSubview:progressOverlay];++ // Message label+ UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];+ label.translatesAutoresizingMaskIntoConstraints = NO;+ label.text = message;+ label.textColor = [UIColor whiteColor];+ label.font = [UIFont systemFontOfSize:14.0 weight:UIFontWeightMedium];+ label.numberOfLines = 2;+ label.lineBreakMode = NSLineBreakByTruncatingTail;+ view.messageLabel = label;+ [view addSubview:label];++ // Icon button (right side)+ BOOL showButton = (buttonTitle != nil || action != nil);+ UIButton *button = nil;++ if (showButton) {+ button = [UIButton buttonWithType:UIButtonTypeCustom];+ button.translatesAutoresizingMaskIntoConstraints = NO;++ NSString *iconName = useBackwardIconForButton ? @"backward.fill" : @"forward.end.fill";+ UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:14 weight:UIImageSymbolWeightMedium];+ UIImage *icon = [UIImage systemImageNamed:iconName withConfiguration:config];+ [button setImage:icon forState:UIControlStateNormal];+ button.tintColor = [UIColor whiteColor];+ button.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.15];+ button.layer.cornerRadius = 16.0;+ button.clipsToBounds = YES;+ [button addTarget:view action:@selector(actionButtonTapped) forControlEvents:UIControlEventTouchUpInside];+ view.actionButton = button;+ [view addSubview:button];+ }++ [parentView addSubview:view];++ // Layout: centered horizontally, anchored above tab bar via safe area+ NSLayoutConstraint *maxWidth = [view.widthAnchor constraintLessThanOrEqualToAnchor:parentView.widthAnchor multiplier:0.85];+ [NSLayoutConstraint activateConstraints:@[+ [view.centerXAnchor constraintEqualToAnchor:parentView.centerXAnchor],+ [view.bottomAnchor constraintEqualToAnchor:parentView.safeAreaLayoutGuide.bottomAnchor constant:-60.0],+ [view.heightAnchor constraintEqualToConstant:44.0],+ maxWidth+ ]];++ // Internal layout+ if (showButton) {+ [NSLayoutConstraint activateConstraints:@[+ [label.leadingAnchor constraintEqualToAnchor:view.leadingAnchor constant:16.0],+ [label.centerYAnchor constraintEqualToAnchor:view.centerYAnchor],+ [label.trailingAnchor constraintEqualToAnchor:button.leadingAnchor constant:-10.0],++ [button.trailingAnchor constraintEqualToAnchor:view.trailingAnchor constant:-8.0],+ [button.centerYAnchor constraintEqualToAnchor:view.centerYAnchor],+ [button.widthAnchor constraintEqualToConstant:32.0],+ [button.heightAnchor constraintEqualToConstant:32.0]+ ]];+ } else {+ [NSLayoutConstraint activateConstraints:@[+ [label.leadingAnchor constraintEqualToAnchor:view.leadingAnchor constant:16.0],+ [label.centerYAnchor constraintEqualToAnchor:view.centerYAnchor],+ [label.trailingAnchor constraintEqualToAnchor:view.trailingAnchor constant:-40.0],+ ]];+ }++ // Pan gesture for interactive dismissal+ UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:view action:@selector(handlePan:)];+ [view addGestureRecognizer:pan];++ // Slide up from below+ view.transform = CGAffineTransformMakeTranslation(0, 60);+ view.alpha = 0.0;+ [UIView animateWithDuration:0.4 delay:0 usingSpringWithDamping:0.85 initialSpringVelocity:0.5 options:UIViewAnimationOptionCurveEaseOut animations:^{+ view.alpha = 1.0;+ view.transform = CGAffineTransformIdentity;+ } completion:^(BOOL finished) {+ if (finished && duration > 0) {+ [view startProgressAnimation];+ }+ }];++ return view;+}++- (void)layoutSubviews {+ [super layoutSubviews];+ if (self.progressOverlay.layer.animationKeys.count == 0 || self.isPaused) {+ self.progressOverlay.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height);+ }+}++- (void)startProgressAnimation {+ if (self.remainingDuration <= 0) return;++ self.progressOverlay.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height);++ [UIView animateWithDuration:self.remainingDuration delay:0 options:UIViewAnimationOptionCurveLinear animations:^{+ self.progressOverlay.transform = CGAffineTransformMakeScale(0.001, 1.0);+ self.progressOverlay.alpha = 0.0;+ } completion:^(BOOL finished) {+ if (finished && !self.isPaused && self.superview) {+ [self dismiss];+ }+ }];+}++- (void)pauseProgress {+ if (self.isPaused) return;+ self.isPaused = YES;++ CALayer *presentationLayer = self.progressOverlay.layer.presentationLayer;+ CGFloat currentScaleX = 1.0;+ if (presentationLayer) {+ CATransform3D t = presentationLayer.transform;+ currentScaleX = t.m11;+ }++ [self.progressOverlay.layer removeAllAnimations];+ currentScaleX = MAX(0.001, MIN(currentScaleX, 1.0));+ self.progressOverlay.transform = CGAffineTransformMakeScale(currentScaleX, 1.0);+ self.progressOverlay.alpha = currentScaleX;+ self.remainingDuration = self.totalDuration * currentScaleX;+}++- (void)resumeProgress {+ if (!self.isPaused) return;+ self.isPaused = NO;++ if (self.remainingDuration <= 0) {+ [self dismiss];+ return;+ }++ [UIView animateWithDuration:self.remainingDuration delay:0 options:UIViewAnimationOptionCurveLinear animations:^{+ self.progressOverlay.transform = CGAffineTransformMakeScale(0.001, 1.0);+ self.progressOverlay.alpha = 0.0;+ } completion:^(BOOL finished) {+ if (finished && !self.isPaused && self.superview) {+ [self dismiss];+ }+ }];+}++- (void)handlePan:(UIPanGestureRecognizer *)gesture {+ if (self.alpha < 1.0) {+ gesture.enabled = NO;+ gesture.enabled = YES;+ return;+ }++ CGPoint translation = [gesture translationInView:self.superview];+ CGPoint velocity = [gesture velocityInView:self.superview];++ switch (gesture.state) {+ case UIGestureRecognizerStateBegan:+ [self pauseProgress];+ break;++ case UIGestureRecognizerStateChanged:+ self.transform = CGAffineTransformMakeTranslation(0, translation.y);+ break;++ case UIGestureRecognizerStateEnded:+ case UIGestureRecognizerStateCancelled: {+ CGFloat distanceThreshold = 30.0;+ CGFloat velocityThreshold = 500.0;+ BOOL shouldDismiss = (fabs(translation.y) > distanceThreshold) || (fabs(velocity.y) > velocityThreshold);++ if (shouldDismiss) {+ CGFloat direction = (translation.y < 0) ? -1.0 : 1.0;+ [self dismissInDirection:direction velocity:fabs(velocity.y)];+ } else {+ // Snap back+ [UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.8 initialSpringVelocity:0.5 options:UIViewAnimationOptionBeginFromCurrentState animations:^{+ self.transform = CGAffineTransformIdentity;+ } completion:^(BOOL finished) {+ [self resumeProgress];+ }];+ }+ break;+ }+ default:+ break;+ }+}++- (void)dismissInDirection:(CGFloat)direction velocity:(CGFloat)velocity {+ CGFloat offscreenY = direction < 0 ? -(self.frame.size.height + 80) : (self.frame.size.height + 80);+ CGFloat animDuration = velocity > 500 ? 0.2 : 0.35;++ [UIView animateWithDuration:animDuration delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{+ self.transform = CGAffineTransformMakeTranslation(0, offscreenY);+ self.alpha = 0.0;+ } completion:^(BOOL finished) {+ [self removeFromSuperview];+ }];+}++- (void)actionButtonTapped {+ if (self.onAction) {+ self.onAction();+ }+ [self dismiss];+}++- (void)dismiss {+ [self.progressOverlay.layer removeAllAnimations];+ [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{+ self.transform = CGAffineTransformMakeTranslation(0, 60);+ self.alpha = 0.0;+ } completion:^(BOOL finished) {+ [self removeFromSuperview];+ }];+}+++ (instancetype)showSuccessInView:(UIView *)parentView message:(NSString *)message duration:(NSTimeInterval)duration {+ SBSkipNotificationView *view = [self showInView:parentView message:message buttonTitle:nil action:nil duration:duration];+ if (view) {+ UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:16 weight:UIImageSymbolWeightMedium];+ UIImageView *iconView = [[UIImageView alloc] initWithImage:[UIImage systemImageNamed:@"checkmark.circle.fill" withConfiguration:config]];+ iconView.tintColor = [UIColor systemGreenColor];+ iconView.translatesAutoresizingMaskIntoConstraints = NO;+ [view addSubview:iconView];+ [NSLayoutConstraint activateConstraints:@[+ [iconView.trailingAnchor constraintEqualToAnchor:view.trailingAnchor constant:-12.0],+ [iconView.centerYAnchor constraintEqualToAnchor:view.centerYAnchor],+ ]];+ }+ return view;+}+++ (instancetype)showErrorInView:(UIView *)parentView message:(NSString *)message duration:(NSTimeInterval)duration {+ SBSkipNotificationView *view = [self showInView:parentView message:message buttonTitle:nil action:nil duration:duration];+ if (view) {+ UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:16 weight:UIImageSymbolWeightMedium];+ UIImageView *iconView = [[UIImageView alloc] initWithImage:[UIImage systemImageNamed:@"xmark.circle.fill" withConfiguration:config]];+ iconView.tintColor = [UIColor systemRedColor];+ iconView.translatesAutoresizingMaskIntoConstraints = NO;+ [view addSubview:iconView];+ [NSLayoutConstraint activateConstraints:@[+ [iconView.trailingAnchor constraintEqualToAnchor:view.trailingAnchor constant:-12.0],+ [iconView.centerYAnchor constraintEqualToAnchor:view.centerYAnchor],+ ]];+ }+ return view;+}+++ (instancetype)showDownloadCompleteDialogInView:(UIView *)parentView message:(NSString *)message saveHandler:(void (^)(void))saveHandler shareHandler:(void (^)(void))shareHandler duration:(NSTimeInterval)duration {+ if (!parentView) return nil;++ for (UIView *sub in [parentView.subviews copy]) {+ if ([sub isKindOfClass:[SBSkipNotificationView class]]) {+ SBSkipNotificationView *existing = (SBSkipNotificationView *)sub;+ if (existing.isHighlightPill) return nil;+ [existing dismiss];+ }+ }++ SBSkipNotificationView *view = [[SBSkipNotificationView alloc] initWithFrame:CGRectZero];+ view.translatesAutoresizingMaskIntoConstraints = NO;+ view.clipsToBounds = YES;+ view.layer.cornerRadius = 22.0;+ view.totalDuration = duration;+ view.remainingDuration = duration;+ view.isPaused = NO;++ // Base layer (revealed as progress depletes)+ view.backgroundColor = [UIColor colorWithWhite:0.08 alpha:1.0];++ // Progress overlay (shrinks from right to left)+ UIView *progressOverlay = [[UIView alloc] initWithFrame:CGRectZero];+ progressOverlay.translatesAutoresizingMaskIntoConstraints = YES;+ progressOverlay.backgroundColor = [UIColor colorWithWhite:0.18 alpha:1.0];+ progressOverlay.userInteractionEnabled = NO;+ progressOverlay.layer.anchorPoint = CGPointMake(0, 0.5);+ progressOverlay.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;+ view.progressOverlay = progressOverlay;+ [view addSubview:progressOverlay];++ // Message label+ UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];+ label.translatesAutoresizingMaskIntoConstraints = NO;+ label.text = message;+ label.textColor = [UIColor whiteColor];+ label.font = [UIFont systemFontOfSize:14.0 weight:UIFontWeightMedium];+ label.numberOfLines = 1;+ label.lineBreakMode = NSLineBreakByTruncatingTail;+ view.messageLabel = label;+ [view addSubview:label];++ UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:14 weight:UIImageSymbolWeightMedium];++ // Save button (left of share button)+ UIButton *saveButton = [UIButton buttonWithType:UIButtonTypeCustom];+ saveButton.translatesAutoresizingMaskIntoConstraints = NO;+ UIImage *saveIcon = [UIImage systemImageNamed:@"square.and.arrow.down" withConfiguration:config];+ [saveButton setImage:saveIcon forState:UIControlStateNormal];+ saveButton.tintColor = [UIColor whiteColor];+ saveButton.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.15];+ saveButton.layer.cornerRadius = 16.0;+ saveButton.clipsToBounds = YES;+ __weak typeof(view) weakView = view;+ [saveButton addAction:[UIAction actionWithHandler:^(__kindof UIAction * _Nonnull action) {+ if (saveHandler) saveHandler();+ [weakView dismiss];+ }] forControlEvents:UIControlEventTouchUpInside];+ [view addSubview:saveButton];++ // Share button (rightmost) - Using arrowshape.turn.up.right+ UIButton *shareButton = [UIButton buttonWithType:UIButtonTypeCustom];+ shareButton.translatesAutoresizingMaskIntoConstraints = NO;+ UIImage *shareIcon = [UIImage systemImageNamed:@"arrowshape.turn.up.right" withConfiguration:config];+ [shareButton setImage:shareIcon forState:UIControlStateNormal];+ shareButton.tintColor = [UIColor whiteColor];+ shareButton.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.15];+ shareButton.layer.cornerRadius = 16.0;+ shareButton.clipsToBounds = YES;+ [shareButton addAction:[UIAction actionWithHandler:^(__kindof UIAction * _Nonnull action) {+ if (shareHandler) shareHandler();+ [weakView dismiss];+ }] forControlEvents:UIControlEventTouchUpInside];+ [view addSubview:shareButton];++ [parentView addSubview:view];++ // Layout: centered horizontally, anchored above tab bar via safe area+ NSLayoutConstraint *maxWidth = [view.widthAnchor constraintLessThanOrEqualToAnchor:parentView.widthAnchor multiplier:0.88];+ [NSLayoutConstraint activateConstraints:@[+ [view.centerXAnchor constraintEqualToAnchor:parentView.centerXAnchor],+ [view.bottomAnchor constraintEqualToAnchor:parentView.safeAreaLayoutGuide.bottomAnchor constant:-60.0],+ [view.heightAnchor constraintEqualToConstant:44.0],+ maxWidth+ ]];++ // Internal layout+ [NSLayoutConstraint activateConstraints:@[+ [label.leadingAnchor constraintEqualToAnchor:view.leadingAnchor constant:16.0],+ [label.centerYAnchor constraintEqualToAnchor:view.centerYAnchor],+ [label.trailingAnchor constraintEqualToAnchor:saveButton.leadingAnchor constant:-10.0],++ [saveButton.trailingAnchor constraintEqualToAnchor:shareButton.leadingAnchor constant:-8.0],+ [saveButton.centerYAnchor constraintEqualToAnchor:view.centerYAnchor],+ [saveButton.widthAnchor constraintEqualToConstant:32.0],+ [saveButton.heightAnchor constraintEqualToConstant:32.0],++ [shareButton.trailingAnchor constraintEqualToAnchor:view.trailingAnchor constant:-8.0],+ [shareButton.centerYAnchor constraintEqualToAnchor:view.centerYAnchor],+ [shareButton.widthAnchor constraintEqualToConstant:32.0],+ [shareButton.heightAnchor constraintEqualToConstant:32.0]+ ]];++ // Pan gesture for interactive dismissal+ UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:view action:@selector(handlePan:)];+ [view addGestureRecognizer:pan];++ // Slide up from below+ view.transform = CGAffineTransformMakeTranslation(0, 60);+ view.alpha = 0.0;+ [UIView animateWithDuration:0.4 delay:0 usingSpringWithDamping:0.85 initialSpringVelocity:0.5 options:UIViewAnimationOptionCurveEaseOut animations:^{+ view.alpha = 1.0;+ view.transform = CGAffineTransformIdentity;+ } completion:^(BOOL finished) {+ if (finished && duration > 0) {+ [view startProgressAnimation];+ }+ }];++ return view;+}++@end++#pragma mark - YMDownloadProgressView++@implementation YMDownloadProgressView+++ (instancetype)showInView:(UIView *)parentView message:(NSString *)message cancelAction:(void (^)(void))cancelAction {+ if (!parentView) return nil;++ // Dismiss any existing download progress pill+ for (UIView *sub in [parentView.subviews copy]) {+ if ([sub isKindOfClass:[YMDownloadProgressView class]]) {+ [(YMDownloadProgressView *)sub dismiss];+ }+ }++ YMDownloadProgressView *view = [[YMDownloadProgressView alloc] init];+ view.onCancel = cancelAction;+ view.translatesAutoresizingMaskIntoConstraints = NO;+ view.backgroundColor = [UIColor colorWithWhite:0.12 alpha:1.0];+ view.layer.cornerRadius = 16.0;+ view.clipsToBounds = YES;+ view.layer.borderWidth = 0.5;+ view.layer.borderColor = [UIColor colorWithWhite:0.25 alpha:1.0].CGColor;++ // Title label+ UILabel *titleLabel = [[UILabel alloc] init];+ titleLabel.text = message;+ titleLabel.textColor = [UIColor whiteColor];+ titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];+ titleLabel.translatesAutoresizingMaskIntoConstraints = NO;+ view.titleLabel = titleLabel;+ [view addSubview:titleLabel];++ // Subtitle label (speed + size)+ UILabel *subtitleLabel = [[UILabel alloc] init];+ subtitleLabel.text = @"";+ subtitleLabel.textColor = [UIColor colorWithWhite:0.55 alpha:1.0];+ subtitleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];+ subtitleLabel.translatesAutoresizingMaskIntoConstraints = NO;+ view.subtitleLabel = subtitleLabel;+ [view addSubview:subtitleLabel];++ // Progress bar+ UIProgressView *progressBar = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];+ progressBar.progress = 0.0;+ progressBar.trackTintColor = [UIColor colorWithWhite:0.22 alpha:1.0];+ progressBar.progressTintColor = [UIColor colorWithRed:0.6 green:0.2 blue:0.9 alpha:1.0];+ progressBar.translatesAutoresizingMaskIntoConstraints = NO;+ progressBar.layer.cornerRadius = 3.0;+ progressBar.clipsToBounds = YES;+ view.progressBar = progressBar;+ [view addSubview:progressBar];++ // Cancel button+ UIButton *cancelButton = [UIButton buttonWithType:UIButtonTypeSystem];+ UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:18 weight:UIImageSymbolWeightMedium];+ [cancelButton setImage:[UIImage systemImageNamed:@"xmark.circle.fill" withConfiguration:config] forState:UIControlStateNormal];+ cancelButton.tintColor = [UIColor colorWithWhite:0.45 alpha:1.0];+ cancelButton.translatesAutoresizingMaskIntoConstraints = NO;+ [cancelButton addTarget:view action:@selector(cancelButtonTapped) forControlEvents:UIControlEventTouchUpInside];+ view.cancelButton = cancelButton;+ [view addSubview:cancelButton];++ // Layout+ [NSLayoutConstraint activateConstraints:@[+ [titleLabel.leadingAnchor constraintEqualToAnchor:view.leadingAnchor constant:16],+ [titleLabel.topAnchor constraintEqualToAnchor:view.topAnchor constant:12],+ [titleLabel.trailingAnchor constraintEqualToAnchor:cancelButton.leadingAnchor constant:-10],++ [subtitleLabel.leadingAnchor constraintEqualToAnchor:view.leadingAnchor constant:16],+ [subtitleLabel.topAnchor constraintEqualToAnchor:titleLabel.bottomAnchor constant:3],+ [subtitleLabel.trailingAnchor constraintEqualToAnchor:cancelButton.leadingAnchor constant:-10],++ [progressBar.leadingAnchor constraintEqualToAnchor:view.leadingAnchor constant:16],+ [progressBar.trailingAnchor constraintEqualToAnchor:view.trailingAnchor constant:-16],+ [progressBar.topAnchor constraintEqualToAnchor:subtitleLabel.bottomAnchor constant:10],+ [progressBar.bottomAnchor constraintEqualToAnchor:view.bottomAnchor constant:-14],+ [progressBar.heightAnchor constraintEqualToConstant:6],++ [cancelButton.trailingAnchor constraintEqualToAnchor:view.trailingAnchor constant:-14],+ [cancelButton.centerYAnchor constraintEqualToAnchor:titleLabel.centerYAnchor],+ [cancelButton.widthAnchor constraintEqualToConstant:32],+ [cancelButton.heightAnchor constraintEqualToConstant:32],+ ]];++ [parentView addSubview:view];++ // Center horizontally with max width+ NSLayoutConstraint *centerX = [view.centerXAnchor constraintEqualToAnchor:parentView.centerXAnchor];+ NSLayoutConstraint *maxWidth = [view.widthAnchor constraintLessThanOrEqualToConstant:360];+ NSLayoutConstraint *leadingFallback = [view.leadingAnchor constraintGreaterThanOrEqualToAnchor:parentView.leadingAnchor constant:16];+ NSLayoutConstraint *trailingFallback = [view.trailingAnchor constraintLessThanOrEqualToAnchor:parentView.trailingAnchor constant:-16];+ NSLayoutConstraint *preferredWidth = [view.widthAnchor constraintEqualToAnchor:parentView.widthAnchor constant:-32];+ preferredWidth.priority = UILayoutPriorityDefaultHigh;++ [NSLayoutConstraint activateConstraints:@[+ centerX, maxWidth, leadingFallback, trailingFallback, preferredWidth,+ [view.bottomAnchor constraintEqualToAnchor:parentView.safeAreaLayoutGuide.bottomAnchor constant:-12],+ ]];++ // Slide-up animation+ view.transform = CGAffineTransformMakeTranslation(0, 80);+ view.alpha = 0;+ [UIView animateWithDuration:0.35 delay:0 usingSpringWithDamping:0.75 initialSpringVelocity:0.5 options:UIViewAnimationOptionCurveEaseOut animations:^{+ view.transform = CGAffineTransformIdentity;+ view.alpha = 1.0;+ } completion:nil];++ return view;+}++- (void)updateProgress:(float)progress title:(NSString *)title subtitle:(NSString *)subtitle {+ self.titleLabel.text = title;+ self.subtitleLabel.text = subtitle;+ [self.progressBar setProgress:progress animated:YES];+}++- (void)cancelButtonTapped {+ if (self.onCancel) {+ self.onCancel();+ [self dismiss];+ }+}++- (void)dismiss {+ if (!self.superview) return;+ [UIView animateWithDuration:0.25 animations:^{+ self.transform = CGAffineTransformMakeTranslation(0, 80);+ self.alpha = 0;+ } completion:^(BOOL finished) {+ [self removeFromSuperview];+ }];+}++@end++#pragma mark - Marker Repositioning Hooks++// YTModularPlayerBarView - normal player+%hook YTModularPlayerBarView++- (void)layoutSubviews {+ %orig;+ CGFloat barWidth = self.bounds.size.width;+ if (barWidth <= 0) return;++ // Find reference view for Y+ UIView *referenceView = nil;+ for (UIView *sub in self.subviews) {+ if ([sub isKindOfClass:%c(YTPlayerBarRectangleDecorationView)] ||+ [sub isKindOfClass:%c(YTPlayerBarProgressDecorationView)]) {+ referenceView = sub;+ break;+ }+ }++ for (UIView *sub in self.subviews) {+ if (sub.tag != SBSegmentMarkerTag) continue;+ NSArray *data = objc_getAssociatedObject(sub, @selector(sbSegmentData));+ if (!data || data.count < 3) continue;++ CGFloat startFrac = [data[0] floatValue];+ CGFloat endFrac = [data[1] floatValue];+ BOOL isPoi = [data[2] boolValue];++ CGFloat x = startFrac * barWidth;+ CGFloat w = (endFrac - startFrac) * barWidth;+ if (isPoi) { w = SBPoiMarkerWidth; x = MAX(0, x - SBPoiMarkerXOffset); }+ else if (w < SBMarkerMinWidth) w = SBMarkerMinWidth;++ sub.frame = CGRectMake(x, referenceView.frame.origin.y, w, referenceView.frame.size.height);+ }++ // Keep the segment markers above YouTube's decoration views, and the scrubber+ // dot above the markers, so the stack stays track < markers < dot. YouTube+ // rebuilds its own decorations on top of ours on each layout (splitting the+ // progress view per chapter), which would otherwise bury the markers.+ NSArray<UIView *> *subs = self.subviews;+ NSMutableArray<UIView *> *markers = [NSMutableArray array];+ UIView *scrubberDot = nil;+ @try {+ scrubberDot = [self valueForKey:@"_scrubberCircle"];+ } @catch (id ex) {}+ for (UIView *sub in subs) {+ if (sub.tag == SBSegmentMarkerTag) {+ [markers addObject:sub];+ } else if ([sub isKindOfClass:%c(YTPlayerBarScrubberDotDecorationView)]) {+ if (!scrubberDot) scrubberDot = sub;+ }+ }+ if (markers.count == 0) return;++ // Desired top group, front-most last: the markers followed by the dot. Reorder+ // only when the subview tail doesn't already match it, so a settled layout is a+ // no-op and doesn't trigger a fresh layout pass on every runloop cycle.+ NSMutableArray<UIView *> *desiredTail = [markers mutableCopy];+ if (scrubberDot) [desiredTail addObject:scrubberDot];+ BOOL settled = subs.count >= desiredTail.count;+ for (NSUInteger i = 0; settled && i < desiredTail.count; i++) {+ if (subs[subs.count - desiredTail.count + i] != desiredTail[i]) settled = NO;+ }+ if (settled) return;++ for (UIView *marker in markers) [self bringSubviewToFront:marker];+ if (scrubberDot) [self bringSubviewToFront:scrubberDot];+}++%end++// YTWatchFloatingMiniplayerProgressBarView - miniplayer+%hook YTWatchFloatingMiniplayerProgressBarView+- (void)layoutSubviews {+ %orig;+ CGFloat barWidth = self.bounds.size.width;++ for (UIView *sub in self.superview.subviews) {+ if (sub.tag != SBSegmentMarkerTag) continue;+ NSArray *data = objc_getAssociatedObject(sub, @selector(sbSegmentData));+ if (!data || data.count < 3) continue;++ CGFloat startFrac = [data[0] floatValue];+ CGFloat endFrac = [data[1] floatValue];+ BOOL isPoi = [data[2] boolValue];++ CGFloat x = startFrac * barWidth;+ CGFloat w = (endFrac - startFrac) * barWidth;+ if (isPoi) { w = SBPoiMarkerWidth; x = MAX(0, x - SBPoiMarkerXOffset); }+ else if (w < SBMarkerMinWidth) w = SBMarkerMinWidth;++ sub.frame = CGRectMake(x, self.frame.origin.y, w, self.bounds.size.height);+ }+}+%end++#pragma mark - YTPlayerViewController Hook (Notification Observer)++%group SBObserver+%hook YTPlayerViewController++- (void)viewDidLoad {+ %orig;+ [[NSNotificationCenter defaultCenter] removeObserver:self name:@"SBSegmentsDidLoad" object:self];+ [[NSNotificationCenter defaultCenter] addObserver:self+ selector:@selector(sbSegmentsDidLoad:)+ name:@"SBSegmentsDidLoad"+ object:self];+}++- (void)dealloc {+ [[NSNotificationCenter defaultCenter] removeObserver:self name:@"SBSegmentsDidLoad" object:self];+ %orig;+}++%new+- (void)sbSegmentsDidLoad:(NSNotification *)notification {+ [self sbRefreshMarkers:notification.userInfo[@"segments"]];+}++// Re-resolves the current player bar view fresh and re-creates segment markers+// on it. Called whenever the player layout might have changed (initial load,+// fullscreen enter/exit, viewport resize) so markers always live on the+// currently-visible bar instead of an old detached one.+%new+- (void)sbRefreshMarkers:(NSArray<SBSegment *> *)segments {+ if (!IS_ENABLED(SBSegmentsInPlayer) && !IS_ENABLED(SBSegmentsInMiniPlayer) && !IS_ENABLED(SBSegmentsInFeed)) return;+ if (!segments) segments = self.sbSegments;++ CGFloat totalTime = [self currentVideoTotalMediaTime];+ if (totalTime <= 0) return;+ CGFloat barWidth;+ CGFloat h;+ CGFloat y;+ // Explicitly nil so the surface branches can rely on "unassigned == nil"+ // when deciding marker ordering, without depending on ARC zero-init.+ UIView *mainView = nil;+ UIView *scrubberDot = nil;+ UIView *referenceView = nil;++ if ([self.parentViewController isKindOfClass:%c(YTWatchFloatingMiniplayerViewController)] && IS_ENABLED(SBSegmentsInMiniPlayer)) {+ YTWatchFloatingMiniplayerViewController *miniplayercontroller = (YTWatchFloatingMiniplayerViewController *)self.parentViewController;+ YTWatchFloatingMiniplayerWithPersistentControlsView *controlsview = (YTWatchFloatingMiniplayerWithPersistentControlsView *)miniplayercontroller.view;++ for (UIView *sub in controlsview.subviews) {+ for (UIView *sub2 in sub.subviews) {+ if ([sub2 isKindOfClass:%c(YTWatchFloatingMiniplayerProgressBarView)]) {+ referenceView = sub2;+ break;+ }+ }+ if (referenceView) break;+ }++ mainView = referenceView.superview;++ // Remove old markers+ for (UIView *sub in [mainView.subviews copy]) {+ if (sub.tag == SBSegmentMarkerTag) [sub removeFromSuperview];+ }+ if (!segments || segments.count == 0) return;++ barWidth = referenceView.bounds.size.width;+ h = referenceView.bounds.size.height;+ y = referenceView.frame.origin.y;+ } else if ([[self activeVideoPlayerOverlay] isKindOfClass:%c(YTMainAppVideoPlayerOverlayViewController)] && IS_ENABLED(SBSegmentsInPlayer)) {+ YTMainAppVideoPlayerOverlayViewController *overlay = [self activeVideoPlayerOverlay];+ YTPlayerBarController *barController = [overlay playerBarController];+ YTInlinePlayerBarContainerView *containerView = barController.playerBar;+ UIView *playerBar;++ for (UIView *subview in containerView.subviews) {+ if ([subview isKindOfClass:%c(YTModularPlayerBarView)]) {+ playerBar = subview;+ mainView = subview;+ break;+ }+ }+ if (!playerBar) return;++ // Remove old markers+ for (UIView *sub in [playerBar.subviews copy]) {+ if (sub.tag == SBSegmentMarkerTag) [sub removeFromSuperview];+ }++ if (!segments || segments.count == 0) return;++ barWidth = playerBar.bounds.size.width;+ if (barWidth <= 0) return;++ @try {+ scrubberDot = [playerBar valueForKey:@"_scrubberCircle"];+ } @catch (id ex) {}+ // Find reference track view for Y position and height+ for (UIView *sub in playerBar.subviews) {+ if ([sub isKindOfClass:%c(YTPlayerBarRectangleDecorationView)]) {+ if (!referenceView) referenceView = sub;+ } else if ([sub isKindOfClass:%c(YTPlayerBarProgressDecorationView)]) {+ if (!referenceView) referenceView = sub;+ } else if ([sub isKindOfClass:%c(YTPlayerBarScrubberDotDecorationView)]) {+ if (!scrubberDot) scrubberDot = sub;+ }+ if (referenceView && scrubberDot) break;+ }+ h = referenceView.bounds.size.height;+ y = referenceView.frame.origin.y;+ } else if ([[self activeVideoPlayerOverlay] isKindOfClass:%c(YTInlineMutedPlaybackPlayerOverlayViewController)] && IS_ENABLED(SBSegmentsInFeed)) {+ YTInlineMutedPlaybackPlayerOverlayViewController *viewcon = [self activeVideoPlayerOverlay];+ YTInlineMutedPlaybackPlayerOverlayView *view = (YTInlineMutedPlaybackPlayerOverlayView *)viewcon.view;+ UIView *scrub;+ UIView *playerBar;+ for (UIView *sub in view.subviews) {+ if ([sub isKindOfClass:%c(YTInlineMutedPlaybackScrubberView)]) {+ scrub = sub;+ mainView = sub;+ break;+ }+ }++ if (!segments || segments.count == 0) return;++ for (UIView *sub in scrub.subviews) {+ if ([sub isKindOfClass:%c(YTPlayerBarMarkerView)] && sub.frame.origin.y != 0) {+ playerBar = sub;+ } else if ([sub isKindOfClass:%c(YTModularPlayerBarView)] && sub.frame.origin.y != 0) {+ playerBar = sub;+ mainView = sub;+ } else if ([sub isKindOfClass:%c(YTInlineMutedPlaybackScrubbingSlider)]) {+ if ([sub.accessibilityIdentifier isEqualToString:@"id.player.scrubber.slider"]) {+ scrubberDot = sub;+ }+ }+ if (playerBar && scrubberDot) break;+ }++ if (!playerBar) return;++ // Remove old markers+ for (UIView *sub in [mainView.subviews copy]) {+ if (sub.tag == SBSegmentMarkerTag) [sub removeFromSuperview];+ }++ if ([mainView isKindOfClass:%c(YTModularPlayerBarView)]) {+ @try {+ scrubberDot = [mainView valueForKey:@"_scrubberCircle"];+ } @catch (id ex) {}+ // Find reference track view for Y position and height+ for (UIView *sub in mainView.subviews) {+ if ([sub isKindOfClass:%c(YTPlayerBarRectangleDecorationView)]) {+ if (!referenceView) referenceView = sub;+ } else if ([sub isKindOfClass:%c(YTPlayerBarProgressDecorationView)]) {+ if (!referenceView) referenceView = sub;+ } else if ([sub isKindOfClass:%c(YTPlayerBarScrubberDotDecorationView)]) {+ if (!scrubberDot) scrubberDot = sub;+ }+ if (referenceView && scrubberDot) break;+ }+ barWidth = playerBar.bounds.size.width;+ h = referenceView.bounds.size.height;+ y = referenceView.frame.origin.y;+ } else {+ barWidth = playerBar.bounds.size.width;+ h = playerBar.bounds.size.height;+ y = playerBar.frame.origin.y;+ }+ } else {+ return;+ }++ if (!IS_ENABLED(SBButtonKey)) return;++ for (SBSegment *segment in segments) {+ SBSegmentAction action = [segment configuredAction];+ if (action == SBSegmentActionDisable) continue;++ CGFloat startFrac = segment.startTime / totalTime;+ CGFloat endFrac;+ if (segment.endTime > totalTime) {+ endFrac = 1.0;+ } else {+ endFrac = segment.endTime / totalTime;+ }+ CGFloat x = startFrac * barWidth;+ CGFloat w = (endFrac - startFrac) * barWidth;++ // poi_highlight is a point, not a range — give it fixed width+ BOOL isPoi = [segment.category isEqualToString:@"poi_highlight"];+ if (isPoi) {+ w = SBPoiMarkerWidth;+ x = MAX(0, x - SBPoiMarkerXOffset);+ } else {+ if (w < SBMarkerMinWidth) w = SBMarkerMinWidth;+ }++ UIView *marker = [[UIView alloc] initWithFrame:CGRectMake(x, y, w, h)];+ marker.backgroundColor = [segment segmentColor];+ marker.userInteractionEnabled = NO;+ marker.tag = SBSegmentMarkerTag;+ objc_setAssociatedObject(marker, @selector(sbSegmentData), @[@(startFrac), @(endFrac), @(isPoi)], OBJC_ASSOCIATION_RETAIN_NONATOMIC);++ // Insert above the track (main player bar) so the marker paints on it;+ // the dot is re-fronted after the loop. Miniplayer/feed keep dot-relative+ // or top ordering.+ if (referenceView && referenceView.superview == mainView) {+ [mainView insertSubview:marker aboveSubview:referenceView];+ } else if (scrubberDot && scrubberDot.superview == mainView) {+ [mainView insertSubview:marker belowSubview:scrubberDot];+ } else {+ [mainView addSubview:marker];+ [mainView bringSubviewToFront:marker];+ }+ }+ if (scrubberDot) {+ [mainView bringSubviewToFront:scrubberDot];+ }+}++// On fullscreen enter/exit and other layout transitions, YouTube swaps the+// player bar instance. Re-render markers on the current bar (matches+// iSponsorBlock's approach). Deferred to the next runloop so YouTube's own+// layout pass finishes first — otherwise the new bar's bounds.size.width can+// still be 0 and the refresh early-returns without inserting markers.+- (void)setPlayerViewLayout:(NSInteger)layout {+ %orig;+ __weak typeof(self) weakSelf = self;+ dispatch_async(dispatch_get_main_queue(), ^{+ [weakSelf sbRefreshMarkers:nil];+ sbUpdateOverlayInsetForPivotBar();+ });+}++- (void)updateViewportSizeProvider {+ %orig;+ __weak typeof(self) weakSelf = self;+ dispatch_async(dispatch_get_main_queue(), ^{+ [weakSelf sbRefreshMarkers:nil];+ sbUpdateOverlayInsetForPivotBar();+ });+}++%end+%end++#pragma mark - Constructor++%ctor {+ %init;+ %init(SBObserver);+}\ No newline at end of filediff --git a/vendor/YouMod/Files/Tabbar.x b/vendor/YouMod/Files/Tabbar.xnew file mode 100644index 0000000..2c74bac--- /dev/null+++ b/vendor/YouMod/Files/Tabbar.x@@ -0,0 +1,359 @@+#import "Headers.h"+#import <objc/runtime.h>++// Tab icons+%hook YTAppPivotBarItemStyle+- (UIImage *)pivotBarItemIconImageWithIconType:(int)type color:(UIColor *)color useNewIcons:(BOOL)isNew selected:(BOOL)isSelected {+ if (type == 1 || type == 2 || type == 3 || type == 4 || type == 5 || type == 6 || type == 7 || type == 8 || type == 9 || type == 10 || type == 11 || type == 12 || type == 13 || type == 14 || type == 15 || type == 16 || type == 17) {+ NSString *imageName;+ if (type == 1) imageName = isSelected ? @"icons/history_selected" : @"icons/history";+ else if (type == 2) imageName = isSelected ? @"icons/gaming_selected" : @"icons/gaming";+ else if (type == 3) imageName = isSelected ? @"icons/sports_selected" : @"icons/sports";+ else if (type == 4) imageName = isSelected ? @"icons/noti_selected" : @"icons/noti";+ else if (type == 5) imageName = isSelected ? @"icons/news_selected" : @"icons/news";+ else if (type == 6) imageName = isSelected ? @"icons/music_selected" : @"icons/music";+ else if (type == 7) imageName = isSelected ? @"icons/watchlater_selected" : @"icons/watchlater";+ else if (type == 8) imageName = isSelected ? @"icons/playlist_selected" : @"icons/playlist";+ else if (type == 9) imageName = isSelected ? @"icons/like_selected" : @"icons/like";+ else if (type == 10) imageName = isSelected ? @"icons/live_selected" : @"icons/live";+ else if (type == 11) imageName = isSelected ? @"icons/post_selected" : @"icons/post";+ else if (type == 12) imageName = isSelected ? @"icons/video_selected" : @"icons/video";+ else if (type == 13) imageName = isSelected ? @"icons/movie_selected" : @"icons/movie";+ else if (type == 14) imageName = isSelected ? @"icons/course_selected" : @"icons/course";+ else if (type == 15) imageName = isSelected ? @"icons/minigame_selected" : @"icons/minigame";+ else if (type == 16) imageName = isSelected ? @"icons/fashion_selected" : @"icons/fashion";+ else if (type == 17) imageName = isSelected ? @"icons/learning_selected" : @"icons/learning";+ YTAssetLoader *al = [[%c(YTAssetLoader) alloc] initWithBundle:YouModBundle()];+ return [al imageNamed:imageName];+ }+ return %orig;+}+%end++static NSString *ymPivotIDForTabID(NSString *tabID) {+ if ([tabID isEqualToString:@"home"]) return @"FEwhat_to_watch";+ if ([tabID isEqualToString:@"shorts"]) return @"FEshorts";+ if ([tabID isEqualToString:@"create"]) return @"FEuploads";+ if ([tabID isEqualToString:@"subscriptions"]) return @"FEsubscriptions";+ if ([tabID isEqualToString:@"library"]) return @"FElibrary";+ if ([tabID isEqualToString:@"history"]) return [%c(YTIBrowseRequest) browseIDForHistory];+ if ([tabID isEqualToString:@"gaming"]) return [%c(YTIBrowseRequest) browseIDForGamingDestination];+ if ([tabID isEqualToString:@"sports"]) return [%c(YTIBrowseRequest) browseIDForSportsDestination];+ if ([tabID isEqualToString:@"notifications"]) return [%c(YTIBrowseRequest) browseIDForNotificationsInbox];+ if ([tabID isEqualToString:@"news"]) return @"UCYfdidRxbB8Qhf0Nx7ioOYw"; // FEnews_destination+ if ([tabID isEqualToString:@"music"]) return @"UC-9-kyTW8ZkZNDHQJ6FgpwQ";+ if ([tabID isEqualToString:@"watchlater"]) return @"VLWL";+ if ([tabID isEqualToString:@"playlist"]) return @"FEplaylist_aggregation";+ if ([tabID isEqualToString:@"like"]) return @"VLLL";+ if ([tabID isEqualToString:@"live"]) return @"UC4R8DWoMoI7CAwX8_LjQHig";+ if ([tabID isEqualToString:@"post"]) return @"FEpost_home";+ if ([tabID isEqualToString:@"video"]) return @"UC3qapbGAd2-S75NkBY3XWww";+ if ([tabID isEqualToString:@"movie"]) return @"FEstorefront";+ if ([tabID isEqualToString:@"course"]) return @"FEcourses";+ if ([tabID isEqualToString:@"minigame"]) return @"FEmini_app_destination";+ if ([tabID isEqualToString:@"fashion"]) return @"UCrpQ4p1Ql_hG8rKXIKM1MOQ";+ if ([tabID isEqualToString:@"learning"]) return @"UCtFRv9O2AHqOZjjynzrv-xg";+ return nil;+}++static NSInteger ymIconTypeForTabID(NSString *tabID) {+ if ([tabID isEqualToString:@"history"]) return 1;+ if ([tabID isEqualToString:@"gaming"]) return 2;+ if ([tabID isEqualToString:@"sports"]) return 3;+ if ([tabID isEqualToString:@"notifications"]) return 4;+ if ([tabID isEqualToString:@"news"]) return 5;+ if ([tabID isEqualToString:@"music"]) return 6;+ if ([tabID isEqualToString:@"watchlater"]) return 7;+ if ([tabID isEqualToString:@"playlist"]) return 8;+ if ([tabID isEqualToString:@"like"]) return 9;+ if ([tabID isEqualToString:@"live"]) return 10;+ if ([tabID isEqualToString:@"post"]) return 11;+ if ([tabID isEqualToString:@"video"]) return 12;+ if ([tabID isEqualToString:@"movie"]) return 13;+ if ([tabID isEqualToString:@"course"]) return 14;+ if ([tabID isEqualToString:@"minigame"]) return 15;+ if ([tabID isEqualToString:@"fashion"]) return 16;+ if ([tabID isEqualToString:@"learning"]) return 17;+ return 0;+}++static NSString *ymTitleForTabID(NSString *tabID) {+ if ([tabID isEqualToString:@"history"]) return LOC(@"HISTORY_TAB");+ if ([tabID isEqualToString:@"gaming"]) return LOC(@"GAMING_TAB");+ if ([tabID isEqualToString:@"sports"]) return LOC(@"SPORTS_TAB");+ if ([tabID isEqualToString:@"notifications"]) return LOC(@"NOTI_TAB");+ if ([tabID isEqualToString:@"news"]) return LOC(@"NEWS_TAB");+ if ([tabID isEqualToString:@"music"]) return LOC(@"MUSIC_TAB");+ if ([tabID isEqualToString:@"watchlater"]) return LOC(@"WATCH_LATER_TAB");+ if ([tabID isEqualToString:@"playlist"]) return LOC(@"PLAYLIST_TAB");+ if ([tabID isEqualToString:@"like"]) return LOC(@"LIKE_TAB");+ if ([tabID isEqualToString:@"live"]) return LOC(@"LIVE_TAB");+ if ([tabID isEqualToString:@"post"]) return LOC(@"POST_TAB");+ if ([tabID isEqualToString:@"video"]) return LOC(@"VIDEO_TAB");+ if ([tabID isEqualToString:@"movie"]) return LOC(@"MOVIE_TAB");+ if ([tabID isEqualToString:@"course"]) return LOC(@"COURSE_TAB");+ if ([tabID isEqualToString:@"minigame"]) return LOC(@"MINIGAME_TAB");+ if ([tabID isEqualToString:@"fashion"]) return LOC(@"FASHION_TAB");+ if ([tabID isEqualToString:@"learning"]) return LOC(@"LEARNING_TAB");+ return nil;+}++%hook YTPivotBarView+- (void)setRenderer:(YTIPivotBarRenderer *)renderer {+ NSArray *savedOrder = [[NSUserDefaults standardUserDefaults] arrayForKey:TabOrder];+ if (savedOrder.count > 0) {+ NSMutableArray <YTIPivotBarSupportedRenderers *> *items = [renderer itemsArray];++ // Build lookup: pivotIdentifier -> renderer item+ NSMutableDictionary<NSString *, YTIPivotBarSupportedRenderers *> *lookup = [NSMutableDictionary dictionary];+ for (YTIPivotBarSupportedRenderers *item in items) {+ NSString *pID = [[item pivotBarItemRenderer] pivotIdentifier];+ NSString *pID2 = [[item pivotBarIconOnlyItemRenderer] pivotIdentifier];+ if (pID) lookup[pID] = item;+ if (pID2) lookup[pID2] = item;+ }++ // Build ordered array from saved data+ NSMutableArray *ordered = [NSMutableArray array];+ for (NSDictionary *entry in savedOrder) {+ NSString *tabID = entry[@"id"];+ BOOL enabled = [entry[@"enabled"] boolValue];+ if (!enabled) continue;++ NSString *pivotID = ymPivotIDForTabID(tabID);+ if (!pivotID) continue;++ YTIPivotBarSupportedRenderers *existing = lookup[pivotID];+ if (existing) {+ [ordered addObject:existing];+ } else {+ // Custom tab not in YouTube's default items — create it+ NSInteger iconType = ymIconTypeForTabID(tabID);+ NSString *title = ymTitleForTabID(tabID);+ if (iconType > 0 && title) {+ YTIPivotBarSupportedRenderers *newTab = [%c(YTIPivotBarRenderer) pivotSupportedRenderersWithBrowseId:pivotID title:title iconType:iconType];+ if (newTab) [ordered addObject:newTab];+ }+ }+ }+ // Replace items with ordered set+ [items removeAllObjects];+ [items addObjectsFromArray:ordered];+ }+ %orig(renderer);+}+%end++// Hide Tab Bar Indicators+%hook YTPivotBarIndicatorView+- (void)setFillColor:(UIColor *)arg1 {+ UIColor *temp = IS_ENABLED(HideTabIndi) ? [UIColor clearColor] : arg1;+ %orig(temp);+}+- (void)setBorderColor:(UIColor *)arg1 {+ UIColor *temp = IS_ENABLED(HideTabIndi) ? [UIColor clearColor] : arg1;+ %orig(temp);+}+%end++static NSString *YMExtractYouTubeVideoID(NSString *urlString) {+ if (!urlString || urlString.length == 0) return nil;++ NSString *cleanString = [urlString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];++ if (cleanString.length == 11 && ![cleanString containsString:@"/"] && ![cleanString containsString:@"?"]) {+ return cleanString;+ }++ NSString *extractedID = nil;+ NSURL *url = [NSURL URLWithString:cleanString];++ if (url) {+ if ([url.host containsString:@"youtu.be"]) {+ NSString *path = [url.path stringByReplacingOccurrencesOfString:@"/" withString:@""];+ if (path.length >= 11) {+ extractedID = [path substringToIndex:11];+ }+ } else if ([url.host containsString:@"youtube.com"]) {+ if ([url.path containsString:@"/shorts/"] || [url.path containsString:@"/live/"] || [url.path containsString:@"/clip/"]) {+ NSString *lastPath = [url.path lastPathComponent];+ if ([lastPath containsString:@"?"]) {+ lastPath = [[lastPath componentsSeparatedByString:@"?"] firstObject];+ }+ if (lastPath.length >= 11) {+ extractedID = [lastPath substringToIndex:11];+ }+ } else {+ NSURLComponents *components = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:NO];+ for (NSURLQueryItem *item in components.queryItems) {+ if ([item.name isEqualToString:@"v"] && item.value.length >= 11) {+ extractedID = [item.value substringToIndex:11];+ break;+ }+ }+ }+ }+ }++ if (!extractedID) {+ NSError *error = nil;+ NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(?:v=|\\/(?:shorts|live|clip)\\/|youtu\\.be\\/)([a-zA-Z0-9_-]{11})"+ options:NSRegularExpressionCaseInsensitive+ error:&error];+ NSTextCheckingResult *match = [regex firstMatchInString:cleanString options:0 range:NSMakeRange(0, cleanString.length)];+ if (match && match.numberOfRanges > 1) {+ extractedID = [cleanString substringWithRange:[match rangeAtIndex:1]];+ }+ }++ return (extractedID && extractedID.length == 11) ? extractedID : nil;+}++static NSString *gLastOpenedVideoID = nil;++static void YMOpenLinkFromClipboard(UIViewController *presentingVC, BOOL isRuntime) {+ UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];++ if (![pasteboard hasStrings]) return;++ NSString *rawString = [pasteboard.string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];+ NSString *videoID = YMExtractYouTubeVideoID(rawString);++ if (!videoID || videoID.length == 0) return;++ if (gLastOpenedVideoID && [gLastOpenedVideoID isEqualToString:videoID] && IS_ENABLED(AutoOpenLink) && !isRuntime) return;++ NSString *schemeURLString = [NSString stringWithFormat:@"youtube://%@", videoID];+ NSURL *targetURL = [NSURL URLWithString:schemeURLString];++ if ([[UIApplication sharedApplication] canOpenURL:targetURL]) {+ gLastOpenedVideoID = [videoID copy];+ [[UIApplication sharedApplication] openURL:targetURL options:@{} completionHandler:nil];+ }+}++static BOOL isGestureRegistered = NO;+// Hide Tab Labels + long-press on the first tab to open Manage Tabs+%hook YTPivotBarItemView+- (void)setRenderer:(YTIPivotBarRenderer *)renderer {+ %orig;+ if (IS_ENABLED(HideTabLabels)) {+ [self.navigationButton setTitle:@"" forState:UIControlStateNormal];+ [self.navigationButton setSizeWithPaddingAndInsets:NO];+ }+ // Attach long-press gesture once per view; the action handler checks the+ // current pivotIdentifier at fire time, so cell reuse / pivot bar refresh+ // can rebind the same view to a different tab safely.+ static const void *kYMContextMenuKey = &kYMContextMenuKey;+ if (!objc_getAssociatedObject(self, kYMContextMenuKey) && !isGestureRegistered) {+ UIContextMenuInteraction *interaction = [[UIContextMenuInteraction alloc] initWithDelegate:(id<UIContextMenuInteractionDelegate>)self];+ [self addInteraction:interaction];+ objc_setAssociatedObject(self, kYMContextMenuKey, interaction, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ isGestureRegistered = YES;+ }+}+%new+- (UIContextMenuConfiguration *)contextMenuInteraction:(UIContextMenuInteraction *)interaction configurationForMenuAtLocation:(CGPoint)location {+ return [UIContextMenuConfiguration configurationWithIdentifier:nil previewProvider:nil actionProvider:^UIMenu * _Nullable(NSArray<UIMenuElement *> * _Nonnull suggestedActions) {+ UIAction *tabBarAction = [UIAction actionWithTitle:LOC(@"MANAGE_TABS")+ image:[UIImage systemImageNamed:@"dock.rectangle"]+ identifier:nil+ handler:^(__kindof UIAction * _Nonnull action) {+ YMPresentTabOrderModally(nil);+ }];+ UIAction *openLinkAction = [UIAction actionWithTitle:LOC(@"OPEN_LINK")+ image:[UIImage systemImageNamed:@"link"]+ identifier:nil+ handler:^(__kindof UIAction * _Nonnull action) {+ UIViewController *topVC = YouModTopViewController(nil);+ YMOpenLinkFromClipboard(topVC, YES);+ }];+ return [UIMenu menuWithTitle:@"" children:@[tabBarAction, openLinkAction]];+ }];+}+%end++// Startup Tab+static BOOL isTabSelected = NO;+%hook YTPivotBarViewController+- (void)viewDidAppear:(BOOL)animated {+ %orig;+ sbUpdateOverlayInsetForPivotBar();+ if (IS_ENABLED(ShortsOnly) && !isTabSelected) {+ [self selectItemWithPivotIdentifier:@"FEshorts"];+ isTabSelected = YES;+ return;+ }+ if (!isTabSelected) {+ // Build pivot identifiers from enabled tabs (skip Create — matches Settings.x segment logic)+ NSMutableArray *pivotIdentifiers = [NSMutableArray array];+ NSArray *savedOrder = [[NSUserDefaults standardUserDefaults] arrayForKey:TabOrder];+ if (savedOrder.count > 0) {+ for (NSDictionary *entry in savedOrder) {+ if (![entry[@"enabled"] boolValue]) continue;+ NSString *tabID = entry[@"id"];+ if ([tabID isEqualToString:@"create"]) continue;+ NSString *pivot = ymPivotIDForTabID(tabID);+ if (pivot) [pivotIdentifiers addObject:pivot];+ }+ }+ if (pivotIdentifiers.count == 0) {+ pivotIdentifiers = [@[@"FEwhat_to_watch", @"FEshorts", @"FEsubscriptions", @"FElibrary"] mutableCopy];+ }++ NSInteger tabIndex = INTFORVAL(DefaultTab);+ if (tabIndex < 0) tabIndex = 0;+ if (tabIndex >= (NSInteger)pivotIdentifiers.count) tabIndex = MAX(0, (NSInteger)pivotIdentifiers.count - 1);+ [self selectItemWithPivotIdentifier:pivotIdentifiers[tabIndex]];+ isTabSelected = YES;+ }+}+// Translucent tab bar+- (BOOL)isFrostedPivotBarPermitted {+ if (INTFORVAL(UseFrostedTabBar) == 1) {+ return YES;+ } else if (INTFORVAL(UseFrostedTabBar) == 2) {+ return NO;+ }+ return %orig;+}+%end++%hook YTAppDelegate+- (void)appDidBecomeActive {+ %orig;+ if (IS_ENABLED(AutoOpenLink)) {+ UIViewController *topVC = YouModTopViewController(nil);+ YMOpenLinkFromClipboard(topVC, NO);+ }+ if (IS_ENABLED(HideSubbar)) {+ [[NSNotificationCenter defaultCenter] postNotificationName:@"YouModReloadHeaderBar" object:nil];+ }+}+%end++// Recompute SB overlay safe-area inset whenever YouTube shows or hides the pivot bar+// (e.g. entering/exiting fullscreen player). This keeps the SponsorBlock skip pill+// and download progress pill anchored above the tabbar when visible, and at the+// device safe-area bottom when the tabbar is hidden.+%hook YTAppViewController+- (void)hidePivotBar {+ %orig;+ sbUpdateOverlayInsetForPivotBar();+}+- (void)showPivotBar {+ %orig;+ sbUpdateOverlayInsetForPivotBar();+}+%end++%hook YTAppViewControllerImpl+- (void)hidePivotBar {+ %orig;+ sbUpdateOverlayInsetForPivotBar();+}+- (void)showPivotBar {+ %orig;+ sbUpdateOverlayInsetForPivotBar();+}+%enddiff --git a/vendor/YouMod/Files/ThumbnailPreview.x b/vendor/YouMod/Files/ThumbnailPreview.xnew file mode 100644index 0000000..e0f5179--- /dev/null+++ b/vendor/YouMod/Files/ThumbnailPreview.x@@ -0,0 +1,187 @@+#import <Photos/Photos.h>+#import "Headers.h"++@implementation YouModThumbnailViewController++- (void)viewDidLoad {+ [super viewDidLoad];++ self.preferredContentSize = CGSizeMake(650, 650);+ self.view.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.85];++ UIView *bgContainer = [[UIView alloc] init];+ bgContainer.translatesAutoresizingMaskIntoConstraints = NO;+ bgContainer.clipsToBounds = YES;+ bgContainer.backgroundColor = [UIColor clearColor];+ bgContainer.layer.cornerRadius = 0;+ [self.view addSubview:bgContainer];++ UIImageView *bgImageView = [[UIImageView alloc] initWithImage:self.thumbnailImage];+ bgImageView.contentMode = UIViewContentModeScaleAspectFill;+ bgImageView.translatesAutoresizingMaskIntoConstraints = NO;+ [bgContainer addSubview:bgImageView];++ UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleSystemMaterial];+ UIVisualEffectView *blurView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];+ blurView.translatesAutoresizingMaskIntoConstraints = NO;+ [bgContainer addSubview:blurView];++ self.scrollView = [[UIScrollView alloc] init];+ self.scrollView.delegate = self;+ self.scrollView.clipsToBounds = YES;+ self.scrollView.minimumZoomScale = 1.0;+ self.scrollView.maximumZoomScale = 4.0;+ self.scrollView.showsVerticalScrollIndicator = NO;+ self.scrollView.showsHorizontalScrollIndicator = NO;+ self.scrollView.translatesAutoresizingMaskIntoConstraints = NO;+ [bgContainer addSubview:self.scrollView];++ self.imageView = [[UIImageView alloc] initWithImage:self.thumbnailImage];+ self.imageView.contentMode = UIViewContentModeScaleAspectFit;+ self.imageView.clipsToBounds = YES;+ self.imageView.translatesAutoresizingMaskIntoConstraints = NO;+ [self.scrollView addSubview:self.imageView];++ UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)];+ doubleTap.numberOfTapsRequired = 2;+ [self.scrollView addGestureRecognizer:doubleTap];++ UIImageSymbolConfiguration *iconConfig = [UIImageSymbolConfiguration configurationWithPointSize:22 weight:UIImageSymbolWeightSemibold];+ UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];+ [closeBtn setImage:[UIImage systemImageNamed:@"xmark" withConfiguration:iconConfig] forState:UIControlStateNormal];+ closeBtn.tintColor = [UIColor whiteColor];+ closeBtn.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.4];+ closeBtn.layer.cornerRadius = 25;+ closeBtn.translatesAutoresizingMaskIntoConstraints = NO;+ [closeBtn addTarget:self action:@selector(closeTapped) forControlEvents:UIControlEventTouchUpInside];+ [bgContainer addSubview:closeBtn];++ UIButton *moreBtn = [UIButton buttonWithType:UIButtonTypeCustom];+ [moreBtn setImage:[UIImage systemImageNamed:@"square.and.arrow.up" withConfiguration:iconConfig] forState:UIControlStateNormal];+ moreBtn.tintColor = [UIColor whiteColor];+ moreBtn.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.4];+ moreBtn.layer.cornerRadius = 25;+ moreBtn.translatesAutoresizingMaskIntoConstraints = NO;+ [moreBtn addTarget:self action:@selector(moreTapped:) forControlEvents:UIControlEventTouchUpInside];+ [bgContainer addSubview:moreBtn];++ NSMutableArray *constraints = [NSMutableArray array];++ [constraints addObjectsFromArray:@[+ [bgContainer.topAnchor constraintEqualToAnchor:self.view.topAnchor],+ [bgContainer.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor],+ [bgContainer.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor],+ [bgContainer.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor]+ ]];++ [constraints addObjectsFromArray:@[+ [closeBtn.topAnchor constraintEqualToAnchor:bgContainer.safeAreaLayoutGuide.topAnchor constant:12],+ [closeBtn.leadingAnchor constraintEqualToAnchor:bgContainer.safeAreaLayoutGuide.leadingAnchor constant:12],+ [moreBtn.topAnchor constraintEqualToAnchor:bgContainer.safeAreaLayoutGuide.topAnchor constant:12],+ [moreBtn.trailingAnchor constraintEqualToAnchor:bgContainer.trailingAnchor constant:-12],+ ]];++ [constraints addObjectsFromArray:@[+ [bgImageView.topAnchor constraintEqualToAnchor:bgContainer.topAnchor],+ [bgImageView.bottomAnchor constraintEqualToAnchor:bgContainer.bottomAnchor],+ [bgImageView.leadingAnchor constraintEqualToAnchor:bgContainer.leadingAnchor],+ [bgImageView.trailingAnchor constraintEqualToAnchor:bgContainer.trailingAnchor],+ [blurView.topAnchor constraintEqualToAnchor:bgContainer.topAnchor],+ [blurView.bottomAnchor constraintEqualToAnchor:bgContainer.bottomAnchor],+ [blurView.leadingAnchor constraintEqualToAnchor:bgContainer.leadingAnchor],+ [blurView.trailingAnchor constraintEqualToAnchor:bgContainer.trailingAnchor]+ ]];++ [constraints addObjectsFromArray:@[+ [self.scrollView.topAnchor constraintEqualToAnchor:bgContainer.topAnchor],+ [self.scrollView.bottomAnchor constraintEqualToAnchor:bgContainer.bottomAnchor],+ [self.scrollView.leadingAnchor constraintEqualToAnchor:bgContainer.leadingAnchor],+ [self.scrollView.trailingAnchor constraintEqualToAnchor:bgContainer.trailingAnchor]+ ]];++ [constraints addObjectsFromArray:@[+ [self.imageView.topAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.topAnchor],+ [self.imageView.bottomAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.bottomAnchor],+ [self.imageView.leadingAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.leadingAnchor],+ [self.imageView.trailingAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.trailingAnchor],+ [self.imageView.widthAnchor constraintEqualToAnchor:self.scrollView.frameLayoutGuide.widthAnchor],+ [self.imageView.heightAnchor constraintEqualToAnchor:self.scrollView.frameLayoutGuide.heightAnchor]+ ]];++ [constraints addObjectsFromArray:@[+ [closeBtn.widthAnchor constraintEqualToConstant:50],+ [closeBtn.heightAnchor constraintEqualToConstant:50],+ [moreBtn.widthAnchor constraintEqualToConstant:50],+ [moreBtn.heightAnchor constraintEqualToConstant:50],+ ]];++ [NSLayoutConstraint activateConstraints:constraints];++ UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)];+ panGesture.delegate = self;+ [self.view addGestureRecognizer:panGesture];+}++- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {+ return self.imageView;+}++- (void)handleDoubleTap:(UITapGestureRecognizer *)gesture {+ if (self.scrollView.zoomScale > self.scrollView.minimumZoomScale) {+ [self.scrollView setZoomScale:self.scrollView.minimumZoomScale animated:YES];+ } else {+ CGFloat targetZoomScale = 3.0;+ CGPoint touchPoint = [gesture locationInView:self.imageView];+ CGFloat zoomWidth = self.scrollView.bounds.size.width / targetZoomScale;+ CGFloat zoomHeight = self.scrollView.bounds.size.height / targetZoomScale;+ CGFloat zoomX = touchPoint.x - (zoomWidth / 2.0);+ CGFloat zoomY = touchPoint.y - (zoomHeight / 2.0);+ [self.scrollView zoomToRect:CGRectMake(zoomX, zoomY, zoomWidth, zoomHeight) animated:YES];+ }+}++- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {+ if ([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) {+ if (self.scrollView.zoomScale > 1.0) return NO;+ }+ return YES;+}++- (void)handlePanGesture:(UIPanGestureRecognizer *)gesture {+ CGPoint translation = [gesture translationInView:self.view];+ CGPoint velocity = [gesture velocityInView:self.view];++ if (gesture.state == UIGestureRecognizerStateChanged) {+ if (translation.y > 0) {+ self.view.transform = CGAffineTransformMakeTranslation(0, translation.y);+ CGFloat alpha = MAX(0.0, 0.85 - (translation.y / self.view.bounds.size.height));+ self.view.backgroundColor = [UIColor colorWithWhite:0.0 alpha:alpha];+ } else {+ self.view.transform = CGAffineTransformMakeTranslation(0, translation.y * 0.1);+ }+ } else if (gesture.state == UIGestureRecognizerStateEnded || gesture.state == UIGestureRecognizerStateCancelled) {+ if (translation.y > 150 || velocity.y > 1000) {+ [self dismissViewControllerAnimated:YES completion:nil];+ } else {+ [UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.8 initialSpringVelocity:velocity.y / 1000.0 options:UIViewAnimationOptionCurveEaseOut animations:^{+ self.view.transform = CGAffineTransformIdentity;+ self.view.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.85];+ } completion:nil];+ }+ }+}++- (void)closeTapped {+ [self dismissViewControllerAnimated:YES completion:nil];+}++- (void)moreTapped:(UIButton *)sender {+ UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:@[self.thumbnailImage] applicationActivities:nil];+ if (isPad()) {+ activityVC.popoverPresentationController.sourceView = sender;+ activityVC.popoverPresentationController.sourceRect = sender.bounds;+ }+ [self presentViewController:activityVC animated:YES completion:nil];+}++@end\ No newline at end of filediff --git a/vendor/YouMod/Files/TranslateText.x b/vendor/YouMod/Files/TranslateText.xnew file mode 100644index 0000000..1f22f56--- /dev/null+++ b/vendor/YouMod/Files/TranslateText.x@@ -0,0 +1,454 @@+#import "Headers.h"++static void YouModTranslateText(NSString *text, NSString *targetLang, void (^completion)(NSString *translatedText, NSError *error)) {+ if (!text || text.length == 0) {+ if (completion) completion(@"", nil);+ return;+ }++ NSString *encodedText = [text stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];+ NSString *urlString = [NSString stringWithFormat:@"https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=%@&dt=t&q=%@", targetLang ?: @"en", encodedText];+ NSURL *url = [NSURL URLWithString:urlString];++ NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {+ if (error || !data) {+ dispatch_async(dispatch_get_main_queue(), ^{+ if (completion) completion(nil, error);+ });+ return;+ }++ @try {+ id json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];+ if ([json isKindOfClass:[NSArray class]] && [json count] > 0) {+ NSArray *sentences = json[0];+ NSMutableString *result = [NSMutableString string];+ for (id sentence in sentences) {+ if ([sentence isKindOfClass:[NSArray class]] && [sentence count] > 0) {+ [result appendString:sentence[0]];+ }+ }+ dispatch_async(dispatch_get_main_queue(), ^{+ if (completion) completion(result, nil);+ });+ return;+ }+ } @catch (NSException *e) {}++ dispatch_async(dispatch_get_main_queue(), ^{+ if (completion) completion(nil, [NSError errorWithDomain:@"YouModTranslate" code:-1 userInfo:nil]);+ });+ }];+ [task resume];+}++@implementation YouModLanguagePickerViewController++- (void)viewDidLoad {+ [super viewDidLoad];++ self.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];++ UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissPicker)];+ tap.delegate = self;+ [self.view addGestureRecognizer:tap];++ self.containerView = [[UIView alloc] init];+ self.containerView.backgroundColor = [UIColor systemGray6Color];+ self.containerView.layer.cornerRadius = 20.0;+ self.containerView.layer.borderWidth = 1.0;+ self.containerView.layer.borderColor = [UIColor separatorColor].CGColor;+ self.containerView.clipsToBounds = YES;+ self.containerView.translatesAutoresizingMaskIntoConstraints = NO;+ [self.view addSubview:self.containerView];++ UILabel *headerLabel = [[UILabel alloc] init];+ headerLabel.text = LOC(@"LANGUAGE");+ headerLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];+ headerLabel.textColor = [UIColor systemGrayColor];+ headerLabel.translatesAutoresizingMaskIntoConstraints = NO;+ [self.containerView addSubview:headerLabel];++ UIView *headerDivider = [[UIView alloc] init];+ headerDivider.backgroundColor = [UIColor separatorColor];+ headerDivider.translatesAutoresizingMaskIntoConstraints = NO;+ [self.containerView addSubview:headerDivider];++ self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];+ self.tableView.delegate = self;+ self.tableView.dataSource = self;+ self.tableView.backgroundColor = [UIColor clearColor];+ self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;+ self.tableView.separatorColor = [UIColor separatorColor];+ self.tableView.translatesAutoresizingMaskIntoConstraints = NO;+ [self.containerView addSubview:self.tableView];++ UIButton *cancelButton = [UIButton buttonWithType:UIButtonTypeSystem];+ [cancelButton setTitle:LOC(@"CANCEL") forState:UIControlStateNormal];+ [cancelButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];+ cancelButton.backgroundColor = [UIColor systemPurpleColor];+ cancelButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold];+ cancelButton.layer.cornerRadius = 14.0;+ cancelButton.clipsToBounds = YES;+ cancelButton.translatesAutoresizingMaskIntoConstraints = NO;+ [cancelButton addTarget:self action:@selector(dismissPicker) forControlEvents:UIControlEventTouchUpInside];+ [self.containerView addSubview:cancelButton];++ NSLayoutConstraint *widthConstraint = [self.containerView.widthAnchor constraintEqualToAnchor:self.view.widthAnchor multiplier:0.8];+ widthConstraint.priority = UILayoutPriorityDefaultHigh;++ NSLayoutConstraint *heightConstraint = [self.containerView.heightAnchor constraintEqualToAnchor:self.view.heightAnchor multiplier:0.65];+ heightConstraint.priority = UILayoutPriorityDefaultHigh;++ [NSLayoutConstraint activateConstraints:@[+ [self.containerView.centerXAnchor constraintEqualToAnchor:self.view.centerXAnchor],+ [self.containerView.centerYAnchor constraintEqualToAnchor:self.view.centerYAnchor],++ widthConstraint,+ [self.containerView.widthAnchor constraintLessThanOrEqualToConstant:320.0],++ heightConstraint,+ [self.containerView.heightAnchor constraintLessThanOrEqualToConstant:500.0],++ [headerLabel.topAnchor constraintEqualToAnchor:self.containerView.topAnchor constant:14],+ [headerLabel.leadingAnchor constraintEqualToAnchor:self.containerView.leadingAnchor constant:20],+ [headerLabel.trailingAnchor constraintEqualToAnchor:self.containerView.trailingAnchor constant:-20],++ [headerDivider.topAnchor constraintEqualToAnchor:headerLabel.bottomAnchor constant:12],+ [headerDivider.leadingAnchor constraintEqualToAnchor:self.containerView.leadingAnchor],+ [headerDivider.trailingAnchor constraintEqualToAnchor:self.containerView.trailingAnchor],+ [headerDivider.heightAnchor constraintEqualToConstant:0.5],++ [self.tableView.topAnchor constraintEqualToAnchor:headerDivider.bottomAnchor],+ [self.tableView.leadingAnchor constraintEqualToAnchor:self.containerView.leadingAnchor],+ [self.tableView.trailingAnchor constraintEqualToAnchor:self.containerView.trailingAnchor],+ [self.tableView.bottomAnchor constraintEqualToAnchor:cancelButton.topAnchor constant:-10],++ [cancelButton.leadingAnchor constraintEqualToAnchor:self.containerView.leadingAnchor constant:16],+ [cancelButton.trailingAnchor constraintEqualToAnchor:self.containerView.trailingAnchor constant:-16],+ [cancelButton.bottomAnchor constraintEqualToAnchor:self.containerView.bottomAnchor constant:-14],+ [cancelButton.heightAnchor constraintEqualToConstant:44]+ ]];+}++- (void)viewDidAppear:(BOOL)animated {+ [super viewDidAppear:animated];++ NSUInteger selectedIndex = [self.codes indexOfObject:self.selectedLangCode];+ if (selectedIndex != NSNotFound && selectedIndex < self.titles.count) {+ NSIndexPath *indexPath = [NSIndexPath indexPathForRow:selectedIndex inSection:0];+ [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionMiddle animated:NO];+ }+}++- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {+ if ([touch.view isDescendantOfView:self.containerView]) {+ return NO;+ }+ return YES;+}++- (void)dismissPicker {+ [self dismissViewControllerAnimated:YES completion:nil];+}++#pragma mark - TableView Delegate & DataSource++- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {+ return self.titles.count;+}++- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {+ static NSString *cellID = @"LangCell";+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];+ if (!cell) {+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];+ cell.backgroundColor = [UIColor clearColor];+ }++ NSString *name = self.titles[indexPath.row];+ NSString *code = self.codes[indexPath.row];+ cell.textLabel.text = name;++ if ([code isEqualToString:self.selectedLangCode]) {+ cell.textLabel.textColor = [UIColor systemPurpleColor];+ cell.textLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold];++ UIImage *checkImg = [UIImage systemImageNamed:@"checkmark"];+ cell.imageView.image = [checkImg imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];+ cell.imageView.tintColor = [UIColor systemPurpleColor];+ } else {+ cell.textLabel.textColor = [UIColor labelColor];+ cell.textLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightRegular];++ static UIImage *emptyImage = nil;+ if (!emptyImage) {+ UIGraphicsBeginImageContextWithOptions(CGSizeMake(20, 20), NO, 0.0);+ emptyImage = UIGraphicsGetImageFromCurrentImageContext();+ UIGraphicsEndImageContext();+ }+ cell.imageView.image = emptyImage;+ }++ return cell;+}++- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {+ [tableView deselectRowAtIndexPath:indexPath animated:YES];+ if (self.onSelectLanguage) {+ self.onSelectLanguage(self.codes[indexPath.row], self.titles[indexPath.row]);+ }+ [self dismissPicker];+}++@end++@implementation YouModTranslationViewController++- (void)viewDidLoad {+ [super viewDidLoad];++ self.view.backgroundColor = [UIColor systemBackgroundColor];+ self.title = LOC(@"TRANSLATION");++ if (self.navigationController) {+ UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];+ [appearance configureWithOpaqueBackground];+ appearance.backgroundColor = [UIColor systemBackgroundColor];+ appearance.titleTextAttributes = @{+ NSForegroundColorAttributeName: [UIColor labelColor],+ NSFontAttributeName: [UIFont boldSystemFontOfSize:17]+ };+ self.navigationController.navigationBar.standardAppearance = appearance;+ self.navigationController.navigationBar.scrollEdgeAppearance = appearance;+ }++ UIBarButtonItem *closeItem = [self createEqualBarButtonWithSymbol:@"xmark" action:@selector(closeTapped)];+ UIBarButtonItem *copyItem = [self createEqualBarButtonWithSymbol:@"doc.on.doc" action:@selector(copyTapped)];+ UIBarButtonItem *shareItem = [self createEqualBarButtonWithSymbol:@"square.and.arrow.up" action:@selector(shareTapped:)];++ self.navigationItem.rightBarButtonItems = @[closeItem, copyItem, shareItem];++ self.languageTitles = getAllSystemLanguageTitles();+ self.languageCodes = getAllSystemLanguageValues();++ NSString *preferredLang = [NSLocale preferredLanguages].firstObject;+ NSDictionary *components = preferredLang ? [NSLocale componentsFromLocaleIdentifier:preferredLang] : nil;+ NSString *deviceLangCode = components[NSLocaleLanguageCode] ?: [[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode] ?: @"en";++ NSUInteger defaultIndex = [self.languageCodes indexOfObject:deviceLangCode];+ if (defaultIndex == NSNotFound && preferredLang) {+ defaultIndex = [self.languageCodes indexOfObject:preferredLang];+ }++ if (defaultIndex != NSNotFound && defaultIndex < self.languageTitles.count) {+ self.selectedLangCode = self.languageCodes[defaultIndex];+ self.selectedLangName = self.languageTitles[defaultIndex];+ } else {+ NSUInteger enIndex = [self.languageCodes indexOfObject:@"en"];+ if (enIndex != NSNotFound && enIndex < self.languageTitles.count) {+ self.selectedLangCode = @"en";+ self.selectedLangName = self.languageTitles[enIndex];+ } else if (self.languageTitles.count > 0 && self.languageCodes.count > 0) {+ self.selectedLangCode = self.languageCodes.firstObject;+ self.selectedLangName = self.languageTitles.firstObject;+ } else {+ self.selectedLangCode = @"en";+ self.selectedLangName = @"English";+ }+ }++ UIView *langRowView = [[UIView alloc] init];+ langRowView.translatesAutoresizingMaskIntoConstraints = NO;+ langRowView.backgroundColor = [UIColor secondarySystemBackgroundColor];+ langRowView.layer.cornerRadius = 12;+ [self.view addSubview:langRowView];++ UILabel *langTitleLabel = [[UILabel alloc] init];+ langTitleLabel.translatesAutoresizingMaskIntoConstraints = NO;+ langTitleLabel.text = LOC(@"LANGUAGE");+ langTitleLabel.textColor = [UIColor labelColor];+ langTitleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];+ [langRowView addSubview:langTitleLabel];++ self.langValueLabel = [[UILabel alloc] init];+ self.langValueLabel.translatesAutoresizingMaskIntoConstraints = NO;+ self.langValueLabel.userInteractionEnabled = YES;++ UITapGestureRecognizer *langTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(selectLanguageTapped:)];+ [self.langValueLabel addGestureRecognizer:langTap];+ [langRowView addSubview:self.langValueLabel];+ [self updateLanguageLabelText];++ self.reloadButton = [UIButton buttonWithType:UIButtonTypeSystem];+ self.reloadButton.translatesAutoresizingMaskIntoConstraints = NO;+ UIImageSymbolConfiguration *reloadConfig = [UIImageSymbolConfiguration configurationWithPointSize:15 weight:UIFontWeightMedium];+ UIImage *reloadImage = [UIImage systemImageNamed:@"arrow.clockwise" withConfiguration:reloadConfig];+ [self.reloadButton setImage:reloadImage forState:UIControlStateNormal];+ self.reloadButton.tintColor = [UIColor systemRedColor];+ self.reloadButton.hidden = YES;+ [self.reloadButton addTarget:self action:@selector(performTranslation) forControlEvents:UIControlEventTouchUpInside];+ [langRowView addSubview:self.reloadButton];++ self.resultTextView = [[UITextView alloc] init];+ self.resultTextView.translatesAutoresizingMaskIntoConstraints = NO;+ self.resultTextView.backgroundColor = [UIColor secondarySystemBackgroundColor];+ self.resultTextView.layer.cornerRadius = 12;+ self.resultTextView.textColor = [UIColor labelColor];+ self.resultTextView.font = [UIFont systemFontOfSize:16];+ self.resultTextView.editable = NO;+ self.resultTextView.textContainerInset = UIEdgeInsetsMake(12, 12, 12, 12);+ [self.view addSubview:self.resultTextView];++ UILayoutGuide *guide = self.view.safeAreaLayoutGuide;++ [NSLayoutConstraint activateConstraints:@[+ [langRowView.topAnchor constraintEqualToAnchor:guide.topAnchor constant:12],+ [langRowView.leadingAnchor constraintEqualToAnchor:guide.leadingAnchor constant:16],+ [langRowView.trailingAnchor constraintEqualToAnchor:guide.trailingAnchor constant:-16],+ [langRowView.heightAnchor constraintEqualToConstant:48],++ [langTitleLabel.leadingAnchor constraintEqualToAnchor:langRowView.leadingAnchor constant:16],+ [langTitleLabel.centerYAnchor constraintEqualToAnchor:langRowView.centerYAnchor],++ [self.langValueLabel.trailingAnchor constraintEqualToAnchor:langRowView.trailingAnchor constant:-16],+ [self.langValueLabel.centerYAnchor constraintEqualToAnchor:langRowView.centerYAnchor],++ [self.reloadButton.trailingAnchor constraintEqualToAnchor:self.langValueLabel.leadingAnchor constant:-8],+ [self.reloadButton.centerYAnchor constraintEqualToAnchor:langRowView.centerYAnchor],+ [self.reloadButton.widthAnchor constraintEqualToConstant:28],+ [self.reloadButton.heightAnchor constraintEqualToConstant:28],++ [self.resultTextView.topAnchor constraintEqualToAnchor:langRowView.bottomAnchor constant:12],+ [self.resultTextView.leadingAnchor constraintEqualToAnchor:guide.leadingAnchor constant:16],+ [self.resultTextView.trailingAnchor constraintEqualToAnchor:guide.trailingAnchor constant:-16],+ [self.resultTextView.bottomAnchor constraintEqualToAnchor:guide.bottomAnchor constant:-16]+ ]];++ [self performTranslation];+}++- (UIBarButtonItem *)createEqualBarButtonWithSymbol:(NSString *)symbolName action:(SEL)action {+ UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];+ UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:15 weight:UIFontWeightMedium];+ UIImage *image = [UIImage systemImageNamed:symbolName withConfiguration:config];+ [button setImage:image forState:UIControlStateNormal];+ button.tintColor = [UIColor labelColor];++ button.translatesAutoresizingMaskIntoConstraints = NO;+ [NSLayoutConstraint activateConstraints:@[+ [button.widthAnchor constraintEqualToConstant:32],+ [button.heightAnchor constraintEqualToConstant:32]+ ]];++ [button addTarget:self action:action forControlEvents:UIControlEventTouchUpInside];+ return [[UIBarButtonItem alloc] initWithCustomView:button];+}++- (void)updateLanguageLabelText {+ NSString *langName = self.selectedLangName ?: @"";+ UIColor *purpleColor = [UIColor systemPurpleColor];+ UIFont *labelFont = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];++ NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ ", langName] attributes:@{+ NSFontAttributeName: labelFont,+ NSForegroundColorAttributeName: purpleColor+ }];++ UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithFont:labelFont];+ UIImage *symbol = [UIImage systemImageNamed:@"chevron.up.chevron.down" withConfiguration:config];++ if (symbol) {+ NSTextAttachment *attachment = [[NSTextAttachment alloc] init];+ attachment.image = [symbol imageWithTintColor:purpleColor renderingMode:UIImageRenderingModeAlwaysOriginal];++ CGFloat fontCapHeight = labelFont.capHeight;+ CGFloat iconHeight = symbol.size.height;+ attachment.bounds = CGRectMake(0, (fontCapHeight - iconHeight) / 2.0, symbol.size.width, iconHeight);++ [attrString appendAttributedString:[NSAttributedString attributedStringWithAttachment:attachment]];+ }++ self.langValueLabel.attributedText = attrString;+}++- (void)closeTapped {+ [self dismissViewControllerAnimated:YES completion:nil];+}++- (void)copyTapped {+ if (self.translationState == YouModTranslationStateSuccess && self.resultTextView.text.length > 0) {+ [UIPasteboard generalPasteboard].string = self.resultTextView.text;++ UIImpactFeedbackGenerator *feedback = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleLight];+ [feedback impactOccurred];++ UIView *parent = sbGetNotificationParent();+ [SBSkipNotificationView showSuccessInView:parent message:LOC(@"COPIED_TO_CLIPBOARD") duration:3.0];+ }+}++- (void)shareTapped:(id)sender {+ if (self.translationState != YouModTranslationStateSuccess || self.resultTextView.text.length == 0) return;++ UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:@[self.resultTextView.text] applicationActivities:nil];+ if (activityVC.popoverPresentationController) {+ if ([sender isKindOfClass:[UIBarButtonItem class]]) {+ activityVC.popoverPresentationController.barButtonItem = (UIBarButtonItem *)sender;+ } else if ([sender isKindOfClass:[UIView class]]) {+ activityVC.popoverPresentationController.sourceView = (UIView *)sender;+ activityVC.popoverPresentationController.sourceRect = ((UIView *)sender).bounds;+ }+ }+ [self presentViewController:activityVC animated:YES completion:nil];+}++- (void)selectLanguageTapped:(UITapGestureRecognizer *)gesture {+ if (!self.languageTitles || self.languageTitles.count == 0) return;++ YouModLanguagePickerViewController *pickerVC = [[YouModLanguagePickerViewController alloc] init];+ pickerVC.titles = self.languageTitles;+ pickerVC.codes = self.languageCodes;+ pickerVC.selectedLangCode = self.selectedLangCode;++ __weak typeof(self) weakSelf = self;+ pickerVC.onSelectLanguage = ^(NSString *code, NSString *title) {+ __strong typeof(weakSelf) strongSelf = weakSelf;+ if (!strongSelf) return;+ strongSelf.selectedLangCode = code;+ strongSelf.selectedLangName = title;+ [strongSelf updateLanguageLabelText];+ [strongSelf performTranslation];+ };++ pickerVC.modalPresentationStyle = UIModalPresentationOverFullScreen;+ pickerVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;+ [self presentViewController:pickerVC animated:YES completion:nil];+}++- (void)performTranslation {+ self.translationState = YouModTranslationStateLoading;+ self.reloadButton.hidden = YES;+ self.resultTextView.text = LOC(@"TRANSLATING");+ self.resultTextView.textColor = [UIColor systemPurpleColor];++ __weak typeof(self) weakSelf = self;+ YouModTranslateText(self.originalText, self.selectedLangCode, ^(NSString *translatedText, NSError *error) {+ __strong typeof(weakSelf) strongSelf = weakSelf;+ if (!strongSelf) return;++ if (translatedText && translatedText.length > 0) {+ strongSelf.translationState = YouModTranslationStateSuccess;+ strongSelf.resultTextView.text = translatedText;+ strongSelf.resultTextView.textColor = [UIColor labelColor];+ strongSelf.reloadButton.hidden = YES;+ } else {+ strongSelf.translationState = YouModTranslationStateFailed;+ strongSelf.resultTextView.text = LOC(@"TRANSLATE_FAILED");+ strongSelf.resultTextView.textColor = [UIColor systemRedColor];+ strongSelf.reloadButton.hidden = NO;+ }+ });+}++@end\ No newline at end of filediff --git a/vendor/YouMod/Files/YouModPerferences.x b/vendor/YouMod/Files/YouModPerferences.xnew file mode 100644index 0000000..0ea2e34--- /dev/null+++ b/vendor/YouMod/Files/YouModPerferences.x@@ -0,0 +1,150 @@+#import "Headers.h"+#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h> // For import++#define Prefix @"YouMod"++@implementation YouModPrefsManager+++ (instancetype)sharedManager {+ static YouModPrefsManager *shared = nil;+ static dispatch_once_t onceToken;+ dispatch_once(&onceToken, ^{+ shared = [[self alloc] init];+ });+ return shared;+}++// Import+- (void)importYouModSettingsFromVC:(UIViewController *)vc {+ NSArray<UTType *> *types = @[UTTypePropertyList, UTTypeData];++ // Modern constructor for iOS 14++ UIDocumentPickerViewController *picker = [[UIDocumentPickerViewController alloc] initForOpeningContentTypes:types asCopy:YES];+ picker.delegate = self;+ picker.modalPresentationStyle = UIModalPresentationFormSheet;++ // Ensure it looks right on iPad+ if (isPad()) {+ picker.popoverPresentationController.sourceView = vc.view;+ picker.popoverPresentationController.sourceRect = CGRectMake(vc.view.bounds.size.width/2, vc.view.bounds.size.height/2, 0, 0);+ picker.popoverPresentationController.permittedArrowDirections = 0;+ }++ [vc presentViewController:picker animated:YES completion:nil];+}++- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls {+ NSURL *selectedFileURL = urls.firstObject;+ if (!selectedFileURL) return;+ NSDictionary *importedData = [NSDictionary dictionaryWithContentsOfURL:selectedFileURL];+ // Vaild plist check+ if (!importedData || ![importedData isKindOfClass:[NSDictionary class]]) {+ YTAlertView *alertView = [%c(YTAlertView) infoDialog];+ alertView.title = LOC(@"ERROR");+ alertView.subtitle = LOC(@"ERROR_INVALID_FILE");+ alertView.shouldDismissOnBackgroundTap = YES;+ [alertView show];+ return;+ }+ BOOL foundKeys = NO;+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];+ // Remove old keys+ for (NSString *key in [defaults dictionaryRepresentation]) {+ if ([key hasPrefix:Prefix]) {+ [defaults removeObjectForKey:key];+ }+ }+ [defaults synchronize];+ // Set new key from file+ for (NSString *key in importedData) {+ if ([key hasPrefix:Prefix]) {+ [defaults setObject:importedData[key] forKey:key];+ foundKeys = YES;+ }+ }+ // Check if there's any YouMod key+ if (!foundKeys) {+ YTAlertView *alertView = [%c(YTAlertView) infoDialog];+ alertView.title = LOC(@"ERROR");+ alertView.subtitle = LOC(@"ERROR_NO_KEYS_IMPORT");+ alertView.shouldDismissOnBackgroundTap = YES;+ [alertView show];+ return;+ }+ [defaults synchronize];+ // Success Alert with Restart+ YTAlertView *alertView = [%c(YTAlertView) confirmationDialogWithAction:^{+ [[UIApplication sharedApplication] performSelector:@selector(suspend)];+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{+ exit(0);+ });+ } actionTitle:LOC(@"YES")];+ alertView.title = LOC(@"IMPORT_DONE");+ alertView.subtitle = LOC(@"APPLY_DESC"); // "Restart required"+ alertView.shouldDismissOnBackgroundTap = YES;+ [alertView show];+}++// Export+- (void)exportYouModSettingsFromVC:(UIViewController *)vc {+ NSDictionary *allSettings = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];+ NSMutableDictionary *youModOnly = [NSMutableDictionary dictionary];+ for (NSString *key in allSettings) {+ if ([key hasPrefix:Prefix]) {+ youModOnly[key] = allSettings[key];+ }+ }+ if (youModOnly.count == 0) {+ YTAlertView *alertView = [%c(YTAlertView) infoDialog];+ alertView.title = LOC(@"ERROR");+ alertView.subtitle = LOC(@"ERROR_NO_KEYS_EXPORT");+ alertView.shouldDismissOnBackgroundTap = YES;+ [alertView show];+ return;+ }+ NSString *tempPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"YouMod_Preferences.plist"];+ NSURL *fileURL = [NSURL fileURLWithPath:tempPath];+ [youModOnly writeToURL:fileURL atomically:YES];++ UIDocumentPickerViewController *picker = [[UIDocumentPickerViewController alloc] initForExportingURLs:@[fileURL] asCopy:YES];+ picker.modalPresentationStyle = UIModalPresentationFormSheet;++ if (isPad()) {+ picker.popoverPresentationController.sourceView = vc.view;+ }+ [vc presentViewController:picker animated:YES completion:nil];+}++// Reset+- (void)restoreYouModDefaults {+ YTAlertView *alertView = [%c(YTAlertView) confirmationDialogWithAction:^{+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];+ for (NSString *key in [defaults dictionaryRepresentation]) {+ if ([key hasPrefix:Prefix]) {+ [defaults removeObjectForKey:key];+ }+ }+ [defaults setBool:YES forKey:AutoClearCache];+ [defaults setBool:YES forKey:HideCastButtonNav];+ [defaults setBool:YES forKey:HideCastButtonPlayer];+ [defaults setBool:YES forKey:BackgroundPlayback];+ [defaults setBool:YES forKey:DisableHints];+ [defaults setInteger:1 forKey:GestureActivationArea];+ [defaults setInteger:1 forKey:LeftSideGesture];+ [defaults setInteger:2 forKey:RightSideGesture];+ [defaults setInteger:1 forKey:GestureHUDSize];+ [defaults setInteger:1 forKey:YTLogoIndex];+ [defaults setInteger:2 forKey:DownloadMethod];+ [defaults synchronize];+ [[UIApplication sharedApplication] performSelector:@selector(suspend)];+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{+ exit(0);+ });+ } actionTitle:LOC(@"YES")];+ alertView.title = LOC(@"WARNING");+ alertView.subtitle = LOC(@"RESETDEFAULT");+ alertView.shouldDismissOnBackgroundTap = YES;+ [alertView show];+}++@enddiff --git a/vendor/YouMod/Files/YouModSettings.x b/vendor/YouMod/Files/YouModSettings.xnew file mode 100644index 0000000..ea1f37b--- /dev/null+++ b/vendor/YouMod/Files/YouModSettings.x@@ -0,0 +1,2270 @@+// YouModSettings.x — Reusable UIKit-based sub-page for YouMod settings sections+#import "Headers.h"+#import <objc/runtime.h>+#import <objc/message.h>++#pragma mark - Data Model++typedef NS_ENUM(NSInteger, YMRowType) {+ YMRowTypeToggle = 0,+ YMRowTypePicker,+ YMRowTypeAction,+ YMRowTypeHeader,+ YMRowTypeSegment,+ YMRowTypeTextSegment,+ YMRowTypeImageSegment,+ YMRowTypeSlider+};++typedef NS_ENUM(NSInteger, YMVisibilityOperator) {+ YMVisibilityOperatorBoolEquals = 0,+ YMVisibilityOperatorIntEquals,+ YMVisibilityOperatorIntNotEquals,+ YMVisibilityOperatorIntGreaterThan,+ YMVisibilityOperatorIntGreaterThanOrEqual,+ YMVisibilityOperatorIntLessThan,+ YMVisibilityOperatorIntLessThanOrEqual,+ YMVisibilityOperatorIntInValues,+ YMVisibilityOperatorIntNotInValues,+ YMVisibilityOperatorCustomBlock+};++@interface YMVisibilityCondition : NSObject+@property (nonatomic, copy) NSString *key;+@property (nonatomic, assign) YMVisibilityOperator op;+@property (nonatomic, assign) BOOL boolValue;+@property (nonatomic, assign) NSInteger intValue;+@property (nonatomic, strong) NSArray<NSNumber *> *intValues;+@property (nonatomic, copy) BOOL (^customBlock)(NSUserDefaults *defaults);+++ (instancetype)conditionWithBoolKey:(NSString *)key equals:(BOOL)value;++ (instancetype)conditionWithKey:(NSString *)key intOperator:(YMVisibilityOperator)op value:(NSInteger)value;++ (instancetype)conditionWithKey:(NSString *)key inValues:(NSArray<NSNumber *> *)values;++ (instancetype)conditionWithKey:(NSString *)key notInValues:(NSArray<NSNumber *> *)values;++ (instancetype)conditionWithBlock:(BOOL (^)(NSUserDefaults *defaults))block;++- (BOOL)evaluateWithDefaults:(NSUserDefaults *)defaults;+@end++@implementation YMVisibilityCondition+++ (instancetype)conditionWithBoolKey:(NSString *)key equals:(BOOL)value {+ YMVisibilityCondition *cond = [[YMVisibilityCondition alloc] init];+ cond.key = key;+ cond.op = YMVisibilityOperatorBoolEquals;+ cond.boolValue = value;+ return cond;+}+++ (instancetype)conditionWithKey:(NSString *)key intOperator:(YMVisibilityOperator)op value:(NSInteger)value {+ YMVisibilityCondition *cond = [[YMVisibilityCondition alloc] init];+ cond.key = key;+ cond.op = op;+ cond.intValue = value;+ return cond;+}+++ (instancetype)conditionWithKey:(NSString *)key inValues:(NSArray<NSNumber *> *)values {+ YMVisibilityCondition *cond = [[YMVisibilityCondition alloc] init];+ cond.key = key;+ cond.op = YMVisibilityOperatorIntInValues;+ cond.intValues = values;+ return cond;+}+++ (instancetype)conditionWithKey:(NSString *)key notInValues:(NSArray<NSNumber *> *)values {+ YMVisibilityCondition *cond = [[YMVisibilityCondition alloc] init];+ cond.key = key;+ cond.op = YMVisibilityOperatorIntNotInValues;+ cond.intValues = values;+ return cond;+}+++ (instancetype)conditionWithBlock:(BOOL (^)(NSUserDefaults *defaults))block {+ YMVisibilityCondition *cond = [[YMVisibilityCondition alloc] init];+ cond.op = YMVisibilityOperatorCustomBlock;+ cond.customBlock = block;+ return cond;+}++- (BOOL)evaluateWithDefaults:(NSUserDefaults *)defaults {+ if (!defaults) defaults = [NSUserDefaults standardUserDefaults];+ switch (self.op) {+ case YMVisibilityOperatorBoolEquals:+ return [defaults boolForKey:self.key] == self.boolValue;+ case YMVisibilityOperatorIntEquals:+ return [defaults integerForKey:self.key] == self.intValue;+ case YMVisibilityOperatorIntNotEquals:+ return [defaults integerForKey:self.key] != self.intValue;+ case YMVisibilityOperatorIntGreaterThan:+ return [defaults integerForKey:self.key] > self.intValue;+ case YMVisibilityOperatorIntGreaterThanOrEqual:+ return [defaults integerForKey:self.key] >= self.intValue;+ case YMVisibilityOperatorIntLessThan:+ return [defaults integerForKey:self.key] < self.intValue;+ case YMVisibilityOperatorIntLessThanOrEqual:+ return [defaults integerForKey:self.key] <= self.intValue;+ case YMVisibilityOperatorIntInValues: {+ NSInteger current = [defaults integerForKey:self.key];+ for (NSNumber *v in self.intValues) {+ if ([v integerValue] == current) return YES;+ }+ return NO;+ }+ case YMVisibilityOperatorIntNotInValues: {+ NSInteger current = [defaults integerForKey:self.key];+ for (NSNumber *v in self.intValues) {+ if ([v integerValue] == current) return NO;+ }+ return YES;+ }+ case YMVisibilityOperatorCustomBlock:+ return self.customBlock ? self.customBlock(defaults) : YES;+ default:+ return YES;+ }+}++@end++@interface YMSettingsItem : NSObject+@property (nonatomic, assign) YMRowType type;+@property (nonatomic, strong) NSString *title;+@property (nonatomic, strong) NSString *subtitle;+@property (nonatomic, strong) NSString *key;+@property (nonatomic, strong) NSArray<NSString *> *pickerOptions;+@property (nonatomic, assign) NSInteger pickerDefault;+@property (nonatomic, copy) void (^action)(UIViewController *vc);+@property (nonatomic, strong) NSArray<NSNumber *> *segmentIcons;+@property (nonatomic, strong) NSArray<NSString *> *segmentLabels;+@property (nonatomic, strong) NSArray<UIImage *> *segmentImages;+@property (nonatomic, assign) float sliderMin;+@property (nonatomic, assign) float sliderMax;+@property (nonatomic, assign) float sliderStep;+@property (nonatomic, assign) float sliderDefault;++// Multi-condition visibility predicates: all conditions must match by default (AND), or any condition if matchAnyCondition is YES (OR).+@property (nonatomic, strong) NSMutableArray<YMVisibilityCondition *> *visibilityConditions;+@property (nonatomic, assign) BOOL matchAnyCondition;+++ (instancetype)toggleWithTitle:(NSString *)title subtitle:(NSString *)subtitle key:(NSString *)key;++ (instancetype)sliderWithTitle:(NSString *)title subtitle:(NSString *)subtitle key:(NSString *)key min:(float)min max:(float)max step:(float)step defaultValue:(float)defaultValue;++ (instancetype)pickerWithTitle:(NSString *)title subtitle:(NSString *)subtitle key:(NSString *)key options:(NSArray<NSString *> *)options defaultValue:(NSInteger)defaultValue;++ (instancetype)actionWithTitle:(NSString *)title subtitle:(NSString *)subtitle action:(void (^)(UIViewController *vc))action;++ (instancetype)headerWithTitle:(NSString *)title;++ (instancetype)segmentWithTitle:(NSString *)title key:(NSString *)key icons:(NSArray<NSNumber *> *)icons defaultValue:(NSInteger)defaultValue;++ (instancetype)textSegmentWithTitle:(NSString *)title key:(NSString *)key labels:(NSArray<NSString *> *)labels defaultValue:(NSInteger)defaultValue;++ (instancetype)imageSegmentWithTitle:(NSString *)title key:(NSString *)key images:(NSArray<UIImage *> *)images defaultValue:(NSInteger)defaultValue;++// Evaluation+- (BOOL)isVisible;+- (BOOL)isVisibleWithDefaults:(NSUserDefaults *)defaults;++// Integer conditions (chainable)+- (instancetype)visibleWhenKey:(NSString *)key equals:(NSInteger)value;+- (instancetype)visibleWhenKey:(NSString *)key isNotEqualTo:(NSInteger)value;+- (instancetype)visibleWhenKey:(NSString *)key isGreaterThan:(NSInteger)value;+- (instancetype)visibleWhenKey:(NSString *)key isGreaterThanOrEqualTo:(NSInteger)value;+- (instancetype)visibleWhenKey:(NSString *)key isLessThan:(NSInteger)value;+- (instancetype)visibleWhenKey:(NSString *)key isLessThanOrEqualTo:(NSInteger)value;+- (instancetype)visibleWhenKey:(NSString *)key inValues:(NSArray<NSNumber *> *)values;+- (instancetype)visibleWhenKey:(NSString *)key notInValues:(NSArray<NSNumber *> *)values;+- (instancetype)visibleWhenKeyDictionary:(NSDictionary<NSString *, NSNumber *> *)keyValues;++// Boolean conditions (chainable)+- (instancetype)visibleWhenBoolKey:(NSString *)key equals:(BOOL)value;+- (instancetype)visibleWhenBoolKey:(NSString *)key;+- (instancetype)visibleWhenBoolKeys:(NSArray<NSString *> *)keys;+- (instancetype)visibleWhenBoolKeys:(NSArray<NSString *> *)keys allEqualTo:(BOOL)value;+- (instancetype)visibleWhenAnyBoolKey:(NSArray<NSString *> *)keys;+- (instancetype)visibleWhenBoolDictionary:(NSDictionary<NSString *, NSNumber *> *)keyValues;++// Block / Custom conditions & modifier+- (instancetype)visibleWhen:(BOOL (^)(NSUserDefaults *defaults))block;+- (instancetype)requireAnyCondition;+@end++@implementation YMSettingsItem++- (instancetype)init {+ self = [super init];+ if (self) {+ _visibilityConditions = [NSMutableArray array];+ }+ return self;+}+++ (instancetype)toggleWithTitle:(NSString *)title subtitle:(NSString *)subtitle key:(NSString *)key {+ YMSettingsItem *item = [[YMSettingsItem alloc] init];+ item.type = YMRowTypeToggle;+ item.title = title;+ item.subtitle = subtitle;+ item.key = key;+ return item;+}+++ (instancetype)sliderWithTitle:(NSString *)title subtitle:(NSString *)subtitle key:(NSString *)key min:(float)min max:(float)max step:(float)step defaultValue:(float)defaultValue {+ YMSettingsItem *item = [[YMSettingsItem alloc] init];+ item.type = YMRowTypeSlider;+ item.title = title;+ item.subtitle = subtitle;+ item.key = key;+ item.sliderMin = min;+ item.sliderMax = max;+ item.sliderStep = step;+ item.sliderDefault = defaultValue;+ return item;+}+++ (instancetype)pickerWithTitle:(NSString *)title subtitle:(NSString *)subtitle key:(NSString *)key options:(NSArray<NSString *> *)options defaultValue:(NSInteger)defaultValue {+ YMSettingsItem *item = [[YMSettingsItem alloc] init];+ item.type = YMRowTypePicker;+ item.title = title;+ item.subtitle = subtitle;+ item.key = key;+ item.pickerOptions = options;+ item.pickerDefault = defaultValue;+ return item;+}+++ (instancetype)actionWithTitle:(NSString *)title subtitle:(NSString *)subtitle action:(void (^)(UIViewController *vc))action {+ YMSettingsItem *item = [[YMSettingsItem alloc] init];+ item.type = YMRowTypeAction;+ item.title = title;+ item.subtitle = subtitle;+ item.action = action;+ return item;+}+++ (instancetype)headerWithTitle:(NSString *)title {+ YMSettingsItem *item = [[YMSettingsItem alloc] init];+ item.type = YMRowTypeHeader;+ item.title = title;+ return item;+}+++ (instancetype)segmentWithTitle:(NSString *)title key:(NSString *)key icons:(NSArray<NSNumber *> *)icons defaultValue:(NSInteger)defaultValue {+ YMSettingsItem *item = [[YMSettingsItem alloc] init];+ item.type = YMRowTypeSegment;+ item.title = title;+ item.key = key;+ item.segmentIcons = icons;+ item.pickerDefault = defaultValue;+ return item;+}+++ (instancetype)textSegmentWithTitle:(NSString *)title key:(NSString *)key labels:(NSArray<NSString *> *)labels defaultValue:(NSInteger)defaultValue {+ YMSettingsItem *item = [[YMSettingsItem alloc] init];+ item.type = YMRowTypeTextSegment;+ item.title = title;+ item.key = key;+ item.segmentLabels = labels;+ item.pickerDefault = defaultValue;+ return item;+}+++ (instancetype)imageSegmentWithTitle:(NSString *)title key:(NSString *)key images:(NSArray<UIImage *> *)images defaultValue:(NSInteger)defaultValue {+ YMSettingsItem *item = [[YMSettingsItem alloc] init];+ item.type = YMRowTypeImageSegment;+ item.title = title;+ item.key = key;+ item.segmentImages = images;+ item.pickerDefault = defaultValue;+ return item;+}++- (BOOL)isVisible {+ return [self isVisibleWithDefaults:[NSUserDefaults standardUserDefaults]];+}++- (BOOL)isVisibleWithDefaults:(NSUserDefaults *)defaults {+ if (!self.visibilityConditions || self.visibilityConditions.count == 0) return YES;+ if (!defaults) defaults = [NSUserDefaults standardUserDefaults];+ if (self.matchAnyCondition) {+ for (YMVisibilityCondition *cond in self.visibilityConditions) {+ if ([cond evaluateWithDefaults:defaults]) return YES;+ }+ return NO;+ } else {+ for (YMVisibilityCondition *cond in self.visibilityConditions) {+ if (![cond evaluateWithDefaults:defaults]) return NO;+ }+ return YES;+ }+}++- (instancetype)visibleWhenKey:(NSString *)key equals:(NSInteger)value {+ if (key) {+ [self.visibilityConditions addObject:[YMVisibilityCondition conditionWithKey:key intOperator:YMVisibilityOperatorIntEquals value:value]];+ }+ return self;+}++- (instancetype)visibleWhenKey:(NSString *)key isNotEqualTo:(NSInteger)value {+ if (key) {+ [self.visibilityConditions addObject:[YMVisibilityCondition conditionWithKey:key intOperator:YMVisibilityOperatorIntNotEquals value:value]];+ }+ return self;+}++- (instancetype)visibleWhenKey:(NSString *)key isGreaterThan:(NSInteger)value {+ if (key) {+ [self.visibilityConditions addObject:[YMVisibilityCondition conditionWithKey:key intOperator:YMVisibilityOperatorIntGreaterThan value:value]];+ }+ return self;+}++- (instancetype)visibleWhenKey:(NSString *)key isGreaterThanOrEqualTo:(NSInteger)value {+ if (key) {+ [self.visibilityConditions addObject:[YMVisibilityCondition conditionWithKey:key intOperator:YMVisibilityOperatorIntGreaterThanOrEqual value:value]];+ }+ return self;+}++- (instancetype)visibleWhenKey:(NSString *)key isLessThan:(NSInteger)value {+ if (key) {+ [self.visibilityConditions addObject:[YMVisibilityCondition conditionWithKey:key intOperator:YMVisibilityOperatorIntLessThan value:value]];+ }+ return self;+}++- (instancetype)visibleWhenKey:(NSString *)key isLessThanOrEqualTo:(NSInteger)value {+ if (key) {+ [self.visibilityConditions addObject:[YMVisibilityCondition conditionWithKey:key intOperator:YMVisibilityOperatorIntLessThanOrEqual value:value]];+ }+ return self;+}++- (instancetype)visibleWhenKey:(NSString *)key inValues:(NSArray<NSNumber *> *)values {+ if (key && values) {+ [self.visibilityConditions addObject:[YMVisibilityCondition conditionWithKey:key inValues:values]];+ }+ return self;+}++- (instancetype)visibleWhenKey:(NSString *)key notInValues:(NSArray<NSNumber *> *)values {+ if (key && values) {+ [self.visibilityConditions addObject:[YMVisibilityCondition conditionWithKey:key notInValues:values]];+ }+ return self;+}++- (instancetype)visibleWhenKeyDictionary:(NSDictionary<NSString *, NSNumber *> *)keyValues {+ [keyValues enumerateKeysAndObjectsUsingBlock:^(NSString *k, NSNumber *val, BOOL *stop) {+ [self visibleWhenKey:k equals:[val integerValue]];+ }];+ return self;+}++- (instancetype)visibleWhenBoolKey:(NSString *)key equals:(BOOL)value {+ if (key) {+ [self.visibilityConditions addObject:[YMVisibilityCondition conditionWithBoolKey:key equals:value]];+ }+ return self;+}++- (instancetype)visibleWhenBoolKey:(NSString *)key {+ return [self visibleWhenBoolKey:key equals:YES];+}++- (instancetype)visibleWhenBoolKeys:(NSArray<NSString *> *)keys {+ return [self visibleWhenBoolKeys:keys allEqualTo:YES];+}++- (instancetype)visibleWhenBoolKeys:(NSArray<NSString *> *)keys allEqualTo:(BOOL)value {+ for (NSString *k in keys) {+ [self visibleWhenBoolKey:k equals:value];+ }+ return self;+}++- (instancetype)visibleWhenAnyBoolKey:(NSArray<NSString *> *)keys {+ if (keys.count == 0) return self;+ return [self visibleWhen:^BOOL(NSUserDefaults *defaults) {+ for (NSString *k in keys) {+ if ([defaults boolForKey:k]) return YES;+ }+ return NO;+ }];+}++- (instancetype)visibleWhenBoolDictionary:(NSDictionary<NSString *, NSNumber *> *)keyValues {+ [keyValues enumerateKeysAndObjectsUsingBlock:^(NSString *k, NSNumber *val, BOOL *stop) {+ [self visibleWhenBoolKey:k equals:[val boolValue]];+ }];+ return self;+}++- (instancetype)visibleWhen:(BOOL (^)(NSUserDefaults *defaults))block {+ if (block) {+ [self.visibilityConditions addObject:[YMVisibilityCondition conditionWithBlock:block]];+ }+ return self;+}++- (instancetype)requireAnyCondition {+ self.matchAnyCondition = YES;+ return self;+}++@end++#pragma mark - YMSubSettingsViewController++@interface YMSubSettingsViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate>+- (UITableView *)tableView;+- (void)setTableView:(UITableView *)tv;+- (UISearchBar *)searchBar;+- (void)setSearchBar:(UISearchBar *)sb;+- (NSString *)navTitle;+- (void)setNavTitle:(NSString *)t;+- (NSArray<YMSettingsItem *> *)items;+- (void)setItems:(NSArray<YMSettingsItem *> *)items;+- (UIColor *)ymTextColor;+- (UIColor *)ymSecondaryColor;+- (UITableViewCell *)cellForItem:(YMSettingsItem *)item tableView:(UITableView *)tableView;+- (void)updateSearchBarTheme;+// Whether this page installs a per-page search bar that filters its own rows.+// Subclasses can override this.+- (BOOL)usesPageSearch;+@end++static const void *kYMTableViewKey = &kYMTableViewKey;+static const void *kYMSearchBarKey = &kYMSearchBarKey;+static const void *kYMNavTitleKey = &kYMNavTitleKey;+static const void *kYMItemsKey = &kYMItemsKey;+static const void *kYMSwitchKeyAssoc = &kYMSwitchKeyAssoc;+static const void *kYMSliderKeyAssoc = &kYMSliderKeyAssoc;+static const void *kYMSliderStepAssoc = &kYMSliderStepAssoc;+static const void *kYMSliderLabelAssoc = &kYMSliderLabelAssoc;+static const void *kYMPageFilterKey = &kYMPageFilterKey;++@implementation YMSubSettingsViewController++- (UITableView *)tableView { return objc_getAssociatedObject(self, kYMTableViewKey); }+- (void)setTableView:(UITableView *)tv { objc_setAssociatedObject(self, kYMTableViewKey, tv, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }+- (UISearchBar *)searchBar { return objc_getAssociatedObject(self, kYMSearchBarKey); }+- (void)setSearchBar:(UISearchBar *)sb { objc_setAssociatedObject(self, kYMSearchBarKey, sb, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }+- (NSString *)navTitle { return objc_getAssociatedObject(self, kYMNavTitleKey); }+- (void)setNavTitle:(NSString *)t { objc_setAssociatedObject(self, kYMNavTitleKey, t, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }+- (NSArray<YMSettingsItem *> *)items { return objc_getAssociatedObject(self, kYMItemsKey); }+- (void)setItems:(NSArray<YMSettingsItem *> *)items { objc_setAssociatedObject(self, kYMItemsKey, items, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }++- (BOOL)usesPageSearch { return YES; }++// The active per-page filter text (nil/empty = not filtering).+- (NSString *)pageFilter { return objc_getAssociatedObject(self, kYMPageFilterKey); }+- (void)setPageFilter:(NSString *)f { objc_setAssociatedObject(self, kYMPageFilterKey, f, OBJC_ASSOCIATION_COPY_NONATOMIC); }++static const void *kYMCachedDisplayedItemsKey = &kYMCachedDisplayedItemsKey;++- (NSArray<YMSettingsItem *> *)cachedDisplayedItems {+ return objc_getAssociatedObject(self, kYMCachedDisplayedItemsKey);+}++- (void)setCachedDisplayedItems:(NSArray<YMSettingsItem *> *)items {+ objc_setAssociatedObject(self, kYMCachedDisplayedItemsKey, items, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+}++// The rows to display: all items, or — while a page search is active — only those+// whose title/subtitle match, with headers dropped (a filtered list has no sections).+// A row with visibility predicates is shown only while its conditions evaluate to true.+- (BOOL)isItemVisible:(YMSettingsItem *)item {+ return [item isVisible];+}++- (NSArray<YMSettingsItem *> *)computeDisplayedItems {+ NSString *q = self.pageFilter;+ if (q.length == 0) {+ NSMutableArray<YMSettingsItem *> *visible = [NSMutableArray array];+ for (YMSettingsItem *item in self.items)+ if ([self isItemVisible:item]) [visible addObject:item];+ return visible;+ }+ NSMutableArray<YMSettingsItem *> *matches = [NSMutableArray array];+ NSStringCompareOptions opts = NSCaseInsensitiveSearch | NSDiacriticInsensitiveSearch;+ for (YMSettingsItem *item in self.items) {+ if (item.type == YMRowTypeHeader || ![self isItemVisible:item]) continue;+ NSString *hay = [NSString stringWithFormat:@"%@ %@", item.title ?: @"", item.subtitle ?: @""];+ if ([hay rangeOfString:q options:opts].location != NSNotFound) [matches addObject:item];+ }+ return matches;+}++- (NSArray<YMSettingsItem *> *)displayedItems {+ NSArray<YMSettingsItem *> *cached = [self cachedDisplayedItems];+ if (!cached) {+ cached = [self computeDisplayedItems];+ [self setCachedDisplayedItems:cached];+ }+ return cached;+}++- (void)updateDisplayedItemsAnimated:(BOOL)animated {+ NSArray<YMSettingsItem *> *oldItems = [self displayedItems];+ NSArray<YMSettingsItem *> *newItems = [self computeDisplayedItems];++ if (!animated || self.pageFilter.length > 0 || !self.tableView.window) {+ [self setCachedDisplayedItems:newItems];+ [self.tableView reloadData];+ return;+ }++ NSMutableArray<NSIndexPath *> *deletions = [NSMutableArray array];+ for (NSUInteger i = 0; i < oldItems.count; i++) {+ if (![newItems containsObject:oldItems[i]]) {+ [deletions addObject:[NSIndexPath indexPathForRow:i inSection:0]];+ }+ }++ NSMutableArray<NSIndexPath *> *insertions = [NSMutableArray array];+ for (NSUInteger i = 0; i < newItems.count; i++) {+ if (![oldItems containsObject:newItems[i]]) {+ [insertions addObject:[NSIndexPath indexPathForRow:i inSection:0]];+ }+ }++ if (deletions.count > 0 || insertions.count > 0) {+ [self setCachedDisplayedItems:newItems];+ [self.tableView performBatchUpdates:^{+ if (deletions.count > 0) {+ [self.tableView deleteRowsAtIndexPaths:deletions withRowAnimation:UITableViewRowAnimationFade];+ }+ if (insertions.count > 0) {+ [self.tableView insertRowsAtIndexPaths:insertions withRowAnimation:UITableViewRowAnimationFade];+ }+ } completion:nil];+ } else {+ [self setCachedDisplayedItems:newItems];+ }+}++- (void)updateSearchBarTheme {+ UISearchBar *sb = self.searchBar;+ if (!sb) return;+ UIColor *bgColor = (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark)+ ? [%c(YTColor) black3]+ : [UIColor systemBackgroundColor];+ sb.backgroundColor = bgColor;+ sb.barTintColor = bgColor;+ if ([sb respondsToSelector:@selector(searchTextField)]) {+ UITextField *tf = sb.searchTextField;+ if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {+ tf.textColor = [UIColor whiteColor];+ tf.backgroundColor = [UIColor colorWithWhite:0.15 alpha:1.0];+ } else {+ tf.textColor = [UIColor labelColor];+ tf.backgroundColor = [UIColor colorWithWhite:0.94 alpha:1.0];+ }+ }+}++- (void)viewDidLoad {+ Class ytStyled = objc_getClass("YTStyledViewController");+ struct objc_super superStruct = { self, ytStyled ?: [UIViewController class] };+ ((void (*)(struct objc_super *, SEL))objc_msgSendSuper)(&superStruct, @selector(viewDidLoad));++ self.title = self.navTitle;++ UIColor *bgColor = (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark)+ ? [%c(YTColor) black3]+ : [UIColor systemBackgroundColor];++ self.view.backgroundColor = bgColor;++ UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];+ [appearance configureWithDefaultBackground];+ appearance.backgroundColor = bgColor;+ self.navigationController.navigationBar.standardAppearance = appearance;+ self.navigationController.navigationBar.scrollEdgeAppearance = appearance;++ self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];+ self.tableView.translatesAutoresizingMaskIntoConstraints = NO;+ self.tableView.delegate = self;+ self.tableView.dataSource = self;+ self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;+ self.tableView.estimatedRowHeight = 60;+ self.tableView.rowHeight = UITableViewAutomaticDimension;+ self.tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;+ self.tableView.backgroundColor = bgColor;++ [self.view addSubview:self.tableView];++ if (self.usesPageSearch) {+ UISearchBar *sb = [[UISearchBar alloc] initWithFrame:CGRectZero];+ sb.translatesAutoresizingMaskIntoConstraints = NO;+ sb.placeholder = LOC(@"SEARCH");+ sb.searchBarStyle = UISearchBarStyleMinimal;+ sb.tintColor = [UIColor colorWithRed:0.6 green:0.2 blue:0.9 alpha:1.0];+ sb.delegate = self;+ sb.backgroundImage = [[UIImage alloc] init];+ [self.view addSubview:sb];+ self.searchBar = sb;+ [self updateSearchBarTheme];++ [NSLayoutConstraint activateConstraints:@[+ [sb.topAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor],+ [sb.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor],+ [sb.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor],++ [self.tableView.topAnchor constraintEqualToAnchor:sb.bottomAnchor],+ [self.tableView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor],+ [self.tableView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor],+ [self.tableView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor]+ ]];+ } else {+ [NSLayoutConstraint activateConstraints:@[+ [self.tableView.topAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor],+ [self.tableView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor],+ [self.tableView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor],+ [self.tableView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor]+ ]];+ }+}++- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {+ [super traitCollectionDidChange:previousTraitCollection];+ if (previousTraitCollection.userInterfaceStyle != self.traitCollection.userInterfaceStyle) {+ UIColor *bgColor = (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark)+ ? [%c(YTColor) black3]+ : [UIColor systemBackgroundColor];+ self.view.backgroundColor = bgColor;+ self.tableView.backgroundColor = bgColor;+ UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];+ [appearance configureWithDefaultBackground];+ appearance.backgroundColor = bgColor;+ self.navigationController.navigationBar.standardAppearance = appearance;+ self.navigationController.navigationBar.scrollEdgeAppearance = appearance;+ [self updateSearchBarTheme];+ [self updateDisplayedItemsAnimated:NO];+ }+}++#pragma mark - UISearchBarDelegate++- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {+ self.pageFilter = [searchText stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];+ [self updateDisplayedItemsAnimated:NO];+}++- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar {+ [searchBar setShowsCancelButton:YES animated:YES];+}++- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar {+ [searchBar setShowsCancelButton:NO animated:YES];+}++- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {+ [searchBar resignFirstResponder];+}++- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {+ searchBar.text = @"";+ self.pageFilter = @"";+ [searchBar resignFirstResponder];+ [self updateDisplayedItemsAnimated:NO];+}++- (void)viewWillAppear:(BOOL)animated {+ Class ytStyled = objc_getClass("YTStyledViewController");+ struct objc_super superStruct = { self, ytStyled ?: [UIViewController class] };+ ((void (*)(struct objc_super *, SEL, BOOL))objc_msgSendSuper)(&superStruct, @selector(viewWillAppear:), animated);+}++- (void)viewDidLayoutSubviews {+ Class ytStyled = objc_getClass("YTStyledViewController");+ struct objc_super superStruct = { self, ytStyled ?: [UIViewController class] };+ ((void (*)(struct objc_super *, SEL))objc_msgSendSuper)(&superStruct, @selector(viewDidLayoutSubviews));+ YTQTMButton *backButton = [self valueForKey:@"_backButton"];++ if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {+ backButton.tintColor = [UIColor whiteColor];+ } else {+ backButton.tintColor = [UIColor blackColor];+ }+}++- (UIColor *)navBarForegroundColor {+ if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {+ return [UIColor whiteColor];+ }+ // Light mode: return a concrete colour rather than nil. nil lets YouTube tint the+ // nav-bar foreground (back chevron + title) with its default appearance, which is+ // system blue in light mode. labelColor keeps it black in light / white in dark.+ return [UIColor labelColor];+}++- (UIColor *)ymTextColor {+ return (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark)+ ? [UIColor whiteColor] : [UIColor labelColor];+}++- (UIColor *)ymSecondaryColor {+ return [UIColor colorWithWhite:0.55 alpha:1.0];+}++#pragma mark - UITableViewDataSource++- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {+ return 1;+}++- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {+ return self.displayedItems.count;+}++- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {+ return [self cellForItem:self.displayedItems[indexPath.row] tableView:tableView];+}++// Builds the cell for a single item, dispatching on its row type. Shared by this+// page's data source and the global settings-search results table, so both render+// the same live, editable controls from one type dispatch.+- (UITableViewCell *)cellForItem:(YMSettingsItem *)item tableView:(UITableView *)tableView {+ if (item.type == YMRowTypeToggle) {+ return [self toggleCellForItem:item tableView:tableView];+ } else if (item.type == YMRowTypeAction) {+ return [self actionCellForItem:item tableView:tableView];+ } else if (item.type == YMRowTypeHeader) {+ return [self headerCellForItem:item tableView:tableView];+ } else if (item.type == YMRowTypeSegment) {+ return [self segmentCellForItem:item tableView:tableView];+ } else if (item.type == YMRowTypeTextSegment) {+ return [self textSegmentCellForItem:item tableView:tableView];+ } else if (item.type == YMRowTypeImageSegment) {+ return [self imageSegmentCellForItem:item tableView:tableView];+ } else if (item.type == YMRowTypeSlider) {+ return [self sliderCellForItem:item tableView:tableView];+ }+ return [self pickerCellForItem:item tableView:tableView];+}++- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {+ [tableView deselectRowAtIndexPath:indexPath animated:YES];+ YMSettingsItem *item = self.displayedItems[indexPath.row];+ if (item.type == YMRowTypeAction && item.action) {+ item.action(self);+ }+}++#pragma mark - Toggle Cell++- (UITableViewCell *)toggleCellForItem:(YMSettingsItem *)item tableView:(UITableView *)tableView {+ UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:nil];+ cell.backgroundColor = [UIColor clearColor];+ cell.selectionStyle = UITableViewCellSelectionStyleNone;+ cell.textLabel.text = item.title;+ cell.textLabel.textColor = [self ymTextColor];+ cell.textLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];++ if (item.subtitle.length > 0) {+ cell.detailTextLabel.text = item.subtitle;+ cell.detailTextLabel.textColor = [self ymSecondaryColor];+ cell.detailTextLabel.font = [UIFont systemFontOfSize:13];+ cell.detailTextLabel.numberOfLines = 0;+ }++ UISwitch *sw = [[UISwitch alloc] init];+ sw.on = IS_ENABLED(item.key);+ sw.onTintColor = [UIColor colorWithRed:0.6 green:0.2 blue:0.9 alpha:1.0];+ objc_setAssociatedObject(sw, kYMSwitchKeyAssoc, item.key, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ [sw addTarget:self action:@selector(toggleChanged:) forControlEvents:UIControlEventValueChanged];+ cell.accessoryView = sw;++ return cell;+}++- (void)toggleChanged:(UISwitch *)sender {+ NSString *key = objc_getAssociatedObject(sender, kYMSwitchKeyAssoc);+ if (key) {+ [[NSUserDefaults standardUserDefaults] setBool:sender.on forKey:key];+ [self updateDisplayedItemsAnimated:YES];+ }+}++- (UITableViewCell *)sliderCellForItem:(YMSettingsItem *)item tableView:(UITableView *)tableView {+ UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];+ cell.backgroundColor = [UIColor clearColor];+ cell.selectionStyle = UITableViewCellSelectionStyleNone;++ // A stored value of zero is treated as "no value yet" and shown as the+ // default. Slider ranges are therefore expected to be positive.+ float stored = [[NSUserDefaults standardUserDefaults] floatForKey:item.key];+ if (stored <= 0) stored = item.sliderDefault;++ UILabel *titleLabel = [[UILabel alloc] init];+ titleLabel.translatesAutoresizingMaskIntoConstraints = NO;+ titleLabel.text = item.title;+ titleLabel.textColor = [self ymTextColor];+ titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];+ [cell.contentView addSubview:titleLabel];++ UILabel *valueLabel = [[UILabel alloc] init];+ valueLabel.translatesAutoresizingMaskIntoConstraints = NO;+ valueLabel.textColor = [self ymSecondaryColor];+ valueLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];+ valueLabel.textAlignment = NSTextAlignmentRight;+ NSDateComponentsFormatter *formatter = [[NSDateComponentsFormatter alloc] init];+ formatter.allowedUnits = NSCalendarUnitSecond;+ formatter.unitsStyle = NSDateComponentsFormatterUnitsStyleAbbreviated;++ valueLabel.text = [formatter stringFromTimeInterval:stored];+ [cell.contentView addSubview:valueLabel];++ UISlider *slider = [[UISlider alloc] init];+ slider.translatesAutoresizingMaskIntoConstraints = NO;+ slider.minimumValue = item.sliderMin;+ slider.maximumValue = item.sliderMax;+ slider.value = stored;+ slider.minimumTrackTintColor = [UIColor colorWithRed:0.6 green:0.2 blue:0.9 alpha:1.0];+ slider.maximumTrackTintColor = [UIColor colorWithWhite:0.3 alpha:1.0];+ objc_setAssociatedObject(slider, kYMSliderKeyAssoc, item.key, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ objc_setAssociatedObject(slider, kYMSliderStepAssoc, @(item.sliderStep), OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ objc_setAssociatedObject(slider, kYMSliderLabelAssoc, valueLabel, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ [slider addTarget:self action:@selector(sliderChanged:) forControlEvents:UIControlEventValueChanged];+ [cell.contentView addSubview:slider];++ [NSLayoutConstraint activateConstraints:@[+ [titleLabel.leadingAnchor constraintEqualToAnchor:cell.contentView.leadingAnchor constant:16],+ [titleLabel.topAnchor constraintEqualToAnchor:cell.contentView.topAnchor constant:12],+ [valueLabel.trailingAnchor constraintEqualToAnchor:cell.contentView.trailingAnchor constant:-16],+ [valueLabel.centerYAnchor constraintEqualToAnchor:titleLabel.centerYAnchor],+ [valueLabel.widthAnchor constraintGreaterThanOrEqualToConstant:60],+ [slider.leadingAnchor constraintEqualToAnchor:cell.contentView.leadingAnchor constant:16],+ [slider.trailingAnchor constraintEqualToAnchor:cell.contentView.trailingAnchor constant:-16],+ [slider.topAnchor constraintEqualToAnchor:titleLabel.bottomAnchor constant:8],+ [slider.bottomAnchor constraintEqualToAnchor:cell.contentView.bottomAnchor constant:-12],+ ]];++ return cell;+}++- (void)sliderChanged:(UISlider *)sender {+ NSString *key = objc_getAssociatedObject(sender, kYMSliderKeyAssoc);+ if (!key) return;+ float step = [objc_getAssociatedObject(sender, kYMSliderStepAssoc) floatValue];+ if (step <= 0) step = 1;+ float snapped = roundf(sender.value / step) * step;+ sender.value = snapped;+ [[NSUserDefaults standardUserDefaults] setFloat:snapped forKey:key];+ UILabel *valueLabel = objc_getAssociatedObject(sender, kYMSliderLabelAssoc);+ NSDateComponentsFormatter *formatter = [[NSDateComponentsFormatter alloc] init];+ formatter.allowedUnits = NSCalendarUnitSecond;+ formatter.unitsStyle = NSDateComponentsFormatterUnitsStyleAbbreviated;++ valueLabel.text = [formatter stringFromTimeInterval:snapped];+}++#pragma mark - Action Cell++- (UITableViewCell *)actionCellForItem:(YMSettingsItem *)item tableView:(UITableView *)tableView {+ UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:nil];+ cell.backgroundColor = [UIColor clearColor];+ cell.selectionStyle = UITableViewCellSelectionStyleDefault;+ cell.textLabel.text = item.title;+ cell.textLabel.textColor = [self ymTextColor];+ cell.textLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];++ if (item.subtitle.length > 0) {+ cell.detailTextLabel.text = item.subtitle;+ cell.detailTextLabel.textColor = [self ymSecondaryColor];+ cell.detailTextLabel.font = [UIFont systemFontOfSize:13];+ cell.detailTextLabel.numberOfLines = 0;+ }++ return cell;+}++#pragma mark - Header Cell++- (UITableViewCell *)headerCellForItem:(YMSettingsItem *)item tableView:(UITableView *)tableView {+ UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];+ cell.backgroundColor = [UIColor clearColor];+ cell.selectionStyle = UITableViewCellSelectionStyleNone;+ cell.textLabel.text = item.title;+ cell.textLabel.textColor = [self ymSecondaryColor];+ cell.textLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];+ return cell;+}++#pragma mark - Segment Cell++- (UITableViewCell *)segmentCellForItem:(YMSettingsItem *)item tableView:(UITableView *)tableView {+ UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];+ cell.backgroundColor = [UIColor clearColor];+ cell.selectionStyle = UITableViewCellSelectionStyleNone;++ UILabel *titleLabel = [[UILabel alloc] init];+ titleLabel.text = item.title;+ titleLabel.textColor = [self ymTextColor];+ titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];+ titleLabel.translatesAutoresizingMaskIntoConstraints = NO;+ [cell.contentView addSubview:titleLabel];++ NSMutableArray *items = [NSMutableArray array];+ for (NSUInteger i = 0; i < item.segmentIcons.count; i++) {+ [items addObject:@""];+ }+ UISegmentedControl *segment = [[UISegmentedControl alloc] initWithItems:items];++ for (NSInteger i = 0; i < (NSInteger)item.segmentIcons.count; i++) {+ YTIIcon *ytIcon = [%c(YTIIcon) new];+ if (ytIcon) {+ ((void (*)(id, SEL, int))objc_msgSend)(ytIcon, @selector(setIconType:), [item.segmentIcons[i] intValue]);+ UIImage *iconImage = nil;+ if ([ytIcon respondsToSelector:@selector(iconImageWithColor:)]) {+ iconImage = [ytIcon iconImageWithColor:[UIColor whiteColor]];+ } else if ([ytIcon respondsToSelector:@selector(iconImageWithSelected:)]) {+ iconImage = [ytIcon iconImageWithSelected:NO];+ }+ if (iconImage) {+ [segment setImage:iconImage forSegmentAtIndex:i];+ }+ }+ }++ id storedSegVal = [[NSUserDefaults standardUserDefaults] objectForKey:item.key];+ NSInteger segIdx = storedSegVal ? [storedSegVal integerValue] : item.pickerDefault;+ segment.selectedSegmentIndex = MAX(0, MIN(segIdx, segment.numberOfSegments - 1));+ segment.backgroundColor = [UIColor colorWithRed:0.13 green:0.13 blue:0.13 alpha:1.0];+ segment.selectedSegmentTintColor = [UIColor colorWithRed:0.25 green:0.25 blue:0.25 alpha:1.0];+ segment.layer.cornerRadius = 8.0;+ segment.clipsToBounds = YES;++ objc_setAssociatedObject(segment, kYMSwitchKeyAssoc, item.key, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ [segment addTarget:self action:@selector(segmentChanged:) forControlEvents:UIControlEventValueChanged];++ segment.translatesAutoresizingMaskIntoConstraints = NO;+ [cell.contentView addSubview:segment];++ [NSLayoutConstraint activateConstraints:@[+ [titleLabel.leadingAnchor constraintEqualToAnchor:cell.contentView.leadingAnchor constant:16],+ [titleLabel.topAnchor constraintEqualToAnchor:cell.contentView.topAnchor constant:12],++ [segment.leadingAnchor constraintEqualToAnchor:cell.contentView.leadingAnchor constant:16],+ [segment.trailingAnchor constraintEqualToAnchor:cell.contentView.trailingAnchor constant:-16],+ [segment.topAnchor constraintEqualToAnchor:titleLabel.bottomAnchor constant:10],+ [segment.bottomAnchor constraintEqualToAnchor:cell.contentView.bottomAnchor constant:-12],+ [segment.heightAnchor constraintEqualToConstant:36]+ ]];++ return cell;+}++- (void)segmentChanged:(UISegmentedControl *)sender {+ NSString *key = objc_getAssociatedObject(sender, kYMSwitchKeyAssoc);+ if (key) {+ [[NSUserDefaults standardUserDefaults] setInteger:sender.selectedSegmentIndex forKey:key];+ [self updateDisplayedItemsAnimated:YES];+ }+}++#pragma mark - Text Segment Cell++- (UITableViewCell *)textSegmentCellForItem:(YMSettingsItem *)item tableView:(UITableView *)tableView {+ UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];+ cell.backgroundColor = [UIColor clearColor];+ cell.selectionStyle = UITableViewCellSelectionStyleNone;++ UILabel *titleLabel = [[UILabel alloc] init];+ titleLabel.text = item.title;+ titleLabel.textColor = [self ymTextColor];+ titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];+ titleLabel.translatesAutoresizingMaskIntoConstraints = NO;+ [cell.contentView addSubview:titleLabel];++ UISegmentedControl *segment = [[UISegmentedControl alloc] initWithItems:item.segmentLabels];++ id storedVal = [[NSUserDefaults standardUserDefaults] objectForKey:item.key];+ NSInteger txtSegIdx = storedVal ? [storedVal integerValue] : item.pickerDefault;+ segment.selectedSegmentIndex = MAX(0, MIN(txtSegIdx, segment.numberOfSegments - 1));+ segment.backgroundColor = [UIColor colorWithRed:0.13 green:0.13 blue:0.13 alpha:1.0];+ segment.selectedSegmentTintColor = [UIColor colorWithRed:0.25 green:0.25 blue:0.25 alpha:1.0];+ segment.layer.cornerRadius = 8.0;+ segment.clipsToBounds = YES;++ NSDictionary *textAttrs = @{NSForegroundColorAttributeName: [UIColor whiteColor], NSFontAttributeName: [UIFont systemFontOfSize:13 weight:UIFontWeightMedium]};+ [segment setTitleTextAttributes:textAttrs forState:UIControlStateNormal];+ [segment setTitleTextAttributes:textAttrs forState:UIControlStateSelected];++ objc_setAssociatedObject(segment, kYMSwitchKeyAssoc, item.key, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ [segment addTarget:self action:@selector(segmentChanged:) forControlEvents:UIControlEventValueChanged];++ segment.translatesAutoresizingMaskIntoConstraints = NO;+ [cell.contentView addSubview:segment];++ [NSLayoutConstraint activateConstraints:@[+ [titleLabel.leadingAnchor constraintEqualToAnchor:cell.contentView.leadingAnchor constant:16],+ [titleLabel.topAnchor constraintEqualToAnchor:cell.contentView.topAnchor constant:12],++ [segment.leadingAnchor constraintEqualToAnchor:cell.contentView.leadingAnchor constant:16],+ [segment.trailingAnchor constraintEqualToAnchor:cell.contentView.trailingAnchor constant:-16],+ [segment.topAnchor constraintEqualToAnchor:titleLabel.bottomAnchor constant:10],+ [segment.bottomAnchor constraintEqualToAnchor:cell.contentView.bottomAnchor constant:-12],+ [segment.heightAnchor constraintEqualToConstant:36]+ ]];++ return cell;+}++#pragma mark - Image Segment Cell++- (UITableViewCell *)imageSegmentCellForItem:(YMSettingsItem *)item tableView:(UITableView *)tableView {+ UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];+ cell.backgroundColor = [UIColor clearColor];+ cell.selectionStyle = UITableViewCellSelectionStyleNone;++ UILabel *titleLabel = [[UILabel alloc] init];+ titleLabel.text = item.title;+ titleLabel.textColor = [self ymTextColor];+ titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];+ titleLabel.translatesAutoresizingMaskIntoConstraints = NO;+ [cell.contentView addSubview:titleLabel];++ NSMutableArray *segItems = [NSMutableArray array];+ for (NSUInteger i = 0; i < item.segmentImages.count; i++) {+ [segItems addObject:@""];+ }+ UISegmentedControl *segment = [[UISegmentedControl alloc] initWithItems:segItems];++ for (NSInteger i = 0; i < (NSInteger)item.segmentImages.count; i++) {+ UIImage *img = item.segmentImages[i];+ if (img) [segment setImage:img forSegmentAtIndex:i];+ }++ id storedVal = [[NSUserDefaults standardUserDefaults] objectForKey:item.key];+ NSInteger idx = storedVal ? [storedVal integerValue] : item.pickerDefault;+ segment.selectedSegmentIndex = MAX(0, MIN(idx, segment.numberOfSegments - 1));+ segment.backgroundColor = [UIColor colorWithRed:0.13 green:0.13 blue:0.13 alpha:1.0];+ segment.selectedSegmentTintColor = [UIColor colorWithRed:0.25 green:0.25 blue:0.25 alpha:1.0];+ segment.layer.cornerRadius = 8.0;+ segment.clipsToBounds = YES;++ objc_setAssociatedObject(segment, kYMSwitchKeyAssoc, item.key, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ [segment addTarget:self action:@selector(segmentChanged:) forControlEvents:UIControlEventValueChanged];++ segment.translatesAutoresizingMaskIntoConstraints = NO;+ [cell.contentView addSubview:segment];++ [NSLayoutConstraint activateConstraints:@[+ [titleLabel.leadingAnchor constraintEqualToAnchor:cell.contentView.leadingAnchor constant:16],+ [titleLabel.topAnchor constraintEqualToAnchor:cell.contentView.topAnchor constant:12],++ [segment.leadingAnchor constraintEqualToAnchor:cell.contentView.leadingAnchor constant:16],+ [segment.trailingAnchor constraintEqualToAnchor:cell.contentView.trailingAnchor constant:-16],+ [segment.topAnchor constraintEqualToAnchor:titleLabel.bottomAnchor constant:10],+ [segment.bottomAnchor constraintEqualToAnchor:cell.contentView.bottomAnchor constant:-12],+ [segment.heightAnchor constraintEqualToConstant:36]+ ]];++ return cell;+}++#pragma mark - Picker Cell++- (void)updatePickerButton:(UIButton *)menuButton item:(YMSettingsItem *)item {+ NSInteger safeDefault = (item.pickerDefault >= 0 && item.pickerDefault < (NSInteger)item.pickerOptions.count)+ ? item.pickerDefault : 0;+ id storedValue = [[NSUserDefaults standardUserDefaults] objectForKey:item.key];+ NSInteger currentValue = storedValue ? [storedValue integerValue] : safeDefault;+ NSString *currentTitle = (currentValue >= 0 && currentValue < (NSInteger)item.pickerOptions.count)+ ? item.pickerOptions[currentValue]+ : item.pickerOptions[safeDefault];++ if (@available(iOS 15.0, *)) {+ UIButtonConfiguration *config = [UIButtonConfiguration plainButtonConfiguration];+ config.title = currentTitle;+ config.image = [UIImage systemImageNamed:@"chevron.up.chevron.down" withConfiguration:[UIImageSymbolConfiguration configurationWithPointSize:11 weight:UIImageSymbolWeightMedium]];+ config.imagePlacement = NSDirectionalRectEdgeTrailing;+ config.imagePadding = 6.0;+ config.baseForegroundColor = [self ymSecondaryColor];+ config.contentInsets = NSDirectionalEdgeInsetsMake(6, 8, 6, 8);+ menuButton.configuration = config;+ } else {+ [menuButton setTitle:currentTitle forState:UIControlStateNormal];+ [menuButton setTitleColor:[self ymSecondaryColor] forState:UIControlStateNormal];+ menuButton.titleLabel.font = [UIFont systemFontOfSize:15];+ [menuButton setImage:[UIImage systemImageNamed:@"chevron.up.chevron.down"] forState:UIControlStateNormal];+ menuButton.tintColor = [self ymSecondaryColor];+ menuButton.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;+ menuButton.imageEdgeInsets = UIEdgeInsetsMake(0, 6, 0, -6);+ }++ NSMutableArray<UIMenuElement *> *menuActions = [NSMutableArray array];+ __weak typeof(self) weakSelf = self;+ __weak typeof(menuButton) weakButton = menuButton;+ for (NSInteger i = 0; i < (NSInteger)item.pickerOptions.count; i++) {+ NSString *optionTitle = item.pickerOptions[i];+ NSString *itemKey = item.key;+ UIAction *action = [UIAction actionWithTitle:optionTitle image:nil identifier:nil handler:^(__kindof UIAction *a) {+ [[NSUserDefaults standardUserDefaults] setInteger:i forKey:itemKey];+ if (weakButton) {+ [weakSelf updatePickerButton:weakButton item:item];+ }+ [weakSelf updateDisplayedItemsAnimated:YES];+ }];+ action.state = (i == currentValue) ? UIMenuElementStateOn : UIMenuElementStateOff;+ [menuActions addObject:action];+ }++ menuButton.menu = [UIMenu menuWithTitle:item.title ?: @"" children:menuActions];+}++- (UITableViewCell *)pickerCellForItem:(YMSettingsItem *)item tableView:(UITableView *)tableView {+ UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];+ cell.backgroundColor = [UIColor clearColor];+ cell.selectionStyle = UITableViewCellSelectionStyleNone;++ UIStackView *labelStack = [[UIStackView alloc] init];+ labelStack.axis = UILayoutConstraintAxisVertical;+ labelStack.spacing = 2.0;+ labelStack.alignment = UIStackViewAlignmentLeading;+ labelStack.translatesAutoresizingMaskIntoConstraints = NO;++ UILabel *titleLabel = [[UILabel alloc] init];+ titleLabel.text = item.title;+ titleLabel.textColor = [self ymTextColor];+ titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];+ titleLabel.numberOfLines = 0;+ [labelStack addArrangedSubview:titleLabel];++ if (item.subtitle.length > 0) {+ UILabel *subLabel = [[UILabel alloc] init];+ subLabel.text = item.subtitle;+ subLabel.textColor = [self ymSecondaryColor];+ subLabel.font = [UIFont systemFontOfSize:13];+ subLabel.numberOfLines = 0;+ [labelStack addArrangedSubview:subLabel];+ }++ UIButton *menuButton = [UIButton buttonWithType:UIButtonTypeSystem];+ menuButton.translatesAutoresizingMaskIntoConstraints = NO;+ menuButton.showsMenuAsPrimaryAction = YES;+ [menuButton setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];+ [menuButton setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];++ [self updatePickerButton:menuButton item:item];++ [cell.contentView addSubview:labelStack];+ [cell.contentView addSubview:menuButton];++ [NSLayoutConstraint activateConstraints:@[+ [labelStack.leadingAnchor constraintEqualToAnchor:cell.contentView.leadingAnchor constant:16],+ [labelStack.topAnchor constraintGreaterThanOrEqualToAnchor:cell.contentView.topAnchor constant:12],+ [labelStack.bottomAnchor constraintLessThanOrEqualToAnchor:cell.contentView.bottomAnchor constant:-12],+ [labelStack.centerYAnchor constraintEqualToAnchor:cell.contentView.centerYAnchor],++ [menuButton.leadingAnchor constraintGreaterThanOrEqualToAnchor:labelStack.trailingAnchor constant:12],+ [menuButton.trailingAnchor constraintEqualToAnchor:cell.contentView.trailingAnchor constant:-16],+ [menuButton.centerYAnchor constraintEqualToAnchor:cell.contentView.centerYAnchor],+ [menuButton.topAnchor constraintGreaterThanOrEqualToAnchor:cell.contentView.topAnchor constant:8],+ [menuButton.bottomAnchor constraintLessThanOrEqualToAnchor:cell.contentView.bottomAnchor constant:-8]+ ]];++ return cell;+}++#pragma mark - Table View Footer++- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {+ return 0;+}++- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {+ return [[UIView alloc] init];+}++- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {+ return 16;+}++- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {+ return [[UIView alloc] init];+}++@end++#pragma mark - Settings Search++// A searchable group of YouMod (YMSettingsItem-based) settings: the group's+// display name plus its items. Registered by Settings.x so the search VC can build+// a flat index without knowing how each group's items are constructed.+@interface YMSettingsGroup : NSObject+@property (nonatomic, copy) NSString *title;+@property (nonatomic, copy) NSArray<YMSettingsItem *> *items;+@end+@implementation YMSettingsGroup+@end++@implementation YMSearchRow+@end++// The registered YouMod setting groups (excludes SponsorBlock, which contributes+// its own rows via sbSearchRows). Settings.x re-registers these each time the+// settings screen is built; registration dedupes by title (see below).+static NSMutableArray<YMSettingsGroup *> *gYMSearchGroups = nil;++void YMRegisterSettingsGroup(NSString *title, NSArray<YMSettingsItem *> *items) {+ if (!gYMSearchGroups) gYMSearchGroups = [NSMutableArray array];+ // Replace any prior registration for this title (idempotent) so re-opening the+ // settings screen — which rebuilds the section — doesn't duplicate index rows.+ for (YMSettingsGroup *existing in [gYMSearchGroups copy]) {+ if ([existing.title isEqualToString:title]) [gYMSearchGroups removeObject:existing];+ }+ YMSettingsGroup *group = [YMSettingsGroup new];+ group.title = title;+ group.items = items;+ [gYMSearchGroups addObject:group];+}++// Global settings search. Subclasses YMSubSettingsViewController to inherit every+// YMSettingsItem cell builder (toggle/slider/picker/segment) and its change+// handlers, so results are the live, editable controls. Rows that don't originate+// from a YMSettingsItem (SponsorBlock's action pickers and colour circles) are+// supplied as YMSearchRow objects that render themselves.+@interface YMSettingsSearchViewController : YMSubSettingsViewController <UISearchBarDelegate>+@end++static const void *kYMSearchAllRowsKey = &kYMSearchAllRowsKey;+static const void *kYMSearchFilteredRowsKey = &kYMSearchFilteredRowsKey;++@implementation YMSettingsSearchViewController++- (NSArray<YMSearchRow *> *)allRows { return objc_getAssociatedObject(self, kYMSearchAllRowsKey); }+- (void)setAllRows:(NSArray<YMSearchRow *> *)r { objc_setAssociatedObject(self, kYMSearchAllRowsKey, r, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }+- (NSArray<YMSearchRow *> *)filteredRows { return objc_getAssociatedObject(self, kYMSearchFilteredRowsKey); }+- (void)setFilteredRows:(NSArray<YMSearchRow *> *)r { objc_setAssociatedObject(self, kYMSearchFilteredRowsKey, r, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }++- (BOOL)usesPageSearch { return YES; }++// Wrap a YMSettingsItem as a search row rendered through the inherited cell builder.+- (YMSearchRow *)searchRowForItem:(YMSettingsItem *)item groupTitle:(NSString *)groupTitle {+ __weak typeof(self) weakSelf = self;+ YMSearchRow *row = [YMSearchRow new];+ NSString *sub = item.subtitle.length ? item.subtitle : @"";+ row.searchText = [NSString stringWithFormat:@"%@ %@ %@", item.title ?: @"", sub, groupTitle ?: @""];+ row.makeCell = ^UITableViewCell *(UITableView *tv) { return [weakSelf cellForItem:item tableView:tv]; };+ return row;+}++- (void)buildIndex {+ NSMutableArray<YMSearchRow *> *all = [NSMutableArray array];+ for (YMSettingsGroup *group in gYMSearchGroups) {+ for (YMSettingsItem *item in group.items) {+ // Headers and action rows (which navigate elsewhere) aren't settings to find.+ if (item.type == YMRowTypeHeader || item.type == YMRowTypeAction) continue;+ if (item.title.length == 0) continue;+ [all addObject:[self searchRowForItem:item groupTitle:group.title]];+ }+ }+ [all addObjectsFromArray:sbSearchRows(self)];+ self.allRows = all;+ self.filteredRows = @[];+}++- (void)viewDidLoad {+ [super viewDidLoad];+ [self buildIndex];+}++// Focus our own search bar once the page is actually on screen (becomeFirstResponder+// from viewDidLoad is unreliable — the bar isn't in the window yet), so the keyboard+// is up as soon as the search page appears.+- (void)viewDidAppear:(BOOL)animated {+ Class ytStyled = objc_getClass("YTStyledViewController");+ struct objc_super superStruct = { self, ytStyled ?: [UIViewController class] };+ ((void (*)(struct objc_super *, SEL, BOOL))objc_msgSendSuper)(&superStruct, @selector(viewDidAppear:), animated);++ dispatch_async(dispatch_get_main_queue(), ^{+ [self.searchBar becomeFirstResponder];+ });+}++- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {+ NSString *query = [searchText stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];+ if (query.length == 0) {+ self.filteredRows = @[];+ } else {+ NSMutableArray<YMSearchRow *> *matches = [NSMutableArray array];+ NSStringCompareOptions opts = NSCaseInsensitiveSearch | NSDiacriticInsensitiveSearch;+ for (YMSearchRow *row in self.allRows) {+ if ([row.searchText rangeOfString:query options:opts].location != NSNotFound) {+ [matches addObject:row];+ }+ }+ self.filteredRows = matches;+ }+ [self.tableView reloadData];+}++- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {+ searchBar.text = @"";+ self.filteredRows = @[];+ [searchBar resignFirstResponder];+ [self.tableView reloadData];+}++- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {+ return self.filteredRows.count;+}++- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {+ return self.filteredRows[indexPath.row].makeCell(tableView);+}++- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {+ CGFloat h = self.filteredRows[indexPath.row].cellHeight;+ return h > 0 ? h : UITableViewAutomaticDimension;+}++- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {+ [tableView deselectRowAtIndexPath:indexPath animated:YES];+ YMSearchRow *row = self.filteredRows[indexPath.row];+ if (!row.onSelect) return;+ __weak typeof(self) weakSelf = self;+ row.onSelect(self, ^{ [weakSelf.tableView reloadData]; });+}++@end++// Push the global settings search page onto the native settings nav stack.+void YMPushSettingsSearch(id settingsVC, id parentResponder) {+ Class styledClass = objc_getClass("YMSettingsSearchViewControllerStyled");+ if (!styledClass) styledClass = [YMSettingsSearchViewController class];++ YMSettingsSearchViewController *vc = (YMSettingsSearchViewController *)((id (*)(id, SEL, id))objc_msgSend)([styledClass alloc], @selector(initWithParentResponder:), parentResponder);+ if (!vc) vc = [[styledClass alloc] init];+ vc.navTitle = LOC(@"SEARCH");+ [settingsVC pushViewController:vc];+}++#pragma mark - Convenience Factory Functions++YMSettingsItem *YMToggle(NSString *title, NSString *subtitle, NSString *key) {+ return [YMSettingsItem toggleWithTitle:title subtitle:subtitle key:key];+}++YMSettingsItem *YMSlider(NSString *title, NSString *subtitle, NSString *key, float min, float max, float step, float defaultValue) {+ return [YMSettingsItem sliderWithTitle:title subtitle:subtitle key:key min:min max:max step:step defaultValue:defaultValue];+}++YMSettingsItem *YMPicker(NSString *title, NSString *subtitle, NSString *key, NSArray<NSString *> *options, NSInteger defaultValue) {+ return [YMSettingsItem pickerWithTitle:title subtitle:subtitle key:key options:options defaultValue:defaultValue];+}++YMSettingsItem *YMAction(NSString *title, NSString *subtitle, void (^action)(UIViewController *vc)) {+ return [YMSettingsItem actionWithTitle:title subtitle:subtitle action:action];+}++YMSettingsItem *YMHeader(NSString *title) {+ return [YMSettingsItem headerWithTitle:title];+}++YMSettingsItem *YMSegment(NSString *title, NSString *key, NSArray<NSNumber *> *icons, NSInteger defaultValue) {+ return [YMSettingsItem segmentWithTitle:title key:key icons:icons defaultValue:defaultValue];+}++YMSettingsItem *YMTextSegment(NSString *title, NSString *key, NSArray<NSString *> *labels, NSInteger defaultValue) {+ return [YMSettingsItem textSegmentWithTitle:title key:key labels:labels defaultValue:defaultValue];+}++YMSettingsItem *YMImageSegment(NSString *title, NSString *key, NSArray<UIImage *> *images, NSInteger defaultValue) {+ return [YMSettingsItem imageSegmentWithTitle:title key:key images:images defaultValue:defaultValue];+}++#pragma mark - YMTabOrderViewController++static NSString * const kYMTabIDs[] = {+ @"home", @"shorts", @"create", @"subscriptions", @"library", @"history", @"gaming", @"sports", @"notifications", @"news", @"music", @"watchlater", @"playlist", @"like", @"live", @"post", @"video", @"movie", @"course", @"minigame", @"fashion", @"learning"+};+static const NSInteger kYMTabCount = 22;+static const NSInteger kYMTabMaxEnabled = 6;+static const NSInteger kYMTabMinEnabled = 1;++@interface YMTabOrderViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>+- (UITableView *)tableView;+- (void)setTableView:(UITableView *)tv;+- (NSMutableArray<NSMutableDictionary *> *)tabData;+- (void)setTabData:(NSMutableArray<NSMutableDictionary *> *)data;+- (NSArray *)initialSnapshot;+- (void)setInitialSnapshot:(NSArray *)snap;+@end++static const void *kYMTabTableViewKey = &kYMTabTableViewKey;+static const void *kYMTabDataKey = &kYMTabDataKey;+static const void *kYMTabSnapshotKey = &kYMTabSnapshotKey;+// Saved copies of the shared navigation bar's appearance, restored when this+// screen is dismissed. This screen installs its own opaque navigation bar+// appearance; because that appearance is shared, leaving it in place would repaint+// the previous screen's back button with the appearance's default (blue) tint.+static const void *kYMTabSavedStdAppearanceKey = &kYMTabSavedStdAppearanceKey;+static const void *kYMTabSavedScrollEdgeAppearanceKey = &kYMTabSavedScrollEdgeAppearanceKey;++@implementation YMTabOrderViewController++- (UITableView *)tableView { return objc_getAssociatedObject(self, kYMTabTableViewKey); }+- (void)setTableView:(UITableView *)tv { objc_setAssociatedObject(self, kYMTabTableViewKey, tv, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }+- (NSMutableArray<NSMutableDictionary *> *)tabData { return objc_getAssociatedObject(self, kYMTabDataKey); }+- (void)setTabData:(NSMutableArray<NSMutableDictionary *> *)data { objc_setAssociatedObject(self, kYMTabDataKey, data, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }+- (NSArray *)initialSnapshot { return objc_getAssociatedObject(self, kYMTabSnapshotKey); }+- (void)setInitialSnapshot:(NSArray *)snap { objc_setAssociatedObject(self, kYMTabSnapshotKey, snap, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }++- (NSString *)localizedNameForTabID:(NSString *)tabID {+ if ([tabID isEqualToString:@"home"]) return LOC(@"HOME_TAB");+ if ([tabID isEqualToString:@"shorts"]) return LOC(@"SHORTS_TAB");+ if ([tabID isEqualToString:@"create"]) return LOC(@"CREATE_TAB");+ if ([tabID isEqualToString:@"subscriptions"]) return LOC(@"SUBSCRIPTIONS_TAB");+ if ([tabID isEqualToString:@"library"]) return LOC(@"LIBRARY_TAB");+ if ([tabID isEqualToString:@"history"]) return LOC(@"HISTORY_TAB");+ if ([tabID isEqualToString:@"gaming"]) return LOC(@"GAMING_TAB");+ if ([tabID isEqualToString:@"sports"]) return LOC(@"SPORTS_TAB");+ if ([tabID isEqualToString:@"notifications"]) return LOC(@"NOTI_TAB");+ if ([tabID isEqualToString:@"news"]) return LOC(@"NEWS_TAB");+ if ([tabID isEqualToString:@"music"]) return LOC(@"MUSIC_TAB");+ if ([tabID isEqualToString:@"watchlater"]) return LOC(@"WATCH_LATER_TAB");+ if ([tabID isEqualToString:@"playlist"]) return LOC(@"PLAYLIST_TAB");+ if ([tabID isEqualToString:@"like"]) return LOC(@"LIKE_TAB");+ if ([tabID isEqualToString:@"live"]) return LOC(@"LIVE_TAB");+ if ([tabID isEqualToString:@"post"]) return LOC(@"POST_TAB");+ if ([tabID isEqualToString:@"video"]) return LOC(@"VIDEO_TAB");+ if ([tabID isEqualToString:@"movie"]) return LOC(@"MOVIE_TAB");+ if ([tabID isEqualToString:@"course"]) return LOC(@"COURSE_TAB");+ if ([tabID isEqualToString:@"minigame"]) return LOC(@"MINIGAME_TAB");+ if ([tabID isEqualToString:@"fashion"]) return LOC(@"FASHION_TAB");+ if ([tabID isEqualToString:@"learning"]) return LOC(@"LEARNING_TAB");+ return tabID;+}++- (UIImage *)iconForTabID:(NSString *)tabID {+ static YTAssetLoader *cachedLoader = nil;+ static dispatch_once_t onceToken;+ dispatch_once(&onceToken, ^{+ cachedLoader = [[%c(YTAssetLoader) alloc] initWithBundle:YouModBundle()];+ });++ if ([tabID isEqualToString:@"create"]) {+ UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:18 weight:UIImageSymbolWeightMedium];+ return [[UIImage systemImageNamed:@"plus" withConfiguration:config] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];+ }+ NSDictionary *ytIconTypes = @{@"home": @(65), @"shorts": @(769), @"subscriptions": @(66), @"library": @(61)};+ NSDictionary *bundleIcons = @{@"history": @"icons/history", @"gaming": @"icons/gaming", @"sports": @"icons/sports", @"notifications": @"icons/noti", @"news": @"icons/news", @"music": @"icons/music", @"watchlater": @"icons/watchlater", @"playlist": @"icons/playlist", @"like": @"icons/like", @"live": @"icons/live", @"post": @"icons/post", @"video": @"icons/video", @"movie": @"icons/movie", @"course": @"icons/course", @"minigame": @"icons/minigame", @"fashion": @"icons/fashion", @"learning": @"icons/learning"};++ NSNumber *iconType = ytIconTypes[tabID];+ if (iconType) {+ YTIIcon *icon = [%c(YTIIcon) new];+ if (icon) {+ ((void (*)(id, SEL, int))objc_msgSend)(icon, @selector(setIconType:), [iconType intValue]);+ if ([icon respondsToSelector:@selector(iconImageWithColor:)]) {+ return [[icon iconImageWithColor:[UIColor whiteColor]] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];+ }+ }+ }++ NSString *bundleName = bundleIcons[tabID];+ if (bundleName && cachedLoader) {+ UIImage *img = [cachedLoader imageNamed:bundleName];+ if (img) return [img imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];+ }++ return nil;+}++- (void)viewDidLoad {+ Class ytStyled = objc_getClass("YTStyledViewController");+ struct objc_super superStruct = { self, ytStyled ?: [UIViewController class] };+ ((void (*)(struct objc_super *, SEL))objc_msgSendSuper)(&superStruct, @selector(viewDidLoad));++ self.title = LOC(@"MANAGE_TABS");+ [self loadTabData];+ [self takeSnapshot];++ // The previous screen's navigation bar appearance is saved before this screen+ // installs its own opaque appearance, and restored on dismissal so that screen+ // keeps its own back-button tint.+ UINavigationBar *sharedNavBar = self.navigationController.navigationBar;+ objc_setAssociatedObject(self, kYMTabSavedStdAppearanceKey, sharedNavBar.standardAppearance, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ objc_setAssociatedObject(self, kYMTabSavedScrollEdgeAppearanceKey, sharedNavBar.scrollEdgeAppearance, OBJC_ASSOCIATION_RETAIN_NONATOMIC);++ // Configure navigation bar appearance with solid color+ UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];+ [appearance configureWithDefaultBackground];+ if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {+ appearance.backgroundColor = [%c(YTColor) black3];+ } else {+ appearance.backgroundColor = [UIColor systemBackgroundColor];+ }+ self.navigationController.navigationBar.standardAppearance = appearance;+ self.navigationController.navigationBar.scrollEdgeAppearance = appearance;++ self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];+ self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;+ self.tableView.delegate = self;+ self.tableView.dataSource = self;+ self.tableView.editing = YES;+ self.tableView.allowsSelectionDuringEditing = NO;+ self.tableView.estimatedRowHeight = 56;+ self.tableView.rowHeight = UITableViewAutomaticDimension;++ if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {+ self.tableView.backgroundColor = [%c(YTColor) black3];+ } else {+ self.tableView.backgroundColor = [UIColor systemBackgroundColor];+ }++ [self.view addSubview:self.tableView];+}++- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {+ [super traitCollectionDidChange:previousTraitCollection];+ if (previousTraitCollection.userInterfaceStyle != self.traitCollection.userInterfaceStyle) {+ self.tableView.backgroundColor = (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark)+ ? [%c(YTColor) black3]+ : [UIColor systemBackgroundColor];++ // Update navigation bar appearance for dark/light mode+ UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];+ [appearance configureWithDefaultBackground];+ if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {+ appearance.backgroundColor = [%c(YTColor) black3];+ } else {+ appearance.backgroundColor = [UIColor systemBackgroundColor];+ }+ self.navigationController.navigationBar.standardAppearance = appearance;+ self.navigationController.navigationBar.scrollEdgeAppearance = appearance;++ [self.tableView reloadData];+ }+}++- (void)viewWillAppear:(BOOL)animated {+ Class ytStyled = objc_getClass("YTStyledViewController");+ struct objc_super superStruct = { self, ytStyled ?: [UIViewController class] };+ ((void (*)(struct objc_super *, SEL, BOOL))objc_msgSendSuper)(&superStruct, @selector(viewWillAppear:), animated);+}++- (void)viewWillDisappear:(BOOL)animated {+ Class ytStyled = objc_getClass("YTStyledViewController");+ struct objc_super superStruct = { self, ytStyled ?: [UIViewController class] };+ ((void (*)(struct objc_super *, SEL, BOOL))objc_msgSendSuper)(&superStruct, @selector(viewWillDisappear:), animated);++ // Restore the previous screen's saved navigation bar appearance so it keeps+ // its own back-button tint rather than this screen's opaque appearance.+ UINavigationBar *navBar = self.navigationController.navigationBar;+ navBar.standardAppearance = objc_getAssociatedObject(self, kYMTabSavedStdAppearanceKey);+ navBar.scrollEdgeAppearance = objc_getAssociatedObject(self, kYMTabSavedScrollEdgeAppearanceKey);+}++- (void)viewDidLayoutSubviews {+ Class ytStyled = objc_getClass("YTStyledViewController");+ struct objc_super superStruct = { self, ytStyled ?: [UIViewController class] };+ ((void (*)(struct objc_super *, SEL))objc_msgSendSuper)(&superStruct, @selector(viewDidLayoutSubviews));+ YTQTMButton *backButton = [self valueForKey:@"_backButton"];++ if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {+ backButton.tintColor = [UIColor whiteColor];+ } else {+ backButton.tintColor = [UIColor blackColor];+ }+}++- (void)loadTabData {+ NSArray *savedOrder = [[NSUserDefaults standardUserDefaults] arrayForKey:TabOrder];+ NSMutableArray *data = [NSMutableArray array];++ if (savedOrder.count > 0) {+ for (NSDictionary *entry in savedOrder) {+ NSString *tabID = entry[@"id"];+ BOOL enabled = [entry[@"enabled"] boolValue];+ if (tabID) {+ [data addObject:[@{@"id": tabID, @"enabled": @(enabled)} mutableCopy]];+ }+ }+ // Add any new tabs not in saved data+ for (NSInteger i = 0; i < kYMTabCount; i++) {+ NSString *tabID = kYMTabIDs[i];+ BOOL found = NO;+ for (NSDictionary *d in data) {+ if ([d[@"id"] isEqualToString:tabID]) { found = YES; break; }+ }+ if (!found) {+ [data addObject:[@{@"id": tabID, @"enabled": @NO} mutableCopy]];+ }+ }+ } else {+ // Default: Home, Shorts, Create, Subscriptions, Library enabled+ for (NSInteger i = 0; i < kYMTabCount; i++) {+ BOOL defaultEnabled = i < 5;+ [data addObject:[@{@"id": kYMTabIDs[i], @"enabled": @(defaultEnabled)} mutableCopy]];+ }+ }++ self.tabData = data;+}++- (void)saveTabData {+ NSMutableArray *toSave = [NSMutableArray array];+ for (NSMutableDictionary *entry in self.tabData) {+ [toSave addObject:@{@"id": entry[@"id"], @"enabled": entry[@"enabled"]}];+ }+ [[NSUserDefaults standardUserDefaults] setObject:toSave forKey:TabOrder];+ [[NSUserDefaults standardUserDefaults] synchronize];+ [[NSNotificationCenter defaultCenter] postNotificationName:@"YouModUpdateTabBar" object:nil];+}++- (void)takeSnapshot {+ NSMutableArray *snap = [NSMutableArray array];+ for (NSDictionary *entry in self.tabData) {+ [snap addObject:@{@"id": entry[@"id"], @"enabled": entry[@"enabled"]}];+ }+ self.initialSnapshot = [snap copy];+}++- (NSInteger)enabledCount {+ NSInteger count = 0;+ for (NSDictionary *entry in self.tabData) {+ if ([entry[@"enabled"] boolValue]) count++;+ }+ return count;+}++#pragma mark - UITableViewDataSource++- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; }++- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {+ return self.tabData.count;+}++- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {+ static NSString *cellID = @"YMTabCell";+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];+ UISwitch *sw;++ if (!cell) {+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];+ cell.backgroundColor = [UIColor clearColor];+ cell.selectionStyle = UITableViewCellSelectionStyleNone;++ sw = [[UISwitch alloc] init];+ sw.onTintColor = [UIColor colorWithRed:0.6 green:0.2 blue:0.9 alpha:1.0];+ [sw addTarget:self action:@selector(tabToggleChanged:) forControlEvents:UIControlEventValueChanged];+ sw.translatesAutoresizingMaskIntoConstraints = NO;+ sw.tag = 999;+ [cell.contentView addSubview:sw];++ [NSLayoutConstraint activateConstraints:@[+ [sw.centerYAnchor constraintEqualToAnchor:cell.contentView.centerYAnchor],+ [sw.trailingAnchor constraintEqualToAnchor:cell.contentView.trailingAnchor constant:-16]+ ]];+ } else {+ sw = [cell.contentView viewWithTag:999];+ }++ NSMutableDictionary *entry = self.tabData[indexPath.row];+ NSString *tabID = entry[@"id"];+ BOOL enabled = [entry[@"enabled"] boolValue];++ cell.textLabel.text = [self localizedNameForTabID:tabID];+ cell.textLabel.textColor = [UIColor labelColor];+ cell.textLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];++ UIImage *tabIcon = [self iconForTabID:tabID];+ cell.imageView.image = tabIcon;+ cell.imageView.tintColor = [UIColor labelColor];++ sw.on = enabled;+ objc_setAssociatedObject(sw, kYMSwitchKeyAssoc, tabID, OBJC_ASSOCIATION_RETAIN_NONATOMIC);++ return cell;+}++- (void)tabToggleChanged:(UISwitch *)sender {+ NSString *tabID = objc_getAssociatedObject(sender, kYMSwitchKeyAssoc);+ if (!tabID) return;++ NSMutableDictionary *entry = nil;+ for (NSMutableDictionary *d in self.tabData) {+ if ([d[@"id"] isEqualToString:tabID]) { entry = d; break; }+ }+ if (!entry) return;++ BOOL wantsEnabled = sender.on;++ if (wantsEnabled && [self enabledCount] >= kYMTabMaxEnabled) {+ sender.on = NO;+ YTAlertView *alert = [%c(YTAlertView) infoDialog];+ alert.title = LOC(@"TAB_LIMIT");+ alert.subtitle = LOC(@"TAB_LIMIT_DESC");+ [alert show];+ return;+ } else if (!wantsEnabled && [self enabledCount] <= kYMTabMinEnabled) {+ sender.on = YES;+ YTAlertView *alert = [%c(YTAlertView) infoDialog];+ alert.title = LOC(@"WARNING");+ alert.subtitle = LOC(@"ZERO_TAB_DESC");+ [alert show];+ return;+ }++ entry[@"enabled"] = @(wantsEnabled);+ [self saveTabData];+}++#pragma mark - Reordering++- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { return YES; }++- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)from toIndexPath:(NSIndexPath *)to {+ NSMutableDictionary *item = self.tabData[from.row];+ [self.tabData removeObjectAtIndex:from.row];+ [self.tabData insertObject:item atIndex:to.row];+ [self saveTabData];+}++- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {+ return UITableViewCellEditingStyleNone;+}++- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath {+ return NO;+}++#pragma mark - Section Header/Footer++- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {+ return UITableViewAutomaticDimension;+}++- (UIColor *)ymSecondaryColor {+ return [UIColor colorWithWhite:0.55 alpha:1.0];+}++- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {+ UIView *headerView = [[UIView alloc] init];+ headerView.backgroundColor = [UIColor clearColor];++ UILabel *hintLabel = [[UILabel alloc] init];+ hintLabel.text = LOC(@"TAB_REORDER_HINT");+ hintLabel.textColor = [self ymSecondaryColor];+ hintLabel.font = [UIFont systemFontOfSize:13];+ hintLabel.numberOfLines = 0;+ hintLabel.translatesAutoresizingMaskIntoConstraints = NO;+ [headerView addSubview:hintLabel];++ [NSLayoutConstraint activateConstraints:@[+ [hintLabel.leadingAnchor constraintEqualToAnchor:headerView.leadingAnchor constant:16],+ [hintLabel.trailingAnchor constraintEqualToAnchor:headerView.trailingAnchor constant:-16],+ [hintLabel.topAnchor constraintEqualToAnchor:headerView.topAnchor constant:12],+ [hintLabel.bottomAnchor constraintEqualToAnchor:headerView.bottomAnchor constant:-12]+ ]];++ return headerView;+}++- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { return 0; }+- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { return [[UIView alloc] init]; }++@end++void YMPushTabOrder(id settingsVC, id parentResponder) {+ Class styledClass = objc_getClass("YMTabOrderViewControllerStyled");+ if (!styledClass) styledClass = [YMTabOrderViewController class];++ YMTabOrderViewController *vc = (YMTabOrderViewController *)((id (*)(id, SEL, id))objc_msgSend)([styledClass alloc], @selector(initWithParentResponder:), parentResponder);+ if (!vc) vc = [[styledClass alloc] init];+ [settingsVC pushViewController:vc];+}++// Modal entry point for opening Manage Tabs without a YTSettingsViewController nav stack+// (used by the long-press gesture on the Home tab). Wraps the standard tab-order VC in+// a UINavigationController with a Done button and presents from the topmost VC.+void YMPresentTabOrderModally(id parentResponder) {+ Class styledClass = objc_getClass("YMTabOrderViewControllerStyled");+ if (!styledClass) styledClass = [YMTabOrderViewController class];++ YMTabOrderViewController *vc = (YMTabOrderViewController *)((id (*)(id, SEL, id))objc_msgSend)([styledClass alloc], @selector(initWithParentResponder:), parentResponder);+ if (!vc) vc = [[styledClass alloc] init];++ UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];+ nav.modalPresentationStyle = UIModalPresentationFormSheet;++ UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];+ [appearance configureWithDefaultBackground];+ appearance.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {+ if (traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {+ return [%c(YTColor) black3];+ } else {+ return [UIColor systemBackgroundColor];+ }+ }];++ nav.navigationBar.standardAppearance = appearance;+ nav.navigationBar.scrollEdgeAppearance = appearance;+ nav.navigationBar.compactAppearance = appearance;++ __weak UINavigationController *weakNav = nav;+ UIAction *doneAction = [UIAction actionWithTitle:@"" image:nil identifier:nil handler:^(__unused UIAction *action) {+ [weakNav dismissViewControllerAnimated:YES completion:nil];+ }];+ vc.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]+ initWithBarButtonSystemItem:UIBarButtonSystemItemDone+ primaryAction:doneAction];++ UIViewController *presenter = YouModTopViewController(nil);+ if (!presenter) return;+ [presenter presentViewController:nav animated:YES completion:nil];+}++#pragma mark - YMOverlayButtonOrderViewController++static NSString * const kYMOverlayButtonIDs[] = {+ @"sponsorblock.toggle",+ @"download.video",+ @"mute.video",+ @"speed.video",+ @"quality.video",+ @"share.video",+ @"loop.video",+ @"caption.video"+};+static const NSInteger kYMOverlayButtonCount = 8;++@interface YMOverlayButtonOrderViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>+- (UITableView *)tableView;+- (void)setTableView:(UITableView *)tv;+- (NSMutableArray<NSMutableDictionary *> *)buttonData;+- (void)setButtonData:(NSMutableArray<NSMutableDictionary *> *)data;+- (NSArray *)initialSnapshot;+- (void)setInitialSnapshot:(NSArray *)snap;+@end++static const void *kYMOverlayTableViewKey = &kYMOverlayTableViewKey;+static const void *kYMOverlayButtonDataKey = &kYMOverlayButtonDataKey;+static const void *kYMOverlayButtonSnapshotKey = &kYMOverlayButtonSnapshotKey;+static const void *kYMOverlaySavedStdAppearanceKey = &kYMOverlaySavedStdAppearanceKey;+static const void *kYMOverlaySavedScrollEdgeAppearanceKey = &kYMOverlaySavedScrollEdgeAppearanceKey;++@implementation YMOverlayButtonOrderViewController++- (UITableView *)tableView { return objc_getAssociatedObject(self, kYMOverlayTableViewKey); }+- (void)setTableView:(UITableView *)tv { objc_setAssociatedObject(self, kYMOverlayTableViewKey, tv, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }+- (NSMutableArray<NSMutableDictionary *> *)buttonData { return objc_getAssociatedObject(self, kYMOverlayButtonDataKey); }+- (void)setButtonData:(NSMutableArray<NSMutableDictionary *> *)data { objc_setAssociatedObject(self, kYMOverlayButtonDataKey, data, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }+- (NSArray *)initialSnapshot { return objc_getAssociatedObject(self, kYMOverlayButtonSnapshotKey); }+- (void)setInitialSnapshot:(NSArray *)snap { objc_setAssociatedObject(self, kYMOverlayButtonSnapshotKey, snap, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }++- (NSString *)localizedNameForButtonID:(NSString *)buttonID {+ if ([buttonID isEqualToString:@"sponsorblock.toggle"]) return LOC(@"SPONSORBLOCK_BUTTON");+ if ([buttonID isEqualToString:@"download.video"]) return LOC(@"DOWNLOAD_BUTTON");+ if ([buttonID isEqualToString:@"mute.video"]) return LOC(@"MUTE_BUTTON");+ if ([buttonID isEqualToString:@"speed.video"]) return LOC(@"SPEED_BUTTON");+ if ([buttonID isEqualToString:@"quality.video"]) return LOC(@"QUALITY_BUTTON");+ if ([buttonID isEqualToString:@"share.video"]) return LOC(@"SHARE_BUTTON");+ if ([buttonID isEqualToString:@"loop.video"]) return LOC(@"LOOP_BUTTON");+ if ([buttonID isEqualToString:@"caption.video"]) return LOC(@"CAPTION_BUTTON");+ return buttonID;+}++- (UIImage *)iconForButtonID:(NSString *)buttonID {+ if ([buttonID isEqualToString:@"quality.video"]) {+ NSDictionary *attrs = @{+ NSFontAttributeName: [UIFont systemFontOfSize:14 weight:UIFontWeightBold],+ NSForegroundColorAttributeName: [UIColor whiteColor]+ };+ CGSize size = [@"HD" sizeWithAttributes:attrs];+ UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:CGSizeMake(ceil(size.width), ceil(size.height))];+ UIImage *img = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull context) {+ [@"HD" drawAtPoint:CGPointZero withAttributes:attrs];+ }];+ return [img imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];+ }++ NSString *symbol = @"circle";+ if ([buttonID isEqualToString:@"sponsorblock.toggle"]) symbol = @"shield.fill";+ else if ([buttonID isEqualToString:@"download.video"]) symbol = @"arrow.down.circle";+ else if ([buttonID isEqualToString:@"mute.video"]) symbol = @"speaker.wave.2";+ else if ([buttonID isEqualToString:@"speed.video"]) symbol = @"speedometer";+ else if ([buttonID isEqualToString:@"share.video"]) symbol = @"arrowshape.turn.up.right";+ else if ([buttonID isEqualToString:@"loop.video"]) symbol = @"repeat";+ else if ([buttonID isEqualToString:@"caption.video"]) symbol = @"captions.bubble";++ UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:18 weight:UIImageSymbolWeightMedium];+ return [[UIImage systemImageNamed:symbol withConfiguration:config] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];+}++- (void)viewDidLoad {+ Class ytStyled = objc_getClass("YTStyledViewController");+ struct objc_super superStruct = { self, ytStyled ?: [UIViewController class] };+ ((void (*)(struct objc_super *, SEL))objc_msgSendSuper)(&superStruct, @selector(viewDidLoad));++ self.title = LOC(@"MANAGE_OVERLAY_BUTTONS");+ [self loadButtonData];+ [self takeSnapshot];++ UINavigationBar *sharedNavBar = self.navigationController.navigationBar;+ objc_setAssociatedObject(self, kYMOverlaySavedStdAppearanceKey, sharedNavBar.standardAppearance, OBJC_ASSOCIATION_RETAIN_NONATOMIC);+ objc_setAssociatedObject(self, kYMOverlaySavedScrollEdgeAppearanceKey, sharedNavBar.scrollEdgeAppearance, OBJC_ASSOCIATION_RETAIN_NONATOMIC);++ UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];+ [appearance configureWithDefaultBackground];+ if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {+ appearance.backgroundColor = [%c(YTColor) black3];+ } else {+ appearance.backgroundColor = [UIColor systemBackgroundColor];+ }+ self.navigationController.navigationBar.standardAppearance = appearance;+ self.navigationController.navigationBar.scrollEdgeAppearance = appearance;++ self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];+ self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;+ self.tableView.delegate = self;+ self.tableView.dataSource = self;+ self.tableView.editing = YES;+ self.tableView.allowsSelectionDuringEditing = NO;+ self.tableView.estimatedRowHeight = 56;+ self.tableView.rowHeight = UITableViewAutomaticDimension;++ if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {+ self.tableView.backgroundColor = [%c(YTColor) black3];+ } else {+ self.tableView.backgroundColor = [UIColor systemBackgroundColor];+ }++ [self.view addSubview:self.tableView];+}++- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {+ [super traitCollectionDidChange:previousTraitCollection];+ if (previousTraitCollection.userInterfaceStyle != self.traitCollection.userInterfaceStyle) {+ self.tableView.backgroundColor = (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark)+ ? [%c(YTColor) black3]+ : [UIColor systemBackgroundColor];++ UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];+ [appearance configureWithDefaultBackground];+ if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {+ appearance.backgroundColor = [%c(YTColor) black3];+ } else {+ appearance.backgroundColor = [UIColor systemBackgroundColor];+ }+ self.navigationController.navigationBar.standardAppearance = appearance;+ self.navigationController.navigationBar.scrollEdgeAppearance = appearance;++ [self.tableView reloadData];+ }+}++- (void)viewWillAppear:(BOOL)animated {+ Class ytStyled = objc_getClass("YTStyledViewController");+ struct objc_super superStruct = { self, ytStyled ?: [UIViewController class] };+ ((void (*)(struct objc_super *, SEL, BOOL))objc_msgSendSuper)(&superStruct, @selector(viewWillAppear:), animated);+}++- (void)viewWillDisappear:(BOOL)animated {+ Class ytStyled = objc_getClass("YTStyledViewController");+ struct objc_super superStruct = { self, ytStyled ?: [UIViewController class] };+ ((void (*)(struct objc_super *, SEL, BOOL))objc_msgSendSuper)(&superStruct, @selector(viewWillDisappear:), animated);++ UINavigationBar *navBar = self.navigationController.navigationBar;+ navBar.standardAppearance = objc_getAssociatedObject(self, kYMOverlaySavedStdAppearanceKey);+ navBar.scrollEdgeAppearance = objc_getAssociatedObject(self, kYMOverlaySavedScrollEdgeAppearanceKey);+}++- (void)viewDidLayoutSubviews {+ Class ytStyled = objc_getClass("YTStyledViewController");+ struct objc_super superStruct = { self, ytStyled ?: [UIViewController class] };+ ((void (*)(struct objc_super *, SEL))objc_msgSendSuper)(&superStruct, @selector(viewDidLayoutSubviews));+ YTQTMButton *backButton = [self valueForKey:@"_backButton"];++ if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {+ backButton.tintColor = [UIColor whiteColor];+ } else {+ backButton.tintColor = [UIColor blackColor];+ }+}++- (void)loadButtonData {+ NSArray *savedOrder = [[NSUserDefaults standardUserDefaults] arrayForKey:OverlayButtonOrder];+ NSMutableArray *data = [NSMutableArray array];++ if (savedOrder.count > 0) {+ for (NSDictionary *entry in savedOrder) {+ NSString *buttonID = entry[@"id"];+ BOOL enabled = [entry[@"enabled"] boolValue];+ if (buttonID) {+ [data addObject:[@{@"id": buttonID, @"enabled": @(enabled)} mutableCopy]];+ }+ }+ for (NSInteger i = 0; i < kYMOverlayButtonCount; i++) {+ NSString *buttonID = kYMOverlayButtonIDs[i];+ BOOL found = NO;+ for (NSDictionary *d in data) {+ if ([d[@"id"] isEqualToString:buttonID]) { found = YES; break; }+ }+ if (!found) {+ [data addObject:[@{@"id": buttonID, @"enabled": @(YMIsOverlayButtonEnabled(buttonID))} mutableCopy]];+ }+ }+ } else {+ for (NSInteger i = 0; i < kYMOverlayButtonCount; i++) {+ NSString *buttonID = kYMOverlayButtonIDs[i];+ BOOL defaultEnabled = YMIsOverlayButtonEnabled(buttonID);+ [data addObject:[@{@"id": buttonID, @"enabled": @(defaultEnabled)} mutableCopy]];+ }+ }++ self.buttonData = data;+}++- (void)saveButtonData {+ NSMutableArray *toSave = [NSMutableArray array];+ for (NSMutableDictionary *entry in self.buttonData) {+ [toSave addObject:@{@"id": entry[@"id"], @"enabled": entry[@"enabled"]}];+ }+ [[NSUserDefaults standardUserDefaults] setObject:toSave forKey:OverlayButtonOrder];+ [[NSUserDefaults standardUserDefaults] synchronize];+ [[NSNotificationCenter defaultCenter] postNotificationName:@"YouModUpdateOverlayButtons" object:nil];+}++- (void)takeSnapshot {+ NSMutableArray *snap = [NSMutableArray array];+ for (NSDictionary *entry in self.buttonData) {+ [snap addObject:@{@"id": entry[@"id"], @"enabled": entry[@"enabled"]}];+ }+ self.initialSnapshot = [snap copy];+}++#pragma mark - UITableViewDataSource++- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; }++- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {+ return self.buttonData.count;+}++- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {+ static NSString *cellID = @"YMOverlayButtonCell";+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];+ UISwitch *sw;++ if (!cell) {+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];+ cell.backgroundColor = [UIColor clearColor];+ cell.selectionStyle = UITableViewCellSelectionStyleNone;++ sw = [[UISwitch alloc] init];+ sw.onTintColor = [UIColor colorWithRed:0.6 green:0.2 blue:0.9 alpha:1.0];+ [sw addTarget:self action:@selector(buttonToggleChanged:) forControlEvents:UIControlEventValueChanged];+ sw.translatesAutoresizingMaskIntoConstraints = NO;+ sw.tag = 999;+ [cell.contentView addSubview:sw];++ [NSLayoutConstraint activateConstraints:@[+ [sw.centerYAnchor constraintEqualToAnchor:cell.contentView.centerYAnchor],+ [sw.trailingAnchor constraintEqualToAnchor:cell.contentView.trailingAnchor constant:-16]+ ]];+ } else {+ sw = [cell.contentView viewWithTag:999];+ }++ NSMutableDictionary *entry = self.buttonData[indexPath.row];+ NSString *buttonID = entry[@"id"];+ BOOL enabled = [entry[@"enabled"] boolValue];++ cell.textLabel.text = [self localizedNameForButtonID:buttonID];+ cell.textLabel.textColor = [UIColor labelColor];+ cell.textLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];++ UIImage *btnIcon = [self iconForButtonID:buttonID];+ cell.imageView.image = btnIcon;+ cell.imageView.tintColor = [UIColor labelColor];++ if ([buttonID isEqualToString:@"download.video"]) {+ sw.hidden = !IS_ENABLED(DownloadManager);+ } else {+ sw.hidden = NO;+ }++ sw.on = enabled;+ objc_setAssociatedObject(sw, kYMSwitchKeyAssoc, buttonID, OBJC_ASSOCIATION_RETAIN_NONATOMIC);++ return cell;+}++- (void)buttonToggleChanged:(UISwitch *)sender {+ NSString *buttonID = objc_getAssociatedObject(sender, kYMSwitchKeyAssoc);+ if (!buttonID) return;++ NSMutableDictionary *entry = nil;+ for (NSMutableDictionary *d in self.buttonData) {+ if ([d[@"id"] isEqualToString:buttonID]) { entry = d; break; }+ }+ if (!entry) return;++ entry[@"enabled"] = @(sender.on);+ [self saveButtonData];+}++#pragma mark - Reordering++- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { return YES; }++- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)from toIndexPath:(NSIndexPath *)to {+ NSMutableDictionary *item = self.buttonData[from.row];+ [self.buttonData removeObjectAtIndex:from.row];+ [self.buttonData insertObject:item atIndex:to.row];+ [self saveButtonData];+}++- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {+ return UITableViewCellEditingStyleNone;+}++- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath {+ return NO;+}++#pragma mark - Section Header/Footer++- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {+ return UITableViewAutomaticDimension;+}++- (UIColor *)ymSecondaryColor {+ return [UIColor colorWithWhite:0.55 alpha:1.0];+}++- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {+ UIView *headerView = [[UIView alloc] init];+ headerView.backgroundColor = [UIColor clearColor];++ UILabel *hintLabel = [[UILabel alloc] init];+ hintLabel.text = LOC(@"OVERLAY_BUTTON_REORDER_HINT");+ hintLabel.textColor = [self ymSecondaryColor];+ hintLabel.font = [UIFont systemFontOfSize:13];+ hintLabel.numberOfLines = 0;+ hintLabel.translatesAutoresizingMaskIntoConstraints = NO;+ [headerView addSubview:hintLabel];++ [NSLayoutConstraint activateConstraints:@[+ [hintLabel.leadingAnchor constraintEqualToAnchor:headerView.leadingAnchor constant:16],+ [hintLabel.trailingAnchor constraintEqualToAnchor:headerView.trailingAnchor constant:-16],+ [hintLabel.topAnchor constraintEqualToAnchor:headerView.topAnchor constant:12],+ [hintLabel.bottomAnchor constraintEqualToAnchor:headerView.bottomAnchor constant:-12]+ ]];++ return headerView;+}++- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { return 0; }+- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { return [[UIView alloc] init]; }++@end++void YMPushOverlayButtonOrder(id settingsVC, id parentResponder) {+ Class styledClass = objc_getClass("YMOverlayButtonOrderViewControllerStyled");+ if (!styledClass) styledClass = [YMOverlayButtonOrderViewController class];++ YMOverlayButtonOrderViewController *vc = (YMOverlayButtonOrderViewController *)((id (*)(id, SEL, id))objc_msgSend)([styledClass alloc], @selector(initWithParentResponder:), parentResponder);+ if (!vc) vc = [[styledClass alloc] init];+ [settingsVC pushViewController:vc];+}++#pragma mark - Entry Point++void YMPushSubSettings(NSString *title, NSArray<YMSettingsItem *> *items, id settingsVC, id parentResponder) {+ Class styledClass = objc_getClass("YMSubSettingsViewControllerStyled");+ if (!styledClass) styledClass = [YMSubSettingsViewController class];++ YMSubSettingsViewController *vc = (YMSubSettingsViewController *)((id (*)(id, SEL, id))objc_msgSend)([styledClass alloc], @selector(initWithParentResponder:), parentResponder);+ if (!vc) vc = [[styledClass alloc] init];+ vc.navTitle = title;+ vc.items = items;+ [settingsVC pushViewController:vc];+}++#pragma mark - Runtime Class Registration++static void ymRegisterStyledSubclass(Class sourceClass, const char *name) {+ Class ytStyled = %c(YTStyledViewController);+ Class newClass = objc_allocateClassPair(ytStyled, name, 0);+ if (!newClass) return;++ // Copy methods and properties from sourceClass up through its own class chain,+ // stopping before UIViewController/YTStyledViewController. Walking the chain+ // (not just sourceClass) is required when sourceClass itself subclasses another+ // YouMod controller — e.g. YMSettingsSearchViewController inherits its cell+ // builders from YMSubSettingsViewController; a single-level copy would drop+ // them. Subclass levels are copied first so an override wins over its parent+ // (class_addMethod does not replace an already-added selector).+ for (Class cls = sourceClass; cls && cls != [UIViewController class]; cls = class_getSuperclass(cls)) {+ unsigned int count = 0;+ Method *methods = class_copyMethodList(cls, &count);+ for (unsigned int i = 0; i < count; i++) {+ class_addMethod(newClass, method_getName(methods[i]), method_getImplementation(methods[i]), method_getTypeEncoding(methods[i]));+ }+ free(methods);++ unsigned int propCount = 0;+ objc_property_t *props = class_copyPropertyList(cls, &propCount);+ for (unsigned int i = 0; i < propCount; i++) {+ unsigned int attrCount = 0;+ objc_property_attribute_t *attrs = property_copyAttributeList(props[i], &attrCount);+ class_addProperty(newClass, property_getName(props[i]), attrs, attrCount);+ free(attrs);+ }+ free(props);+ }++ objc_registerClassPair(newClass);+}++%hook YTQTMButton+- (void)layoutSubviews {+ %orig;+ if ([self.accessibilityIdentifier isEqualToString:@"id.ui.title.tab.button"]) {+ UIColor *customTitle = [self valueForKey:@"_desiredCustomTitleColor"];++ if (isDarkMode(self)) {+ self.titleLabel.textColor = [UIColor whiteColor];+ if (customTitle) {+ [self setValue:[UIColor whiteColor] forKey:@"_desiredCustomTitleColor"];+ }+ } else {+ self.titleLabel.textColor = [UIColor blackColor];+ if (customTitle) {+ [self setValue:[UIColor blackColor] forKey:@"_desiredCustomTitleColor"];+ }+ }+ } else if ([self.accessibilityIdentifier isEqualToString:@"id.ui.browse.back.button"]) {+ if (isDarkMode(self)) {+ self.tintColor = [UIColor whiteColor];+ } else {+ self.tintColor = [UIColor blackColor];+ }+ }+}+%end++%hook YTPivotBarViewController+- (void)viewDidLoad {+ %orig;+ [[NSNotificationCenter defaultCenter] removeObserver:self name:@"YouModUpdateTabBar" object:nil];+ [[NSNotificationCenter defaultCenter] addObserver:self+ selector:@selector(YouModReloadTabBar:)+ name:@"YouModUpdateTabBar"+ object:nil];+}+%new+- (void)YouModReloadTabBar:(id)arg {+ [self.parentViewController performSelector:@selector(refreshPivotBarWithTriggedByNotification:) withObject:@YES];+}+%end++%ctor {+ ymRegisterStyledSubclass([YMSubSettingsViewController class], "YMSubSettingsViewControllerStyled");+ ymRegisterStyledSubclass([YMTabOrderViewController class], "YMTabOrderViewControllerStyled");+ ymRegisterStyledSubclass([YMOverlayButtonOrderViewController class], "YMOverlayButtonOrderViewControllerStyled");+ ymRegisterStyledSubclass([YMSettingsSearchViewController class], "YMSettingsSearchViewControllerStyled");+}diff --git a/vendor/YouMod/Icon.png b/vendor/YouMod/Icon.pngnew file mode 100644index 0000000..d361c0dBinary files /dev/null and b/vendor/YouMod/Icon.png differdiff --git a/vendor/YouMod/LICENSE b/vendor/YouMod/LICENSEnew file mode 100644index 0000000..f288702--- /dev/null+++ b/vendor/YouMod/LICENSE@@ -0,0 +1,674 @@+ GNU GENERAL PUBLIC LICENSE+ Version 3, 29 June 2007++ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>+ Everyone is permitted to copy and distribute verbatim copies+ of this license document, but changing it is not allowed.++ Preamble++ The GNU General Public License is a free, copyleft license for+software and other kinds of works.++ The licenses for most software and other practical works are designed+to take away your freedom to share and change the works. By contrast,+the GNU General Public License is intended to guarantee your freedom to+share and change all versions of a program--to make sure it remains free+software for all its users. We, the Free Software Foundation, use the+GNU General Public License for most of our software; it applies also to+any other work released this way by its authors. You can apply it to+your programs, too.++ When we speak of free software, we are referring to freedom, not+price. Our General Public Licenses are designed to make sure that you+have the freedom to distribute copies of free software (and charge for+them if you wish), that you receive source code or can get it if you+want it, that you can change the software or use pieces of it in new+free programs, and that you know you can do these things.++ To protect your rights, we need to prevent others from denying you+these rights or asking you to surrender the rights. Therefore, you have+certain responsibilities if you distribute copies of the software, or if+you modify it: responsibilities to respect the freedom of others.++ For example, if you distribute copies of such a program, whether+gratis or for a fee, you must pass on to the recipients the same+freedoms that you received. You must make sure that they, too, receive+or can get the source code. And you must show them these terms so they+know their rights.++ Developers that use the GNU GPL protect your rights with two steps:+(1) assert copyright on the software, and (2) offer you this License+giving you legal permission to copy, distribute and/or modify it.++ For the developers' and authors' protection, the GPL clearly explains+that there is no warranty for this free software. For both users' and+authors' sake, the GPL requires that modified versions be marked as+changed, so that their problems will not be attributed erroneously to+authors of previous versions.++ Some devices are designed to deny users access to install or run+modified versions of the software inside them, although the manufacturer+can do so. This is fundamentally incompatible with the aim of+protecting users' freedom to change the software. The systematic+pattern of such abuse occurs in the area of products for individuals to+use, which is precisely where it is most unacceptable. Therefore, we+have designed this version of the GPL to prohibit the practice for those+products. If such problems arise substantially in other domains, we+stand ready to extend this provision to those domains in future versions+of the GPL, as needed to protect the freedom of users.++ Finally, every program is threatened constantly by software patents.+States should not allow patents to restrict development and use of+software on general-purpose computers, but in those that do, we wish to+avoid the special danger that patents applied to a free program could+make it effectively proprietary. To prevent this, the GPL assures that+patents cannot be used to render the program non-free.++ The precise terms and conditions for copying, distribution and+modification follow.++ TERMS AND CONDITIONS++ 0. Definitions.++ "This License" refers to version 3 of the GNU General Public License.++ "Copyright" also means copyright-like laws that apply to other kinds of+works, such as semiconductor masks.++ "The Program" refers to any copyrightable work licensed under this+License. Each licensee is addressed as "you". "Licensees" and+"recipients" may be individuals or organizations.++ To "modify" a work means to copy from or adapt all or part of the work+in a fashion requiring copyright permission, other than the making of an+exact copy. The resulting work is called a "modified version" of the+earlier work or a work "based on" the earlier work.++ A "covered work" means either the unmodified Program or a work based+on the Program.++ To "propagate" a work means to do anything with it that, without+permission, would make you directly or secondarily liable for+infringement under applicable copyright law, except executing it on a+computer or modifying a private copy. Propagation includes copying,+distribution (with or without modification), making available to the+public, and in some countries other activities as well.++ To "convey" a work means any kind of propagation that enables other+parties to make or receive copies. Mere interaction with a user through+a computer network, with no transfer of a copy, is not conveying.++ An interactive user interface displays "Appropriate Legal Notices"+to the extent that it includes a convenient and prominently visible+feature that (1) displays an appropriate copyright notice, and (2)+tells the user that there is no warranty for the work (except to the+extent that warranties are provided), that licensees may convey the+work under this License, and how to view a copy of this License. If+the interface presents a list of user commands or options, such as a+menu, a prominent item in the list meets this criterion.++ 1. Source Code.++ The "source code" for a work means the preferred form of the work+for making modifications to it. "Object code" means any non-source+form of a work.++ A "Standard Interface" means an interface that either is an official+standard defined by a recognized standards body, or, in the case of+interfaces specified for a particular programming language, one that+is widely used among developers working in that language.++ The "System Libraries" of an executable work include anything, other+than the work as a whole, that (a) is included in the normal form of+packaging a Major Component, but which is not part of that Major+Component, and (b) serves only to enable use of the work with that+Major Component, or to implement a Standard Interface for which an+implementation is available to the public in source code form. A+"Major Component", in this context, means a major essential component+(kernel, window system, and so on) of the specific operating system+(if any) on which the executable work runs, or a compiler used to+produce the work, or an object code interpreter used to run it.++ The "Corresponding Source" for a work in object code form means all+the source code needed to generate, install, and (for an executable+work) run the object code and to modify the work, including scripts to+control those activities. However, it does not include the work's+System Libraries, or general-purpose tools or generally available free+programs which are used unmodified in performing those activities but+which are not part of the work. For example, Corresponding Source+includes interface definition files associated with source files for+the work, and the source code for shared libraries and dynamically+linked subprograms that the work is specifically designed to require,+such as by intimate data communication or control flow between those+subprograms and other parts of the work.++ The Corresponding Source need not include anything that users+can regenerate automatically from other parts of the Corresponding+Source.++ The Corresponding Source for a work in source code form is that+same work.++ 2. Basic Permissions.++ All rights granted under this License are granted for the term of+copyright on the Program, and are irrevocable provided the stated+conditions are met. This License explicitly affirms your unlimited+permission to run the unmodified Program. The output from running a+covered work is covered by this License only if the output, given its+content, constitutes a covered work. This License acknowledges your+rights of fair use or other equivalent, as provided by copyright law.++ You may make, run and propagate covered works that you do not+convey, without conditions so long as your license otherwise remains+in force. You may convey covered works to others for the sole purpose+of having them make modifications exclusively for you, or provide you+with facilities for running those works, provided that you comply with+the terms of this License in conveying all material for which you do+not control copyright. Those thus making or running the covered works+for you must do so exclusively on your behalf, under your direction+and control, on terms that prohibit them from making any copies of+your copyrighted material outside their relationship with you.++ Conveying under any other circumstances is permitted solely under+the conditions stated below. Sublicensing is not allowed; section 10+makes it unnecessary.++ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.++ No covered work shall be deemed part of an effective technological+measure under any applicable law fulfilling obligations under article+11 of the WIPO copyright treaty adopted on 20 December 1996, or+similar laws prohibiting or restricting circumvention of such+measures.++ When you convey a covered work, you waive any legal power to forbid+circumvention of technological measures to the extent such circumvention+is effected by exercising rights under this License with respect to+the covered work, and you disclaim any intention to limit operation or+modification of the work as a means of enforcing, against the work's+users, your or third parties' legal rights to forbid circumvention of+technological measures.++ 4. Conveying Verbatim Copies.++ You may convey verbatim copies of the Program's source code as you+receive it, in any medium, provided that you conspicuously and+appropriately publish on each copy an appropriate copyright notice;+keep intact all notices stating that this License and any+non-permissive terms added in accord with section 7 apply to the code;+keep intact all notices of the absence of any warranty; and give all+recipients a copy of this License along with the Program.++ You may charge any price or no price for each copy that you convey,+and you may offer support or warranty protection for a fee.++ 5. Conveying Modified Source Versions.++ You may convey a work based on the Program, or the modifications to+produce it from the Program, in the form of source code under the+terms of section 4, provided that you also meet all of these conditions:++ a) The work must carry prominent notices stating that you modified+ it, and giving a relevant date.++ b) The work must carry prominent notices stating that it is+ released under this License and any conditions added under section+ 7. This requirement modifies the requirement in section 4 to+ "keep intact all notices".++ c) You must license the entire work, as a whole, under this+ License to anyone who comes into possession of a copy. This+ License will therefore apply, along with any applicable section 7+ additional terms, to the whole of the work, and all its parts,+ regardless of how they are packaged. This License gives no+ permission to license the work in any other way, but it does not+ invalidate such permission if you have separately received it.++ d) If the work has interactive user interfaces, each must display+ Appropriate Legal Notices; however, if the Program has interactive+ interfaces that do not display Appropriate Legal Notices, your+ work need not make them do so.++ A compilation of a covered work with other separate and independent+works, which are not by their nature extensions of the covered work,+and which are not combined with it such as to form a larger program,+in or on a volume of a storage or distribution medium, is called an+"aggregate" if the compilation and its resulting copyright are not+used to limit the access or legal rights of the compilation's users+beyond what the individual works permit. Inclusion of a covered work+in an aggregate does not cause this License to apply to the other+parts of the aggregate.++ 6. Conveying Non-Source Forms.++ You may convey a covered work in object code form under the terms+of sections 4 and 5, provided that you also convey the+machine-readable Corresponding Source under the terms of this License,+in one of these ways:++ a) Convey the object code in, or embodied in, a physical product+ (including a physical distribution medium), accompanied by the+ Corresponding Source fixed on a durable physical medium+ customarily used for software interchange.++ b) Convey the object code in, or embodied in, a physical product+ (including a physical distribution medium), accompanied by a+ written offer, valid for at least three years and valid for as+ long as you offer spare parts or customer support for that product+ model, to give anyone who possesses the object code either (1) a+ copy of the Corresponding Source for all the software in the+ product that is covered by this License, on a durable physical+ medium customarily used for software interchange, for a price no+ more than your reasonable cost of physically performing this+ conveying of source, or (2) access to copy the+ Corresponding Source from a network server at no charge.++ c) Convey individual copies of the object code with a copy of the+ written offer to provide the Corresponding Source. This+ alternative is allowed only occasionally and noncommercially, and+ only if you received the object code with such an offer, in accord+ with subsection 6b.++ d) Convey the object code by offering access from a designated+ place (gratis or for a charge), and offer equivalent access to the+ Corresponding Source in the same way through the same place at no+ further charge. You need not require recipients to copy the+ Corresponding Source along with the object code. If the place to+ copy the object code is a network server, the Corresponding Source+ may be on a different server (operated by you or a third party)+ that supports equivalent copying facilities, provided you maintain+ clear directions next to the object code saying where to find the+ Corresponding Source. Regardless of what server hosts the+ Corresponding Source, you remain obligated to ensure that it is+ available for as long as needed to satisfy these requirements.++ e) Convey the object code using peer-to-peer transmission, provided+ you inform other peers where the object code and Corresponding+ Source of the work are being offered to the general public at no+ charge under subsection 6d.++ A separable portion of the object code, whose source code is excluded+from the Corresponding Source as a System Library, need not be+included in conveying the object code work.++ A "User Product" is either (1) a "consumer product", which means any+tangible personal property which is normally used for personal, family,+or household purposes, or (2) anything designed or sold for incorporation+into a dwelling. In determining whether a product is a consumer product,+doubtful cases shall be resolved in favor of coverage. For a particular+product received by a particular user, "normally used" refers to a+typical or common use of that class of product, regardless of the status+of the particular user or of the way in which the particular user+actually uses, or expects or is expected to use, the product. A product+is a consumer product regardless of whether the product has substantial+commercial, industrial or non-consumer uses, unless such uses represent+the only significant mode of use of the product.++ "Installation Information" for a User Product means any methods,+procedures, authorization keys, or other information required to install+and execute modified versions of a covered work in that User Product from+a modified version of its Corresponding Source. The information must+suffice to ensure that the continued functioning of the modified object+code is in no case prevented or interfered with solely because+modification has been made.++ If you convey an object code work under this section in, or with, or+specifically for use in, a User Product, and the conveying occurs as+part of a transaction in which the right of possession and use of the+User Product is transferred to the recipient in perpetuity or for a+fixed term (regardless of how the transaction is characterized), the+Corresponding Source conveyed under this section must be accompanied+by the Installation Information. But this requirement does not apply+if neither you nor any third party retains the ability to install+modified object code on the User Product (for example, the work has+been installed in ROM).++ The requirement to provide Installation Information does not include a+requirement to continue to provide support service, warranty, or updates+for a work that has been modified or installed by the recipient, or for+the User Product in which it has been modified or installed. Access to a+network may be denied when the modification itself materially and+adversely affects the operation of the network or violates the rules and+protocols for communication across the network.++ Corresponding Source conveyed, and Installation Information provided,+in accord with this section must be in a format that is publicly+documented (and with an implementation available to the public in+source code form), and must require no special password or key for+unpacking, reading or copying.++ 7. Additional Terms.++ "Additional permissions" are terms that supplement the terms of this+License by making exceptions from one or more of its conditions.+Additional permissions that are applicable to the entire Program shall+be treated as though they were included in this License, to the extent+that they are valid under applicable law. If additional permissions+apply only to part of the Program, that part may be used separately+under those permissions, but the entire Program remains governed by+this License without regard to the additional permissions.++ When you convey a copy of a covered work, you may at your option+remove any additional permissions from that copy, or from any part of+it. (Additional permissions may be written to require their own+removal in certain cases when you modify the work.) You may place+additional permissions on material, added by you to a covered work,+for which you have or can give appropriate copyright permission.++ Notwithstanding any other provision of this License, for material you+add to a covered work, you may (if authorized by the copyright holders of+that material) supplement the terms of this License with terms:++ a) Disclaiming warranty or limiting liability differently from the+ terms of sections 15 and 16 of this License; or++ b) Requiring preservation of specified reasonable legal notices or+ author attributions in that material or in the Appropriate Legal+ Notices displayed by works containing it; or++ c) Prohibiting misrepresentation of the origin of that material, or+ requiring that modified versions of such material be marked in+ reasonable ways as different from the original version; or++ d) Limiting the use for publicity purposes of names of licensors or+ authors of the material; or++ e) Declining to grant rights under trademark law for use of some+ trade names, trademarks, or service marks; or++ f) Requiring indemnification of licensors and authors of that+ material by anyone who conveys the material (or modified versions of+ it) with contractual assumptions of liability to the recipient, for+ any liability that these contractual assumptions directly impose on+ those licensors and authors.++ All other non-permissive additional terms are considered "further+restrictions" within the meaning of section 10. If the Program as you+received it, or any part of it, contains a notice stating that it is+governed by this License along with a term that is a further+restriction, you may remove that term. If a license document contains+a further restriction but permits relicensing or conveying under this+License, you may add to a covered work material governed by the terms+of that license document, provided that the further restriction does+not survive such relicensing or conveying.++ If you add terms to a covered work in accord with this section, you+must place, in the relevant source files, a statement of the+additional terms that apply to those files, or a notice indicating+where to find the applicable terms.++ Additional terms, permissive or non-permissive, may be stated in the+form of a separately written license, or stated as exceptions;+the above requirements apply either way.++ 8. Termination.++ You may not propagate or modify a covered work except as expressly+provided under this License. Any attempt otherwise to propagate or+modify it is void, and will automatically terminate your rights under+this License (including any patent licenses granted under the third+paragraph of section 11).++ However, if you cease all violation of this License, then your+license from a particular copyright holder is reinstated (a)+provisionally, unless and until the copyright holder explicitly and+finally terminates your license, and (b) permanently, if the copyright+holder fails to notify you of the violation by some reasonable means+prior to 60 days after the cessation.++ Moreover, your license from a particular copyright holder is+reinstated permanently if the copyright holder notifies you of the+violation by some reasonable means, this is the first time you have+received notice of violation of this License (for any work) from that+copyright holder, and you cure the violation prior to 30 days after+your receipt of the notice.++ Termination of your rights under this section does not terminate the+licenses of parties who have received copies or rights from you under+this License. If your rights have been terminated and not permanently+reinstated, you do not qualify to receive new licenses for the same+material under section 10.++ 9. Acceptance Not Required for Having Copies.++ You are not required to accept this License in order to receive or+run a copy of the Program. Ancillary propagation of a covered work+occurring solely as a consequence of using peer-to-peer transmission+to receive a copy likewise does not require acceptance. However,+nothing other than this License grants you permission to propagate or+modify any covered work. These actions infringe copyright if you do+not accept this License. Therefore, by modifying or propagating a+covered work, you indicate your acceptance of this License to do so.++ 10. Automatic Licensing of Downstream Recipients.++ Each time you convey a covered work, the recipient automatically+receives a license from the original licensors, to run, modify and+propagate that work, subject to this License. You are not responsible+for enforcing compliance by third parties with this License.++ An "entity transaction" is a transaction transferring control of an+organization, or substantially all assets of one, or subdividing an+organization, or merging organizations. If propagation of a covered+work results from an entity transaction, each party to that+transaction who receives a copy of the work also receives whatever+licenses to the work the party's predecessor in interest had or could+give under the previous paragraph, plus a right to possession of the+Corresponding Source of the work from the predecessor in interest, if+the predecessor has it or can get it with reasonable efforts.++ You may not impose any further restrictions on the exercise of the+rights granted or affirmed under this License. For example, you may+not impose a license fee, royalty, or other charge for exercise of+rights granted under this License, and you may not initiate litigation+(including a cross-claim or counterclaim in a lawsuit) alleging that+any patent claim is infringed by making, using, selling, offering for+sale, or importing the Program or any portion of it.++ 11. Patents.++ A "contributor" is a copyright holder who authorizes use under this+License of the Program or a work on which the Program is based. The+work thus licensed is called the contributor's "contributor version".++ A contributor's "essential patent claims" are all patent claims+owned or controlled by the contributor, whether already acquired or+hereafter acquired, that would be infringed by some manner, permitted+by this License, of making, using, or selling its contributor version,+but do not include claims that would be infringed only as a+consequence of further modification of the contributor version. For+purposes of this definition, "control" includes the right to grant+patent sublicenses in a manner consistent with the requirements of+this License.++ Each contributor grants you a non-exclusive, worldwide, royalty-free+patent license under the contributor's essential patent claims, to+make, use, sell, offer for sale, import and otherwise run, modify and+propagate the contents of its contributor version.++ In the following three paragraphs, a "patent license" is any express+agreement or commitment, however denominated, not to enforce a patent+(such as an express permission to practice a patent or covenant not to+sue for patent infringement). To "grant" such a patent license to a+party means to make such an agreement or commitment not to enforce a+patent against the party.++ If you convey a covered work, knowingly relying on a patent license,+and the Corresponding Source of the work is not available for anyone+to copy, free of charge and under the terms of this License, through a+publicly available network server or other readily accessible means,+then you must either (1) cause the Corresponding Source to be so+available, or (2) arrange to deprive yourself of the benefit of the+patent license for this particular work, or (3) arrange, in a manner+consistent with the requirements of this License, to extend the patent+license to downstream recipients. "Knowingly relying" means you have+actual knowledge that, but for the patent license, your conveying the+covered work in a country, or your recipient's use of the covered work+in a country, would infringe one or more identifiable patents in that+country that you have reason to believe are valid.++ If, pursuant to or in connection with a single transaction or+arrangement, you convey, or propagate by procuring conveyance of, a+covered work, and grant a patent license to some of the parties+receiving the covered work authorizing them to use, propagate, modify+or convey a specific copy of the covered work, then the patent license+you grant is automatically extended to all recipients of the covered+work and works based on it.++ A patent license is "discriminatory" if it does not include within+the scope of its coverage, prohibits the exercise of, or is+conditioned on the non-exercise of one or more of the rights that are+specifically granted under this License. You may not convey a covered+work if you are a party to an arrangement with a third party that is+in the business of distributing software, under which you make payment+to the third party based on the extent of your activity of conveying+the work, and under which the third party grants, to any of the+parties who would receive the covered work from you, a discriminatory+patent license (a) in connection with copies of the covered work+conveyed by you (or copies made from those copies), or (b) primarily+for and in connection with specific products or compilations that+contain the covered work, unless you entered into that arrangement,+or that patent license was granted, prior to 28 March 2007.++ Nothing in this License shall be construed as excluding or limiting+any implied license or other defenses to infringement that may+otherwise be available to you under applicable patent law.++ 12. No Surrender of Others' Freedom.++ If conditions are imposed on you (whether by court order, agreement or+otherwise) that contradict the conditions of this License, they do not+excuse you from the conditions of this License. If you cannot convey a+covered work so as to satisfy simultaneously your obligations under this+License and any other pertinent obligations, then as a consequence you may+not convey it at all. For example, if you agree to terms that obligate you+to collect a royalty for further conveying from those to whom you convey+the Program, the only way you could satisfy both those terms and this+License would be to refrain entirely from conveying the Program.++ 13. Use with the GNU Affero General Public License.++ Notwithstanding any other provision of this License, you have+permission to link or combine any covered work with a work licensed+under version 3 of the GNU Affero General Public License into a single+combined work, and to convey the resulting work. The terms of this+License will continue to apply to the part which is the covered work,+but the special requirements of the GNU Affero General Public License,+section 13, concerning interaction through a network will apply to the+combination as such.++ 14. Revised Versions of this License.++ The Free Software Foundation may publish revised and/or new versions of+the GNU General Public License from time to time. Such new versions will+be similar in spirit to the present version, but may differ in detail to+address new problems or concerns.++ Each version is given a distinguishing version number. If the+Program specifies that a certain numbered version of the GNU General+Public License "or any later version" applies to it, you have the+option of following the terms and conditions either of that numbered+version or of any later version published by the Free Software+Foundation. If the Program does not specify a version number of the+GNU General Public License, you may choose any version ever published+by the Free Software Foundation.++ If the Program specifies that a proxy can decide which future+versions of the GNU General Public License can be used, that proxy's+public statement of acceptance of a version permanently authorizes you+to choose that version for the Program.++ Later license versions may give you additional or different+permissions. However, no additional obligations are imposed on any+author or copyright holder as a result of your choosing to follow a+later version.++ 15. Disclaimer of Warranty.++ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.++ 16. Limitation of Liability.++ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF+SUCH DAMAGES.++ 17. Interpretation of Sections 15 and 16.++ If the disclaimer of warranty and limitation of liability provided+above cannot be given local legal effect according to their terms,+reviewing courts shall apply local law that most closely approximates+an absolute waiver of all civil liability in connection with the+Program, unless a warranty or assumption of liability accompanies a+copy of the Program in return for a fee.++ END OF TERMS AND CONDITIONS++ How to Apply These Terms to Your New Programs++ If you develop a new program, and you want it to be of the greatest+possible use to the public, the best way to achieve this is to make it+free software which everyone can redistribute and change under these terms.++ To do so, attach the following notices to the program. It is safest+to attach them to the start of each source file to most effectively+state the exclusion of warranty; and each file should have at least+the "copyright" line and a pointer to where the full notice is found.++ <one line to give the program's name and a brief idea of what it does.>+ Copyright (C) <year> <name of author>++ This program is free software: you can redistribute it and/or modify+ it under the terms of the GNU General Public License as published by+ the Free Software Foundation, either version 3 of the License, or+ (at your option) any later version.++ This program is distributed in the hope that it will be useful,+ but WITHOUT ANY WARRANTY; without even the implied warranty of+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ GNU General Public License for more details.++ You should have received a copy of the GNU General Public License+ along with this program. If not, see <https://www.gnu.org/licenses/>.++Also add information on how to contact you by electronic and paper mail.++ If the program does terminal interaction, make it output a short+notice like this when it starts in an interactive mode:++ <program> Copyright (C) <year> <name of author>+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.+ This is free software, and you are welcome to redistribute it+ under certain conditions; type `show c' for details.++The hypothetical commands `show w' and `show c' should show the appropriate+parts of the General Public License. Of course, your program's commands+might be different; for a GUI interface, you would use an "about box".++ You should also get your employer (if you work as a programmer) or school,+if any, to sign a "copyright disclaimer" for the program, if necessary.+For more information on this, and how to apply and follow the GNU GPL, see+<https://www.gnu.org/licenses/>.++ The GNU General Public License does not permit incorporating your program+into proprietary programs. If your program is a subroutine library, you+may consider it more useful to permit linking proprietary applications with+the library. If this is what you want to do, use the GNU Lesser General+Public License instead of this License. But first, please read+<https://www.gnu.org/licenses/why-not-lgpl.html>.diff --git a/vendor/YouMod/Makefile b/vendor/YouMod/Makefilenew file mode 100644index 0000000..c93851c--- /dev/null+++ b/vendor/YouMod/Makefile@@ -0,0 +1,14 @@+# Original Makefile from YTLite+DEBUG = 0+FINALPACKAGE = 1+ARCHS = arm64+TARGET := iphone:clang:latest:14.0++include $(THEOS)/makefiles/common.mk++TWEAK_NAME = YouMod+$(TWEAK_NAME)_FRAMEWORKS = UIKit Foundation AudioToolbox MediaPlayer+$(TWEAK_NAME)_CFLAGS = -fobjc-arc+$(TWEAK_NAME)_FILES = $(wildcard Files/*.x)++include $(THEOS_MAKE_PATH)/tweak.mkdiff --git a/vendor/YouMod/README.md b/vendor/YouMod/README.mdnew file mode 100644index 0000000..9f1aa04--- /dev/null+++ b/vendor/YouMod/README.md@@ -0,0 +1,70 @@+<p align=center>+<img src="https://github.com/grohit1810/YouMod/blob/feature/add-sponsorblock/Icon.png" width="200" height="200"/>+<h1 align="center">YouMod</h1>+</p>+<p align=center>+<img src="https://img.shields.io/badge/Platform-iOS%20%7C%20iPadOS%2014.0%2B-blue" alt="Badge"/>+<a href="https://github.com/Tonwalter888/YouMod/releases/latest"><img src="https://custom-icon-badges.demolab.com/github/v/release/Tonwalter888/YouMod?color=brightgreen&label=Latest%20release" alt="Badge"></img></a>+<a href="https://github.com/Tonwalter888/YouMod/releases/latest"><img src="https://img.shields.io/github/downloads/Tonwalter888/YouMod/total?label=Download" alt="Badge"></img></a>+</p>++A tweak that's try to recreate features like in YTLite as much as possible. Contributions are welcome! ^^++Thanks for 600 stars and 1,400 forks! This might be the best project I've done.++If you want to contribute this project, scroll down to `How to contribute this project?` part.++## Why I created this project?+The reason is because of YTLite no longer free. So I'll try my best to recreate all the features as much as I can, plus alternative tweaks combined.++## Features+This tweak add a lot of QoL feature and can hide elements in YouTube. Such as:+- Downloading (Video, Audio, Captions, Thumbnail, Video datails, etc. Currently supports up to 1080p60)+- Appearance (OLED theme and keyboard)+- Navigation bar (Hiding buttons)+- Player (Hiding elements, buttons, and Add custom actions, etc.)+- Shorts (Hiding elements and Add custom actions)+- Tab bar (Reorder tabs, Hiding things, etc.)+- Built-in SponsorBlock+- And much more!++## Supported YouTube version+Up to the latest, this is the goal of this tweak. Any versions starting from 19.x - latest and running at least iOS 14.++## How to build the IPA?+1. Click on **Sync fork**, and if your branch is out-of-date, click on **Update branch**.+2. Navigate to **Actions** in your forked repository and select **Build IPA with tweaks**.+3. Click the **Run workflow** button located on the right side.+4. Get a decrypted .ipa file (I cannot provide this due to legal reasons.), then upload it to a file provider (e.g., filebin.net,filemail.com,catbox.moe, Mega, or Dropbox is recommended). Paste the URL of the decrypted IPA file in the provided field. You can also change the BundleID and Display Name if desired.++**NOTE:** Make sure to provide a direct download link to the file, not a link to a webpage. Otherwise, the process will fail.++5. Make sure all inputs are correct, then click **Run workflow** to start the process.+6. Wait for the build to finish. You can download the YouMod IPA from the releases section of your forked repo. (If you can't find the releases section, go to your forked repo and add /releases to the URL, i.e., github.com/yourusername/YouMod/releases.)++## How to contribute this project?+1. Find or create an issue with the bug you're facing or a feature missing (Can also be workflows and localizations).+2. Clone the repository.+3. Create a new branch for your changes.+4. Implement your changes and ensure that they are well-tested, commit your changes and push to your branch.+5. On your fork repository, click **Contribute** button to create a new pull request (PR) from your branch.+ - In the PR description, reference the issue you're addressing (e.g., "Closes #123", I found this issue from ..., Update this workflow to ... , Update this language localizations) and send screenshots or videos proving your codes work without any issues (Only send this if you are not modifying the localizations).+ - Once your PR is submitted, maintainers or collaborators may review it and ask for changes or feedback. Make any necessary adjustments, and respond to comments as needed.++## License+This project uses GPLv3 license. See [LICENSE](https://github.com/Tonwalter888/YouMod/blob/main/LICENSE) for more details.++## Credits+- [YTLite](https://github.com/dayanch96/YTLite) - dayanch96+- [YTMusicUltimate](https://github.com/dayanch96/YTMusicUltimate) - dayanch96+- [OLEDKeyboard](https://github.com/dayanch96/OLEDKeyboard) - dayanch96+- [YTLitePlus](https://github.com/YTLitePlus/YTLitePlus)+- [uYouEnhanced](https://github.com/arichornlover/uYouEnhanced) - arichornlover+- [YTweaks](https://github.com/fosterbarnes/YTweaks) - fosterbarnes+- [jefemagril](https://github.com/jefemagril) - Implemented rewind/fast forward buttons to system Control Center+- [grohit1810](https://github.com/grohit1810) - Implemented built-in SponsorBlock, whole new settings logic, and others+- [SponsorBlock](https://sponsor.ajay.app) - SponsorBlock segments API+- [Google Fonts](https://fonts.google.com/icons) - Icons for custom tabs+- And [PoomSmart](https://github.com/PoomSmart)'s tweaks++Also thanks to the other contributors in the past!diff --git a/vendor/YouMod/YouMod.plist b/vendor/YouMod/YouMod.plistnew file mode 100644index 0000000..89d92cc--- /dev/null+++ b/vendor/YouMod/YouMod.plist@@ -0,0 +1 @@+{ Filter = { Bundles = ( "com.google.ios.youtube" ); }; }\ No newline at end of filediff --git a/vendor/YouMod/control b/vendor/YouMod/controlnew file mode 100644index 0000000..87d7e1f--- /dev/null+++ b/vendor/YouMod/control@@ -0,0 +1,9 @@+Package: dev.water888.youmod+Name: YouMod+Version: 2.0.0+Architecture: iphoneos-arm+Description: A lightweight YouTube enhancer+Maintainer: Tonwalter888, G Rohit+Author: Tonwalter888+Section: Tweaks+Depends: mobilesubstrate (>= 0.9.5000), firmware (>= 14.0)\ No newline at end of filediff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/Info.plist b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/Info.plistnew file mode 100644index 0000000..53ba69a--- /dev/null+++ b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/Info.plist@@ -0,0 +1,24 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>CFBundleDevelopmentRegion</key>+ <string>English</string>+ <key>CFBundleExecutable</key>+ <string>YouMod</string>+ <key>CFBundleIdentifier</key>+ <string>dev.water888.youmod</string>+ <key>CFBundleInfoDictionaryVersion</key>+ <string>6.0</string>+ <key>CFBundlePackageType</key>+ <string>BNDL</string>+ <key>CFBundleShortVersionString</key>+ <string>1.3.0</string>+ <key>CFBundleSignature</key>+ <string>????</string>+ <key>CFBundleVersion</key>+ <string>1.3.0</string>+ <key>NSPrincipalClass</key>+ <string>YouMod</string>+</dict>+</plist>diff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/en.lproj/Localizable.strings b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/en.lproj/Localizable.stringsnew file mode 100644index 0000000..1cb8fd9--- /dev/null+++ b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/en.lproj/Localizable.strings@@ -0,0 +1,578 @@+"SETTINGS" = "Settings";+"INTERFACE" = "Interface";++"SEARCH" = "Search";+"SEARCH_DESC" = "Search YouMod settings.";++"URL_COPIED" = "Copied video link";+"COPY_URL" = "Copy video link";+"COPY_URL_TIMESTAMP" = "Copy video link with timestamp";+"URL_TIMESTAMP_COPIED" = "Copied video link with timestamp";+"CANCEL" = "Cancel";+"ERROR" = "Error";+"ERROR_VIDEOID" = "Cannot get the video ID";+"ERROR_ADS" = "Cannot copy video link while playing ads";++"LOOP_DISABLED" = "Loop disabled";+"LOOP_ENABLED" = "Loop enabled";++"NEW_ISSUES" = "Report issues or request new features";+"NEW_ISSUES_DESC" = "Found bugs or want to request new features? Tap here.";+"SOURCE_CODES" = "Source codes";+"SOURCE_CODES_DESC" = "Take a look at the codes!";++"EXTRA" = "Extra";+"FIX_PLAYBACK_ISSUES" = "Fix playback issues (Temporary)";+"FIX_PLAYBACK_ISSUES_DESC" = "Try to fix video playback issues for some users. Turning this on will make the player automatically reloads itself everytime it errors or fails to play the video.";++"PERFER_HEADER" = "YouMod perferences";+"PERFER" = "Perferences";+"IMPORT" = "Import settings";+"IMPORT_DESC" = "Load your preferences in a .plist file.";+"IMPORT_DONE" = "Successful";+"YES" = "Yes";+"APPLY_DESC" = "App restart is requried. Do you want to restart the app now?";+"EXPORT" = "Export settings";+"EXPORT_DESC" = "Send out your preferences to a .plist file.";+"RESTORE" = "Restore settings";+"RESTORE_DESC" = "Load default settings like in fresh install.";+"WARNING" = "Warning";+"RESETDEFAULT" = "This will reset all settings to default. Do you want to continue?";+"ERROR_INVALID_FILE" = "Invaild file";+"ERROR_NO_KEYS_IMPORT" = "No available keys to import";+"ERROR_NO_KEYS_EXPORT" = "No available keys to export";+"OVERRIDE" = "This will override the current settings. Do you want to continue?";+"DISABLED" = "Disabled";++"CACHE" = "Cache management";+"CLEARCACHE" = "Clear cache";+"DONE" = "Done";+"AUTO_CLEARCACHE" = "Auto clear cache";+"AUTO_CLEARCACHE_DESC" = "Automatically clears the app cache on startup.";++"DOWNLOADING" = "Downloading";+"DOWNLOAD_MANAGER" = "Download manager";+"DOWNLOAD_MANAGER_DESC" = "Replaces YouTube's video downloader with YouMod one. With ablity to downloading videos, audios, captions, and thumbnails.";+"POST_DOWNLOAD_ACTION" = "Post-download action";+"POST_ACTION_SAVE_PHOTOS" = "Save to Photos";+"POST_ACTION_SHARE" = "Share";+"POST_ACTION_ASK" = "Ask";+"ADD_SHORTS_DOWNLOAD" = "Adds a download button to Shorts";+"ADD_SHORTS_DOWNLOAD_DESC" = "Adds a download button to Shorts video overlay.";+"DOWNLOAD_SHORTS" = "Download Shorts";+"COPY_VID_INFO" = "Copy video informations";+"COPY_TITLE" = "Copy title";+"COPY_DESCRIPTION" = "Copy description";+"COPY_ALL_VID_INFO" = "Copy all";+"COPIED_TITLE" = "Copied video title";+"COPIED_DESCRIPTION" = "Copied video description";+"COPY_AUTHOR" = "Copy author";+"COPIED_AUTHOR" = "Copied video author";+"SAVE_THUMBNAIL" = "Save thumbnail";+"DOWNLOAD_CAPTIONS" = "Download captions";+"DOWNLOAD_AUDIO" = "Download audio";+"DOWNLOAD_VIDEO" = "Download video";+"OPEN_VID_BEFORE" = "Open a video before using the download manager";+"NO_CAPTIONS_URL" = "No valid caption URLs found";+"NO_AUDIO_URL" = "No audio URL found";+"NO_STREAM_URL" = "No stream URL found";+"CAPTIONS_FAILED" = "Failed to download captions";+"NO_CAPTIONS" = "No captions available for this video";+"NO_AUDIO_STREAM_FOUND" = "No audio streams found";+"NO_VID_AUDIO_STREAM_FOUND" = "No video/audio streams found";+"COPIED_VID_INFO" = "Copied all video informations";+"SAVED_TO_PHOTOS" = "Saved to Photos";+"SAVE_FAILED" = "Save failed";+"PHOTO_ACCESS_DENINED" = "Photos access denied";+"THUMBNAIL_FAILED" = "Thumbnail failed";+"DOWNLOADING_THUMBNAIL" = "Downloading thumbnail...";+"DOWNLOADING_AUDIO" = "Downloading audio...";+"DOWNLOADING_VIDEO" = "Downloading video...";+"DOWNLOADING_CAPTIONS" = "Downloading captions...";+"NO_THUMBNAIL_FOUND" = "No thumbnail found";+"DOWNLOAD_FAILED" = "Download failed";+"AUDIO_SAVED" = "Audio saved";+"DOWNLOAD_COMPLETED" = "Download completed";+"CANNOT_SAVE_TO_PHOTOS" = "Cannot save to Photos";+"FINA_VIDEO" = "Finalizing video...";+"MERGING_VID_FALLBACK" = "Merging video with fallback...";+"MERGING_VID" = "Merging video...";+"CONVERTING" = "Converting to";+"ALREADY_DOWNLOADING" = "Already downloading";+"DOWNLOAD_CANCELLED" = "Download cancelled";+"TRIMMING_AUDIO" = "Trimming audio...";+"SHOW_THUMBNAIL" = "Show thumbnail";+"COPY_THUMBNAIL" = "Copy thumbnail";+"THUMBNAIL_OPTIONS" = "Download thumbnail";+"COPY" = "Copy";+"COPIED_TO_CLIPBOARD" = "Copied to clipboard";+"CONNECTING_TO_SERVER" = "Connecting to the server...";+"DOWNLOADING_TO_SERVER" = "Downloading to the server...";+"COPY_COMMENT_TEXT" = "Copy comment text";+"SAVE_COMMENT_IMAGE" = "Save comment as image";+"COPY_COMMENT_IMAGE" = "Copy comment as image";+"COPY_POST_TEXT" = "Copy post text";+"SAVE_POST_IMAGE" = "Save post as image";+"COPY_POST_IMAGE" = "Copy post as image";+"DOWNLOAD_SERVER" = "Download server";+"CHOOSE_DOWNLOAD_SERVER" = "Choose download server";+"DOWNLOAD_COMMENT" = "Save comment information";+"DOWNLOAD_COMMENT_DESC" = "Allows to copy comment text and save comment as image by long tap on the three dots button.";+"DOWNLOAD_POST" = "Save post information";+"DOWNLOAD_POST_DESC" = "Allows to copy post text and save post as image by long tap.";+"TRANSLATE_COMMENT" = "Translate comment";+"TRANSLATE_POST" = "Translate post";+"SERVER_EUROPRE1" = "Europe";+"SERVER_ASIA1" = "Thailand - Asia";+"SHOW_OPTIONS" = "Show options";+"ENGLISH" = "English";+"TRANSLATION" = "Translation";+"LANGUAGE" = "Language";+"TRANSLATING" = "Translating...";+"SELECT_LANG" = "Select language";+"TRANSLATE_FAILED" = "Failed to translate, please try again.";+"SAVE_CURRENT_IMAGE" = "Save current image";+"COPY_CURRENT_IMAGE" = "Copy current image";+"DOWNLOAD_METHOD" = "Download method";+"DOWNLOAD_METHOD_DESC" = "How videos are downloaded. On-device works on the latest YouTube versions.";+"METHOD_DIRECT" = "Direct";+"METHOD_SERVER" = "Server";+"METHOD_ONDEVICE" = "On-device (SABR)";++"APPEARANCE" = "Appearance";+"OLED_THEME" = "OLED dark mode";+"OLED_THEME_DESC" = "Uses pure black (OLED) color for the app dark theme.";+"OLED_KEYBOARD" = "OLED keyboard";+"OLED_KEYBOARD_DESC" = "Make the keyboard uses a pure black (OLED) color for dark theme.";++"NAVBAR" = "Navigation bar";+"STICKY_NAVBAR" = "Sticky Navigation bar";+"STICKY_NAVBAR_DESC" = "Pins the Navigation bar so that it remains visible when scrolling down.";+"NAVIGATION_ICON" = "Navigation icon";+"NAVIGATION_ICON_DESC" = "Change YouTube logo in the navigation bar.";+"PREMIUM" = "Premium";+"REMOVE_YTLOGO" = "Remove logo";+"YOUTUBE" = "YouTube";+"HIDE_NOTIFICATION_BUTTON" = "Hide notification button";+"HIDE_NOTIFICATION_BUTTON_DESC" = "Hide notification button in the navigation bar.";+"HIDE_SEARCH_BUTTON" = "Hide search button";+"HIDE_SEARCH_BUTTON_DESC" = "Hide search button in the navigation bar.";+"HIDE_VOICE_SEARCH_BUTTON" = "Hide voice search button";+"HIDE_VOICE_SEARCH_BUTTON_DESC" = "Hide voice search button in the navigation bar.";+"HIDE_CAST_BUTTON_NAVBAR" = "Hide cast button";+"HIDE_CAST_BUTTON_NAVBAR_DESC" = "Hide cast button in the navigation bar.";++"FEED" = "Feed";+"HIDE_SUBBAR" = "Hide subbar";+"HIDE_SUBBAR_DESC" = "Hide subbar at the top of the feed.";+"HIDE_HORI_SHELF" = "Remove horizontal feeds";+"HIDE_HORI_SHELF_DESC" = "Removes all horizontal feeds (News, Continue Watching, Posts collection, etc.) from the feed, except Playables.";+"HIDE_MUSIC_PLAYLISTS" = "Hide music playlist generator";+"HIDE_MUSIC_PLAYLISTS_DESC" = "Hide music playlist generator (Select music tunes in three) in the feed.";+"HIDE_FEED_POST" = "Hide posts";+"HIDE_FEED_POST_DESC" = "Hide posts in feed.";+"HIDE_SURVEYS" = "Hide surveys";+"HIDE_SURVEYS_DESC" = "Hide video surveys that YouTube shows sometimes.";+"HIDE_SHORTS_SHELF" = "Hide Shorts shelf";+"HIDE_SHORTS_SHELF_DESC" = "Hide Shorts shelf in the feed, including in the Subscriptions tab.";+"KEEP_SHORTS_SUBSCRIPT" = "Keep Shorts in Subscriptions";+"KEEP_SHORTS_SUBSCRIPT_DESC" = "Prevents removing Shorts from Subscriptions tab.";+"HIDE_SEARCH_HISTORY" = "Hide search history";+"HIDE_SEARCH_HISTORY_DESC" = "Hide previous search history and suggestions when using the search bar.\\nNOTE: Your search history will still be accessible in your other YouTube clients.";+"REMOVE_CHANNEL_COMMUNITY_BUTTON" = "Remove community button";+"REMOVE_CHANNEL_COMMUNITY_BUTTON_DESC" = "Removes the community button on channel headers.";+"REMOVE_CHANNEL_SPONSOR_BUTTON" = "Remove sponsor button";+"REMOVE_CHANNEL_SPONSOR_BUTTON_DESC" = "Removes the sponsor / join channel button across feeds, channel headers, and Shorts.";+"HIDE_PLAYABLES" = "Remove playables";+"HIDE_PLAYABLES_DESC" = "Removes playables (mini-games) from the feed.";+"HIDE_RELATED_VIDEOS" = "Hide related videos";+"HIDE_RELATED_VIDEOS_DESC" = "Hide related videos below the player. (Not in the overlay)";++"PLAYER" = "Player";+"PLAYBACK_SPEED" = "Playback speed";+"CONTROL_CENTER" = "Control Center";+"PLAYER_ACTIONS" = "Player actions";+"GESTURE_HEADER" = "Gestures";+"QUALITY_WIFI" = "Playback quality on WiFi";+"QUALITY_WIFI_DESC" = "Automatically applies the selected quality when streaming over Wi-Fi.";+"QUALITY_CELLULAR" = "Playback quality on Cellular";+"QUALITY_CELLULAR_DESC" = "Automatically applies the selected quality when streaming over mobile data.";+"QUALITY_LOW_POWER" = "Playback quality on Power saver mode";+"QUALITY_LOW_POWER_DESC" = "Automatically applies the selected quality when when Low power mode is enabled on your device.";+"DEFAULT" = "Default";+"BEST" = "Best";+"AUDIO_TRACK" = "Preferred audio track";+"ORIGINAL" = "Original";+"SELECT_MANUALLY" = "Select manually";+"AUDIO_TRACK_SELECT" = "Selected audio track";+"AUDIO_TRACK_SELECT_DESC" = "Specifies the preferred audio track language to use for playback, if available.";+"NO_AUTO_DUBBED" = "Uses original audio track";+"NO_AUTO_DUBBED_DESC" = "Uses original audio track if the preferred language track is auto-dubbed or not found.";+"CAPTION_TRACK" = "Preferred captions";+"CAPTION_TRACK_SELECT" = "Selected captions";+"CAPTION_TRACK_SELECT_DESC" = "Specifies the preferred captions language to display, if available.";+"DISABLES_CAPTION_TRACK" = "Automatically disable captions";+"DISABLES_CAPTION_TRACK_DESC" = "Automatically disable captions if the preferred language is auto-generated or not found.";+"DEFAULT_SPEED" = "Default playback rate";+"DEFAULT_SPEED_DESC" = "Overrides the default playback speed.";+"QUALITY_BUTTON" = "Quality controls";+"SPEED_BUTTON" = "Speed controls";+"MUTE_BUTTON" = "Mute";+"SHARE_BUTTON" = "Share";+"LOOP_BUTTON" = "Loop";+"CAPTION_BUTTON" = "Captions";+"DOWNLOAD_BUTTON" = "Download";+"SPONSORBLOCK_BUTTON" = "SponsorBlock";+"MANAGE_OVERLAY_BUTTONS" = "Manage overlay buttons";+"MANAGE_OVERLAY_BUTTONS_DESC" = "Reorder and toggle overlay buttons";+"OVERLAY_BUTTON_REORDER_HINT" = "Drag to reorder overlay buttons. Toggle to show/hide.";+"HOLD_TO_SPEED" = "Hold to speed";+"HOLD_TO_SPEED_DESC" = "Uses custom hold to speed playback rate.";+"HIDE_AUTOPLAY" = "Hide autoplay switch";+"HIDE_AUTOPLAY_DESC" = "Hide autoplay switch in the video overlay.";+"HIDE_CAPTIONS_BUTTON" = "Hide captions button";+"HIDE_CAPTIONS_BUTTON_DESC" = "Hide captions button in the video overlay.";+"HIDE_CAST_BUTTON_PLAYER" = "Hide cast button";+"HIDE_CAST_BUTTON_PLAYER_DESC" = "Hide cast button in the video overlay.";+"HIDE_NEXT_AND_PREV_BUTTON" = "Hide previous and next buttons";+"HIDE_NEXT_AND_PREV_BUTTON_DESC" = "Hide previous and next buttons in the video overlay.";+"REPLACE_PREVNEXT_BUTTONS" = "Replace Previous/Next buttons";+"REPLACE_PREVNEXT_BUTTONS_DESC" = "Replaces the Previous and Next video buttons in the player with Rewind and Fast Forward buttons.";+"REMOVE_DARK_OVERLAY" = "Remove dark overlay";+"REMOVE_DARK_OVERLAY_DESC" = "Remove dark overlay from the video overlay.";+"HIDE_END_SCREEN" = "Hide endscreen cards";+"HIDE_END_SCREEN_DESC" = "Hide endscreen cards shown before the video ends.";+"REMOVE_AMBIANT" = "Remove Ambient lights";+"REMOVE_AMBIANT_DESC" = "Removes the glowing ambient lights effects behind the video player.";+"HIDE_SUGGESTED_VIDEO" = "Hide suggested videos";+"HIDE_SUGGESTED_VIDEO_DESC" = "Hide the grid of suggested videos that appears when a video finishes playing.";+"HIDE_PAID_OVERLAY" = "Hide 'Includes paid promotion'";+"HIDE_PAID_OVERLAY_DESC" = "Hide 'Includes paid promotion' in the video overlay.";+"HIDE_WATERMARK" = "Hide watermark";+"HIDE_WATERMARK_DESC" = "Hide channel watermark at the bottom of the video overlay.";+"PAUSE_ON_OVERLAY" = "Pause on overlay";+"PAUSE_ON_OVERLAY_DESC" = "Sets playback on pause if overlay appears.";+"DISABLES_SNAP_TO_CHAPTER" = "Disable snap to chapters";+"DISABLES_SNAP_TO_CHAPTER_DESC" = "Prevents the scrubbar stick to the chapters.";+"DISABLES_ENGAGE_PANEL" = "Disables engagement panel in fullscreen";+"DISABLES_ENGAGE_PANEL_DESC" = "Prevent engagement panel showing in fullscreen.";+"GESTURES" = "Enable gestures controls";+"GESTURES_DESC" = "Swipe up or down on the left/right edges of the video screen to adjust brightness, volume, or playback speed.";+"GESTURE_AREA" = "Gesture activation area";+"GESTURE_AREA_DESC" = "Adjust the area on the edges where gestures are active. (Setting to 50% splits the screen in half with no dead zone in the middle.)";+"LEFT_SIDE_GESTURE" = "Left side swipe gesture";+"RIGHT_SIDE_GESTURE" = "Right side swipe gesture";+"GESTURE_BRIGHTNESS" = "Brightness";+"GESTURE_VOLUME" = "Volume";+"GESTURE_SPEED" = "Playback speed";+"GESTURE_NONE" = "None";+"GESTURE_HUD" = "Show gesture HUD";+"GESTURE_HUD_DESC" = "Displays the current percentage (%) on the screen when adjusting brightness, volume, or playback speed.";+"GESTURE_HUD_SIZE" = "Gesture HUD size";+"GESTURE_HUD_SIZE_DESC" = "Adjust the text and icon size of the gesture HUD.";+"SMALL" = "Small (-1)";+"NORMAL" = "Normal (Default)";+"LARGE" = "Large (+1)";+"EXTRALARGE" = "Extra large (+2)";+"MAX" = "Max (+3)";+"GESTURE_HUD_POSITION" = "Gesture HUD position";+"GESTURE_HUD_POSITION_DESC" = "Set the vertical position of the gesture HUD (Top, Middle, Bottom).";+"TOP" = "Top";+"MIDDLE" = "Middle";+"BOTTOM" = "Bottom";+"DISABLES_DOUBLE_TAP" = "Disables double tap";+"DISABLES_DOUBLE_TAP_DESC" = "Disables double tap to seek in the video overlay.";+"DISABLES_LONG_HOLD" = "Disables long hold";+"DISABLES_LONG_HOLD_DESC" = "Disables long hold to speed up the video in the video overlay.";+"AUTO_EXIT_FULLSCREEN" = "Auto exit fullscreen";+"AUTO_EXIT_FULLSCREEN_DESC" = "Automatically exit fullscreen after the video ends.";+"AUTO_FEED_MUTE" = "Auto mute feed videos";+"AUTO_FEED_MUTE_DESC" = "Automatically mute videos playing in feeds.";+"DISABLES_SHOW_REMAINING" = "Disable remaining time";+"DISABLES_SHOW_REMAINING_DESC" = "Disable the feature that shows how much time is left in a video when tapping the timestamp.";+"ALWAYS_SHOW_REMAINING" = "Always show remaining time";+"ALWAYS_SHOW_REMAINING_DESC" = "Ensure the remaining time is always displayed by default in the player overlay.";+"COPY_TIMESTAMP_ON_PAUSE" = "Copy timestamped links";+"COPY_TIMESTAMP_ON_PAUSE_DESC" = "Allows to copy timestamped link to the clipboard by pressing pause button.";+"SHOW_REMAINING_EXTRA" = "Show extra remaining time";+"SHOW_REMAINING_EXTRA_DESC" = "Adds the estimated finish time to the label in the video overlay.";+"HIDE_FULLSCREEN_ACTIONS" = "Hide fullscreen actions";+"HIDE_FULLSCREEN_ACTIONS_DESC" = "Hide quick action buttons (Like, Dislike, More videos, etc.) when the video is in fullscreen mode.";+"HIDE_FULL_VID_TITLE" = "Hide fullscreen video title";+"HIDE_FULL_VID_TITLE_DESC" = "Hide the video title displayed at the top left in fullscreen mode.";+"STOP_AUTOPLAY_VIDEO" = "Disable autoplay";+"STOP_AUTOPLAY_VIDEO_DESC" = "Prevent the video in playing automatically when opening the video.";+"HIDE_CONTENT_WARNING" = "Skip content warning";+"HIDE_CONTENT_WARNING_DESC" = "Automatically skip the sensitive content warning alert in some vidoes.";+"AUTO_FULLSCREEN" = "Auto fullscreen";+"AUTO_FULLSCREEN_DESC" = "Automatically enter fullscreen mode when starting video playback.";+"PORTRAIT_FULLSCREEN" = "Portrait fullscren mode";+"PORTRAIT_FULLSCREEN_DESC" = "Enables portrait fullscreen mode support.";+"OLD_QUALITY_PICKER" = "Use old quality picker";+"OLD_QUALITY_PICKER_DESC" = "Reverts the video quality selection menu to the classic version (lists all resolutions immediately).";+"EXTRA_SPEED" = "Extra speed options";+"EXTRA_SPEED_DESC" = "Adds more video playback speed options up to 10x.";+"FORCE_MINIPLAYER" = "Force miniplayer";+"FORCE_MINIPLAYER_DESC" = "Allows all videos, including those made for kids, to play in the miniplayer when dismissing the player.";+"FORCE_SEEKBAR" = "Always show progress bar";+"FORCE_SEEKBAR_DESC" = "Makes the progress bar (seekbar) remains visible at all times while in fullscreen mode.";+"TAP_TO_SEEK" = "Tap to seek";+"TAP_TO_SEEK_DESC" = "Quickly jump to any point by tapping the progress bar.";+"DISABLES_ZOOM" = "Disable free zoom gesture";+"DISABLES_ZOOM_DESC" = "Disables new free zoom gestures.";+"USES_24_HOURS_TIME" = "24-hour format";+"USES_24_HOURS_TIME_DESC" = "Shows end time in 24-hour format.";+"PAUSE_TWO_FINGERS" = "Pause using two fingers";+"PAUSE_TWO_FINGERS_DESC" = "Pause/Resume playback by tapping on the screen using two fingers.";+"SKIP_BACKWARD" = "Skip backward";+"SKIP_BACKWARD_DESC" = "Replaces the previous track button in Control Center with a skip backward button by a set number of seconds.";+"SKIP_FORWARD" = "Skip forward";+"SKIP_FORWARD_DESC" = "Replaces the next track button in Control Center with a skip forward button by a set number of seconds.";+"REWIND_SECONDS" = "Rewind seconds";+"FORWARD_SECONDS" = "Fast-forward seconds";+"HIDE_COMMENTS_SECTION" = "Hide comments section";+"HIDE_COMMENTS_SECTION_DESC" = "Completely removes the entire comments section.";+"HIDE_COMMENTS_PREVIEW" = "Hide preview comments";+"HIDE_COMMENTS_PREVIEW_DESC" = "Removes the preview box for the top comment while keeping the full section expandable.";+"LOCK_SPEED" = "Lock speed";+"LOCK_SPEED_DESC" = "Locks at adjusted speed by swiping down.";+"SEEK_ON_OVERLAY" = "Seek on overlay";+"SEEK_ON_OVERLAY_DESC" = "Allows controlling playback seeking by swiping left and right on the video overlay.";+"DRC_AUDIO_OPTIONS" = "Auto Stable volume";+"DRC_AUDIO_OPTIONS_DESC" = "Automatically chooses whether to enable or disable Stable volume.";+"REMOVE_VIDEO_LIKE_BUTTON" = "Remove like button";+"REMOVE_VIDEO_LIKE_BUTTON_DESC" = "Removes the like button under the video player and in fullscreen overlay.";+"REMOVE_VIDEO_DISLIKE_BUTTON" = "Remove dislike button";+"REMOVE_VIDEO_DISLIKE_BUTTON_DESC" = "Removes the dislike button under the video player and in fullscreen overlay.";+"REMOVE_VIDEO_SHARE_BUTTON" = "Remove share button";+"REMOVE_VIDEO_SHARE_BUTTON_DESC" = "Removes the share button under the video player and in fullscreen overlay.";+"REMOVE_VIDEO_SAVE_BUTTON" = "Remove save button";+"REMOVE_VIDEO_SAVE_BUTTON_DESC" = "Removes the save to playlist button under the video player and in fullscreen overlay.";+"REMOVE_VIDEO_DOWNLOAD_BUTTON" = "Remove download button";+"REMOVE_VIDEO_DOWNLOAD_BUTTON_DESC" = "Removes the download button under the video player and in fullscreen overlay.";+"REMOVE_VIDEO_CLIP_BUTTON" = "Remove clip button";+"REMOVE_VIDEO_CLIP_BUTTON_DESC" = "Removes the clip button under the video player and in fullscreen overlay.";+"REMOVE_VIDEO_REMIX_BUTTON" = "Remove remix button";+"REMOVE_VIDEO_REMIX_BUTTON_DESC" = "Removes the remix button under the video player and in fullscreen overlay.";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON" = "Remove live chat button";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON_DESC" = "Removes the live chat button under the video player and in fullscreen overlay.";++"SHORTS" = "Shorts";+"HIDE_SHORTS_TOPBAR" = "Hide topbar";+"HIDE_SHORTS_TOPBAR_DESC" = "Hide all the topbar view in the player.";+"HIDE_SHORTS_SUBBAR" = "Hide subbar";+"HIDE_SHORTS_SUBBAR_DESC" = "Hide the Shorts type bar in the player.";+"SHORTS_ONLY" = "Shorts only mode";+"SHORTS_ONLY_DESC" = "Limits YouTube functionality to viewing Shorts only. You can disable Shorts only mode by long pressing with two fingers in the Shorts player.";+"SHORTS_ONLY_DISABLED" = "Shorts only mode has been turned off";+"SHORTS_ACTION" = "Shorts action after the video ends";+"LOOP" = "Loop";+"SKIP_TO_NEXT_SHORTS" = "Skip to next";+"PAUSE_SHORTS" = "Stop";+"REMOVE_LIVE_SHORTS" = "Remove live videos";+"REMOVE_LIVE_SHORTS_DESC" = "Removes live videos from the feed.";+"HIDE_SHORTS_PRODUCT" = "Hide products";+"HIDE_SHORTS_PRODUCT_DESC" = "Hide tagged products and shopping links in the Shorts overlay.";+"HIDE_SHORTS_RECBAR" = "Hide recommendation bar";+"HIDE_SHORTS_RECBAR_DESC" = "Hide the suggested action bar in the Shorts player (e.g. Try this sound, Shopping, Preview comment).";+"HIDE_SHORTS_DISCLOSURE" = "Hide 'Earns commission'";+"HIDE_SHORTS_DISCLOSURE_DESC" = "Hide 'Earns commission' disclosure overlay in Shorts.";+"REMOVE_SHORTS_LIKE_BUTTON" = "Remove like button";+"REMOVE_SHORTS_LIKE_BUTTON_DESC" = "Removes the like button from the Shorts overlay.";+"REMOVE_SHORTS_COMMENT_BUTTON" = "Remove comment button";+"REMOVE_SHORTS_COMMENT_BUTTON_DESC" = "Removes the comment button from the Shorts overlay.";+"REMOVE_SHORTS_SHARE_BUTTON" = "Remove share button";+"REMOVE_SHORTS_SHARE_BUTTON_DESC" = "Removes the share button from the Shorts overlay.";+"REMOVE_SHORTS_REMIX_BUTTON" = "Remove remix button";+"REMOVE_SHORTS_REMIX_BUTTON_DESC" = "Removes the remix button from the Shorts overlay.";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON" = "Remove sound metadata button";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON_DESC" = "Removes the sound metadata button from the Shorts overlay.";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON" = "Remove subscriptions button";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON_DESC" = "Removes the subscriptions button from the Shorts pause header.";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON" = "Remove live button";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON_DESC" = "Removes the live button from the Shorts pause header.";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON" = "Remove lens button";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON_DESC" = "Removes the lens button from the Shorts pause header.";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON" = "Remove trends button";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON_DESC" = "Removes the trends button from the Shorts pause header.";+"ENABLES_SHORTS_QUALITY" = "Enable Shorts quality picker";+"ENABLES_SHORTS_QUALITY_DESC" = "Force enable the video quality selection menu in Shorts.";+"SHOW_SHORTS_SEEKBAR" = "Always show seekbar";+"SHOW_SHORTS_SEEKBAR_DESC" = "Ensure the progress/seek bar is always visible at the bottom of the Shorts player.";+"REMOVE_POSTS_SHORTS" = "Remove posts";+"REMOVE_POSTS_SHORTS_DESC" = "Remove posts from the feed.";+"SHORTS_FULLSCREEN" = "Pinch to Fullscreen";+"SHORTS_FULLSCREEN_DESC" = "Manages visibility of the overlay with pinch in and pinch out gestures, displaying Shorts in fullscreen mode.";++"TABBAR" = "Tab bar";+"DEFAULT_TAB" = "Default startup tab";+"FORSTED_TAB_BAR" = "Translucent tab bar";+"ENABLED" = "Enabled";+"HOME_TAB" = "Home";+"SHORTS_TAB" = "Shorts";+"CREATE_TAB" = "Create";+"SUBSCRIPTIONS_TAB" = "Subscriptions";+"LIBRARY_TAB" = "Library (You)";+"HIDE_TAB_INDI" = "Hide tab indicators";+"HIDE_TAB_INDI_DESC" = "Hide all tab indicators in the tab bar.";+"HIDE_TAB_LABELS" = "Hide tab labels";+"HIDE_TAB_LABELS_DESC" = "Hide all tab labels in the tab bar.";+"HISTORY_TAB" = "History";+"GAMING_TAB" = "Gaming";+"SPORTS_TAB" = "Sports";+"NOTI_TAB" = "Notifications";+"NEWS_TAB" = "News";+"MUSIC_TAB" = "Music";+"WATCH_LATER_TAB" = "Watch later";+"PLAYLIST_TAB" = "Playlists";+"LIKE_TAB" = "Liked videos";+"LIVE_TAB" = "Live";+"POST_TAB" = "Posts";+"VIDEO_TAB" = "Your videos";+"MOVIE_TAB" = "Movies";+"COURSE_TAB" = "Courses";+"MINIGAME_TAB" = "Playables";+"FASHION_TAB" = "Fashion & Beauty";+"LEARNING_TAB" = "Learning";+"MANAGE_TABS" = "Manage tabs";+"MANAGE_TABS_DESC" = "Reorder and toggle tabs";+"TAB_REORDER_HINT" = "Drag to reorder. Toggle to show/hide.\\nTab settings are also accessible by long-pressing the first tab in the tab bar.";+"TAB_LIMIT" = "Tab limit";+"TAB_LIMIT_DESC" = "Only 6 tabs are allowed.";+"ZERO_TAB_DESC" = "At least 1 tab has to be enabled.";++"MISCELLANEOUS" = "Miscellaneous";+"BACKGROUND_PLAYBACK" = "Background playback";+"BACKGROUND_PLAYBACK_DESC" = "Enables background playback for videos.";+"DISABLES_SHORTS_PIP" = "Disables Shorts PiP";+"DISABLES_SHORTS_PIP_DESC" = "Try to disables Shorts PiP, this might not 100% disables it.";+"DISABLE_HINTS" = "Disable hints";+"DISABLE_HINTS_DESC" = "Disable the tutorial hints and interactive pop-ups.";+"BLOCK_UPGRADE_DIALOGS" = "Block upgrade dialogs";+"BLOCK_UPGRADE_DIALOGS_DESC" = "Block the YouTube dialogs that ask you to upgrade the app.";+"ARE_YOU_THERE_DIALOG" = "Hide 'Are you there?' dialog";+"ARE_YOU_THERE_DIALOG_DESC" = "Hide the dialog when you are inactive in the app for too long.";+"FIXES_SLOW_MINIPLAYER" = "Fixes slows miniplayer";+"FIXES_SLOW_MINIPLAYER_DESC" = "Fixes the miniplayer slowness of expanding the video, this only works in older YouTube versions.";+"DISABLES_NEW_MINIPLAYER" = "Disables new miniplayer";+"DISABLES_NEW_MINIPLAYER_DESC" = "Use the old-style miniplayer instead of the new one, this only works in older YouTube versions.";+"DISABLES_SNACK_BAR" = "Disables snack bar";+"DISABLES_SNACK_BAR_DESC" = "Disables snack bar when pressing some buttons or doing something in the app.";+"HIDE_STARTUP_ANIMATIONS" = "Hide YouTube's startup animations";+"HIDE_STARTUP_ANIMATIONS_DESC" = "Hide YouTube's startup animations when opening the app.";+"HIDE_LIKE_DISLIKE_VOTES" = "Hide like/dislike votes";+"HIDE_LIKE_DISLIKE_VOTES_DESC" = "Hide messages that pop up when you like/dislike videos.";+"FLYOUT_MENU" = "Flyout menu";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION" = "Removes 'Play next in queue' option";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION_DESC" = "Removes 'Play next in queue' option from the flyout menu.";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION" = "Removes 'Play last in queue' option";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION_DESC" = "Removes 'Play last in queue' option from the flyout menu.";+"REMOVE_DOWNLOAD_OPTION" = "Removes 'Download video' option";+"REMOVE_DOWNLOAD_OPTION_DESC" = "Removes 'Download video' option from the flyout menu.";+"REMOVE_WATCH_LATER_OPTION" = "Removes 'Save to Watch later' option";+"REMOVE_WATCH_LATER_OPTION_DESC" = "Removes 'Save to Watch Later' option from the flyout menu.";+"REMOVE_SAVE_OPTION" = "Removes 'Save to playlist' option";+"REMOVE_SAVE_OPTION_DESC" = "Removes 'Save to playlist' option from the flyout menu.";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION" = "Removes 'Remove from playlist' option";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION_DESC" = "Removes 'Remove from playlist' option from the flyout menu.";+"REMOVE_SHARE_OPTION" = "Removes 'Share' option";+"REMOVE_SHARE_OPTION_DESC" = "Removes 'Share' option from the flyout menu.";+"REMOVE_NOT_INTERESTED_OPTION" = "Removes 'Not interested' option";+"REMOVE_NOT_INTERESTED_OPTION_DESC" = "Removes 'Not interested' option from the flyout menu.";+"REMOVE_DONT_RECOMMEND_OPTION" = "Removes 'Don't recommend channel' option";+"REMOVE_DONT_RECOMMEND_OPTION_DESC" = "Removes 'Don't recommend channel' option from the flyout menu.";+"REMOVE_INFO_OPTION" = "Removes 'Why are you seeing this?' option";+"REMOVE_INFO_OPTION_DESC" = "Removes 'Why are you seeing this?' option from the flyout menu.";+"REMOVE_FILTER_OPTION" = "Removes 'Search filters' option";+"REMOVE_FILTER_OPTION_DESC" = "Removes 'Search filters' option from the flyout menu.";+"REMOVE_REPORT_OPTION" = "Removes 'Report' option";+"REMOVE_REPORT_OPTION_DESC" = "Removes 'Report' option from the flyout menu.";+"REMOVE_YOUTUBE_MUSIC_OPTION" = "Removes 'Listen with YouTube Music' option";+"REMOVE_YOUTUBE_MUSIC_OPTION_DESC" = "Removes 'Listen with YouTube Music' option from the flyout menu.";+"REMOVE_FEED_BACK_OPTION" = "Removes 'Send feedback' option";+"REMOVE_FEED_BACK_OPTION_DESC" = "Removes 'Send feedback' option from the flyout menu.";+"REMOVE_CAST_OPTION" = "Removes 'Watch on TV' option";+"REMOVE_CAST_OPTION_DESC" = "Removes 'Watch on TV' option from the flyout menu.";+"REMOVE_SHUFFLE_OPTION" = "Removes 'Shuffle' option";+"REMOVE_SHUFFLE_OPTION_DESC" = "Removes 'Shuffle' option from the flyout menu.";+"REMOVE_UN_SUB_OPTION" = "Removes 'Unsubscribe' option";+"REMOVE_UN_SUB_OPTION_DESC" = "Removes 'Unsubscribe' option from the flyout menu.";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION" = "Removes 'Hide video from playlist' option";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION_DESC" = "Removes 'Hide video from playlist' option from the flyout menu.";+"REMOVE_HELP_OPTION" = "Removes 'Help & feedback' option";+"REMOVE_HELP_OPTION_DESC" = "Removes 'Help & feedback' option from the flyout menu.";+"REMOVE_NOTIFY_OPTION" = "Removes 'Notify me' option";+"REMOVE_NOTIFY_OPTION_DESC" = "Removes 'Notify me' option from the flyout menu.";+"REMOVE_CLEARSCREEN_OPTION" = "Removes 'Clear Screen' option";+"REMOVE_CLEARSCREEN_OPTION_DESC" = "Removes 'Clear Screen' option from the flyout menu.";+"HIDE_COMMU_GUIDE" = "Hide community guidelines";+"HIDE_COMMU_GUIDE_DESC" = "Hide community guidelines header.";+"HIDE_ENGAGEMENT_SUBBAR" = "Hide comments header";+"HIDE_ENGAGEMENT_SUBBAR_DESC" = "Hides sort comments header (Top, Newest) so it will never appear.";+"DISABLES_RTL" = "Disable RTL formatting";+"DISABLES_RTL_DESC" = "Forcefully displays text in left-to-right (LTR) format for languages that are initially displayed in right-to-left (RTL).";+"DEVICE_UI" = "Interface style";+"OPEN_LINK" = "Open link";+"FLOATING_KEYBOARD" = "Floating keyboard";+"FLOATING_KEYBOARD_DESC" = "Force-enables the floating keyboard. Useful for iPhones with iPad style spoofing.\\nNote: Works ONLY when iPad style is selected.";+"AUTO_OPEN_LINK" = "Auto-check clipboard";+"AUTO_OPEN_LINK_DESC" = "Check clipboard for YouTube-related links each time the app is opened.\\nFor proper functionality, go to iOS Settings → YouTube → Paste from other apps and select 'Allow'";++"SB_DESCRIPTION" = "Skip sponsored segments automatically using community-submitted data.";+"SB_ENABLE" = "Enable SponsorBlock";+"SB_ENABLE_DESC" = "Activate the SponsorBlock extension to skip sponsored segments.";+"SB_SHOW_BUTTON" = "Show overlay button";+"SB_SHOW_BUTTON_DESC" = "Display a SponsorBlock toggle button in the player overlay.";+"SB_SHOW_NOTIFICATIONS" = "Show notifications";+"SB_SHOW_NOTIFICATIONS_DESC" = "Display notifications when segments are skipped. Notifications for manual-skip categories are always shown.";+"SB_HAPTIC_FEEDBACK" = "Haptic feedback";+"SB_HAPTIC_FEEDBACK_DESC" = "Provide haptic feedback when a segment is skipped.";+"SB_SEGMENTS_IN_PLAYER" = "Segments in player";+"SB_SEGMENTS_IN_PLAYER_DESC" = "Display colored segments on the progress bar of the main video player.";+"SB_SEGMENTS_IN_FEED" = "Segments in feed";+"SB_SEGMENTS_IN_FEED_DESC" = "Display colored segments on the progress bar of players in the feed.";+"SB_SEGMENTS_IN_MINIPLAYER" = "Segments in mini-player";+"SB_SEGMENTS_IN_MINIPLAYER_DESC" = "Display colored segments on the progress bar of the mini-player.";+"SB_SHOW_DURATION" = "Show duration without segments";+"SB_SHOW_DURATION_DESC" = "Display the total video duration excluding skippable segments.";+"SB_CATEGORIES_HEADER" = "Segment categories";+"SB_SEGMENT_COLOR" = "Segment color";++"SB_ACTION_DISABLE" = "Disable";+"SB_ACTION_AUTO_SKIP" = "Auto-skip";+"SB_ACTION_ASK" = "Ask before skipping";+"SB_ACTION_DISPLAY" = "Show on seek bar only";+"SB_ACTION_SKIP_TO" = "Skip to segment";++"SB_CAT_sponsor" = "Sponsor";+"SB_CAT_sponsor_DESC" = "Paid promotion for a product or service not directly related to the creator.";+"SB_CAT_intro" = "Intro";+"SB_CAT_intro_DESC" = "Intermission or intro animation typically seen at the start of a video.";+"SB_CAT_outro" = "Endcards";+"SB_CAT_outro_DESC" = "Endcards, credits, or outros at the end of the video.";+"SB_CAT_interaction" = "Interaction";+"SB_CAT_interaction_DESC" = "Reminders to like, subscribe, or follow on social media.";+"SB_CAT_selfpromo" = "Self-promotion";+"SB_CAT_selfpromo_DESC" = "Unpaid promotion of the creator's own products, merchandise, or other content.";+"SB_CAT_music_offtopic" = "Non-music";+"SB_CAT_music_offtopic_DESC" = "Non-music sections in music videos (e.g. talking, introductions).";+"SB_CAT_preview" = "Preview";+"SB_CAT_preview_DESC" = "Recap or preview of content from another video or previous episode.";+"SB_CAT_hook" = "Hook/Greetings";+"SB_CAT_hook_DESC" = "Narrated trailers for the upcoming video, greetings and goodbyes.";+"SB_CAT_poi_highlight" = "Highlight";+"SB_CAT_poi_highlight_DESC" = "The key moment or highlight point of the video. Use 'Skip to' to jump directly to it.";+"SB_CAT_filler" = "Filler";+"SB_CAT_filler_DESC" = "Tangential content, jokes, or filler that is not directly related to the main topic.";++"SB_SKIPPED" = "%@ segment has been skipped";+"SB_DETECTED" = "%@ segment detected.\\nWould you like to skip the segment?";+"SB_SKIP_NOW" = "Skip";+"SB_UNSKIP" = "Unskip";+"SB_JUMPED_TO_HIGHLIGHT" = "Jumped to highlight";+"SB_JUMP_TO_HIGHLIGHT" = "Highlight available. Jump to the point?";+"SB_SEGMENT_COLOR_SUFFIX" = "Segment color";+"SB_SECTION_MAIN" = "Main";+"SB_SKIP_ALERT_DURATION" = "Skip alert duration";+"SB_UNSKIP_ALERT_DURATION" = "Unskip alert duration";+"SB_MIN_DURATION_SLIDER" = "Minimum segment duration to skip";\ No newline at end of filediff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/fr.lproj/Localizable.strings b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/fr.lproj/Localizable.stringsnew file mode 100644index 0000000..1a06945--- /dev/null+++ b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/fr.lproj/Localizable.strings@@ -0,0 +1,578 @@+"SETTINGS" = "Paramètres";+"INTERFACE" = "Interface";++"SEARCH" = "Rechercher";+"SEARCH_DESC" = "Rechercher dans les paramètres YouMod.";++"URL_COPIED" = "Lien de la vidéo copié";+"COPY_URL" = "Copier le lien de la vidéo";+"COPY_URL_TIMESTAMP" = "Copier le lien de la vidéo avec horodatage";+"URL_TIMESTAMP_COPIED" = "Lien de la vidéo avec horodatage copié";+"CANCEL" = "Annuler";+"ERROR" = "Erreur";+"ERROR_VIDEOID" = "Impossible d'obtenir l'identifiant de la vidéo";+"ERROR_ADS" = "Impossible de copier le lien de la vidéo pendant la lecture d'une publicité";++"LOOP_DISABLED" = "Lecture en boucle désactivée";+"LOOP_ENABLED" = "Lecture en boucle activée";++"NEW_ISSUES" = "Signaler un problème ou demander une fonctionnalité";+"NEW_ISSUES_DESC" = "Vous avez trouvé un bug ou souhaitez une nouveauté ? Appuyez ici.";+"SOURCE_CODES" = "Codes sources";+"SOURCE_CODES_DESC" = "Jetez un oeil au code !";++"EXTRA" = "Extra";+"FIX_PLAYBACK_ISSUES" = "Résoudre les problèmes de lecture (Temporaire)";+"FIX_PLAYBACK_ISSUES_DESC" = "Tente de résoudre les problèmes de lecture pour certains utilisateurs. Activer cette option rechargera automatiquement le lecteur à chaque fois qu'une erreur survient ou que la lecture échoue.";++"PERFER_HEADER" = "Préférences de YouMod";+"PERFER" = "Préférences";+"IMPORT" = "Importer les paramètres";+"IMPORT_DESC" = "Charger vos préférences depuis un fichier .plist.";+"IMPORT_DONE" = "Réussi";+"YES" = "Oui";+"APPLY_DESC" = "Un redémarrage de l'application est requis. Voulez-vous redémarrer l'application maintenant ?";+"EXPORT" = "Exporter les paramètres";+"EXPORT_DESC" = "Exporter vos préférences dans un fichier .plist.";+"RESTORE" = "Restaurer les paramètres";+"RESTORE_DESC" = "Charger les paramètres par défaut comme lors d'une nouvelle installation.";+"WARNING" = "Avertissement";+"RESETDEFAULT" = "Cela réinitialisera tous les paramètres par défaut. Voulez-vous continuer ?";+"ERROR_INVALID_FILE" = "Fichier invalide";+"ERROR_NO_KEYS_IMPORT" = "Aucune clé disponible à importer";+"ERROR_NO_KEYS_EXPORT" = "Aucune clé disponible à exporter";+"OVERRIDE" = "Cela écrasera les paramètres actuels. Voulez-vous continuer ?";+"DISABLED" = "Désactivé";++"CACHE" = "Gestion du cache";+"CLEARCACHE" = "Vider le cache";+"DONE" = "Terminé";+"AUTO_CLEARCACHE" = "Vider le cache automatiquement";+"AUTO_CLEARCACHE_DESC" = "Vide automatiquement le cache de l'application au démarrage.";++"DOWNLOADING" = "Téléchargement en cours";+"DOWNLOAD_MANAGER" = "Gestionnaire de téléchargement";+"DOWNLOAD_MANAGER_DESC" = "Remplace le téléchargeur de vidéos de YouTube par celui de YouMod. Permet de télécharger des vidéos, des pistes audio, des sous-titres et des miniatures.";+"POST_DOWNLOAD_ACTION" = "Action après téléchargement";+"POST_ACTION_SAVE_PHOTOS" = "Enregistrer dans Photos";+"POST_ACTION_SHARE" = "Partager";+"POST_ACTION_ASK" = "Demander";+"ADD_SHORTS_DOWNLOAD" = "Ajouter un bouton de téléchargement aux Shorts";+"ADD_SHORTS_DOWNLOAD_DESC" = "Ajoute un bouton de téléchargement en superposition sur les vidéos Shorts.";+"DOWNLOAD_SHORTS" = "Télécharger des Shorts";+"COPY_VID_INFO" = "Copier les informations de la vidéo";+"COPY_TITLE" = "Copier le titre";+"COPY_DESCRIPTION" = "Copier la description";+"COPY_ALL_VID_INFO" = "Copier tout";+"COPIED_TITLE" = "Titre de la vidéo copié";+"COPIED_DESCRIPTION" = "Description de la vidéo copiée";+"COPY_AUTHOR" = "Copier l'auteur";+"COPIED_AUTHOR" = "Auteur de la vidéo copié";+"SAVE_THUMBNAIL" = "Enregistrer la miniature";+"DOWNLOAD_CAPTIONS" = "Télécharger les sous-titres";+"DOWNLOAD_AUDIO" = "Télécharger l'audio";+"DOWNLOAD_VIDEO" = "Télécharger la vidéo";+"OPEN_VID_BEFORE" = "Ouvrez une vidéo avant d'utiliser le gestionnaire de téléchargement";+"NO_CAPTIONS_URL" = "Aucune URL de sous-titre valide trouvée";+"NO_AUDIO_URL" = "Aucune URL audio trouvée";+"NO_STREAM_URL" = "Aucune URL de flux trouvée";+"CAPTIONS_FAILED" = "Échec du téléchargement des sous-titres";+"NO_CAPTIONS" = "Aucun sous-titre disponible pour cette vidéo";+"NO_AUDIO_STREAM_FOUND" = "Aucun flux audio trouvé";+"NO_VID_AUDIO_STREAM_FOUND" = "Aucun flux vidéo/audio trouvé";+"COPIED_VID_INFO" = "Toutes les informations de la vidéo ont été copiées";+"SAVED_TO_PHOTOS" = "Enregistré dans Photos";+"SAVE_FAILED" = "Échec de l'enregistrement";+"PHOTO_ACCESS_DENINED" = "Accès aux Photos refusé";+"THUMBNAIL_FAILED" = "Échec de la miniature";+"DOWNLOADING_THUMBNAIL" = "Téléchargement de la miniature...";+"DOWNLOADING_AUDIO" = "Téléchargement de l'audio...";+"DOWNLOADING_VIDEO" = "Téléchargement de la vidéo...";+"DOWNLOADING_CAPTIONS" = "Téléchargement des sous-titres...";+"NO_THUMBNAIL_FOUND" = "Aucune miniature trouvée";+"DOWNLOAD_FAILED" = "Échec du téléchargement";+"AUDIO_SAVED" = "Audio enregistré";+"DOWNLOAD_COMPLETED" = "Téléchargement terminé";+"CANNOT_SAVE_TO_PHOTOS" = "Impossible d'enregistrer dans Photos";+"FINA_VIDEO" = "Finalisation de la vidéo...";+"MERGING_VID_FALLBACK" = "Fusion de la vidéo avec repli...";+"MERGING_VID" = "Fusion de la vidéo...";+"CONVERTING" = "Conversion vers";+"ALREADY_DOWNLOADING" = "Téléchargement déjà en cours";+"DOWNLOAD_CANCELLED" = "Téléchargement annulé";+"TRIMMING_AUDIO" = "Découpe de l'audio...";+"SHOW_THUMBNAIL" = "Afficher la miniature";+"COPY_THUMBNAIL" = "Copier la miniature";+"THUMBNAIL_OPTIONS" = "Télécharger la miniature";+"COPY" = "Copier";+"COPIED_TO_CLIPBOARD" = "Copié dans le presse-papiers";+"CONNECTING_TO_SERVER" = "Connexion au serveur...";+"DOWNLOADING_TO_SERVER" = "Téléchargement vers le serveur...";+"COPY_COMMENT_TEXT" = "Copier le texte du commentaire";+"SAVE_COMMENT_IMAGE" = "Enregistrer le commentaire sous forme d'image";+"COPY_COMMENT_IMAGE" = "Copier le commentaire sous forme d'image";+"COPY_POST_TEXT" = "Copier le texte de la publication";+"SAVE_POST_IMAGE" = "Enregistrer la publication sous forme d'image";+"COPY_POST_IMAGE" = "Copier la publication sous forme d'image";+"DOWNLOAD_SERVER" = "Serveur de téléchargement";+"CHOOSE_DOWNLOAD_SERVER" = "Choisir le serveur de téléchargement";+"DOWNLOAD_COMMENT" = "Enregistrer les informations du commentaire";+"DOWNLOAD_COMMENT_DESC" = "Permet de copier le texte d'un commentaire et de l'enregistrer sous forme d'image par un appui long sur le bouton des trois points.";+"DOWNLOAD_POST" = "Enregistrer les informations de la publication";+"DOWNLOAD_POST_DESC" = "Permet de copier le texte d'une publication et de l'enregistrer sous forme d'image par un appui long.";+"TRANSLATE_COMMENT" = "Traduire le commentaire";+"TRANSLATE_POST" = "Traduire la publication";+"SERVER_EUROPRE1" = "Europe";+"SERVER_ASIA1" = "Thaïlande - Asie";+"SHOW_OPTIONS" = "Afficher les options";+"ENGLISH" = "Anglais";+"TRANSLATION" = "Traduction";+"LANGUAGE" = "Langue";+"TRANSLATING" = "Traduction en cours...";+"SELECT_LANG" = "Sélectionner la langue";+"TRANSLATE_FAILED" = "Échec de la traduction, veuillez réessayer.";+"SAVE_CURRENT_IMAGE" = "Enregistrer l'image actuelle";+"COPY_CURRENT_IMAGE" = "Copier l'image actuelle";+"DOWNLOAD_METHOD" = "Méthode de téléchargement";+"DOWNLOAD_METHOD_DESC" = "Façon dont les vidéos sont téléchargées. 'Sur l'appareil' fonctionne sur les dernières versions de YouTube.";+"METHOD_DIRECT" = "Direct";+"METHOD_SERVER" = "Serveur";+"METHOD_ONDEVICE" = "Sur l'appareil (SABR)";++"APPEARANCE" = "Apparence";+"OLED_THEME" = "Mode sombre OLED";+"OLED_THEME_DESC" = "Utilise un noir pur (OLED) pour le thème sombre de l'application.";+"OLED_KEYBOARD" = "Clavier OLED";+"OLED_KEYBOARD_DESC" = "Force le clavier à utiliser un noir pur (OLED) en mode sombre.";++"NAVBAR" = "Barre de navigation";+"STICKY_NAVBAR" = "Barre de navigation fixe";+"STICKY_NAVBAR_DESC" = "Épingle la barre de navigation pour qu'elle reste visible lors du défilement vers le bas.";+"NAVIGATION_ICON" = "Icône de navigation";+"NAVIGATION_ICON_DESC" = "Modifie le logo YouTube dans la barre de navigation.";+"PREMIUM" = "Premium";+"REMOVE_YTLOGO" = "Masquer le logo";+"YOUTUBE" = "YouTube";+"HIDE_NOTIFICATION_BUTTON" = "Masquer le bouton de notification";+"HIDE_NOTIFICATION_BUTTON_DESC" = "Masque le bouton de notification dans la barre de navigation.";+"HIDE_SEARCH_BUTTON" = "Masquer le bouton de recherche";+"HIDE_SEARCH_BUTTON_DESC" = "Masque le bouton de recherche dans la barre de navigation.";+"HIDE_VOICE_SEARCH_BUTTON" = "Masquer la recherche vocale";+"HIDE_VOICE_SEARCH_BUTTON_DESC" = "Masque le bouton de recherche vocale dans la barre de navigation.";+"HIDE_CAST_BUTTON_NAVBAR" = "Masquer le bouton Cast";+"HIDE_CAST_BUTTON_NAVBAR_DESC" = "Masque le bouton Cast (diffusion) dans la barre de navigation.";++"FEED" = "Flux";+"HIDE_SUBBAR" = "Masquer la sous-barre";+"HIDE_SUBBAR_DESC" = "Masque la sous-barre (filtres) en haut du flux.";+"HIDE_HORI_SHELF" = "Supprimer les flux horizontaux";+"HIDE_HORI_SHELF_DESC" = "Supprime tous les flux horizontaux (Actualités, Continuer à regarder, Collections de publications, etc.) du flux, à l'exception des Jeux.";+"HIDE_MUSIC_PLAYLISTS" = "Masquer le générateur de playlists musicales";+"HIDE_MUSIC_PLAYLISTS_DESC" = "Masque le générateur de playlists musicales (sélection de morceaux par thèmes) dans le flux.";+"HIDE_FEED_POST" = "Masquer les publications";+"HIDE_FEED_POST_DESC" = "Masque les publications dans le flux.";+"HIDE_SURVEYS" = "Masquer les sondages";+"HIDE_SURVEYS_DESC" = "Masque les sondages que YouTube affiche parfois.";+"HIDE_SHORTS_SHELF" = "Masquer la section Shorts";+"HIDE_SHORTS_SHELF_DESC" = "Masque la section Shorts dans le flux, y compris dans l'onglet Abonnements.";+"KEEP_SHORTS_SUBSCRIPT" = "Conserver les Shorts dans Abonnements";+"KEEP_SHORTS_SUBSCRIPT_DESC" = "Empêche la suppression des Shorts dans l'onglet Abonnements.";+"HIDE_SEARCH_HISTORY" = "Masquer l'historique de recherche";+"HIDE_SEARCH_HISTORY_DESC" = "Masque l'historique de recherche et les suggestions lors de l'utilisation de la barre de recherche.\\nREMARQUE : Votre historique de recherche restera accessible sur vos autres appareils.";+"REMOVE_CHANNEL_COMMUNITY_BUTTON" = "Supprimer le bouton Communauté";+"REMOVE_CHANNEL_COMMUNITY_BUTTON_DESC" = "Supprime le bouton communauté sur les en-têtes de chaîne.";+"REMOVE_CHANNEL_SPONSOR_BUTTON" = "Supprimer le bouton Rejoindre";+"REMOVE_CHANNEL_SPONSOR_BUTTON_DESC" = "Supprime le bouton rejoindre/sponsoriser la chaîne dans les flux, sur les chaînes et dans Shorts.";+"HIDE_PLAYABLES" = "Supprimer les Jeux";+"HIDE_PLAYABLES_DESC" = "Supprime les Jeux (mini-jeux) du flux.";+"HIDE_RELATED_VIDEOS" = "Masquer les vidéos suggérées";+"HIDE_RELATED_VIDEOS_DESC" = "Masque les vidéos suggérées sous le lecteur. (Pas en superposition)";++"PLAYER" = "Lecteur";+"PLAYBACK_SPEED" = "Vitesse de lecture";+"CONTROL_CENTER" = "Centre de contrôle";+"PLAYER_ACTIONS" = "Actions du lecteur";+"GESTURE_HEADER" = "Gestes tactiles";+"QUALITY_WIFI" = "Qualité de lecture en Wi-Fi";+"QUALITY_WIFI_DESC" = "Applique automatiquement la qualité sélectionnée lors de la lecture en Wi-Fi.";+"QUALITY_CELLULAR" = "Qualité de lecture sur réseau cellulaire";+"QUALITY_CELLULAR_DESC" = "Applique automatiquement la qualité sélectionnée lors de la lecture sur réseau mobile.";+"QUALITY_LOW_POWER" = "Qualité de lecture en mode économie d'énergie";+"QUALITY_LOW_POWER_DESC" = "Applique automatiquement la qualité sélectionnée lorsque le mode d'économie d'énergie de l'appareil est activé.";+"DEFAULT" = "Par défaut";+"BEST" = "Meilleure";+"AUDIO_TRACK" = "Piste audio préférée";+"ORIGINAL" = "Originale";+"SELECT_MANUALLY" = "Sélectionner manuellement";+"AUDIO_TRACK_SELECT" = "Piste audio sélectionnée";+"AUDIO_TRACK_SELECT_DESC" = "Spécifie la langue de la piste audio préférée à utiliser pour la lecture, si disponible.";+"NO_AUTO_DUBBED" = "Utiliser la piste audio d'origine";+"NO_AUTO_DUBBED_DESC" = "Utilise la piste audio d'origine si la langue préférée est doublée automatiquement ou introuvable.";+"CAPTION_TRACK" = "Sous-titres préférés";+"CAPTION_TRACK_SELECT" = "Sous-titres sélectionnés";+"CAPTION_TRACK_SELECT_DESC" = "Spécifie la langue préférée des sous-titres à afficher, si disponible.";+"DISABLES_CAPTION_TRACK" = "Désactiver automatiquement les sous-titres";+"DISABLES_CAPTION_TRACK_DESC" = "Désactive automatiquement les sous-titres si la langue préférée est générée automatiquement ou introuvable.";+"DEFAULT_SPEED" = "Vitesse de lecture par défaut";+"DEFAULT_SPEED_DESC" = "Remplace la vitesse de lecture par défaut.";+"QUALITY_BUTTON" = "Contrôles de qualité";+"SPEED_BUTTON" = "Contrôles de vitesse";+"MUTE_BUTTON" = "Muet";+"SHARE_BUTTON" = "Partager";+"LOOP_BUTTON" = "En boucle";+"CAPTION_BUTTON" = "Sous-titres";+"DOWNLOAD_BUTTON" = "Télécharger";+"SPONSORBLOCK_BUTTON" = "SponsorBlock";+"MANAGE_OVERLAY_BUTTONS" = "Gérer les boutons de superposition";+"MANAGE_OVERLAY_BUTTONS_DESC" = "Réordonner et activer/désactiver les boutons en superposition";+"OVERLAY_BUTTON_REORDER_HINT" = "Faites glisser pour réordonner les boutons de superposition. Activez/désactivez pour afficher/masquer.";+"HOLD_TO_SPEED" = "Maintenir pour accélérer";+"HOLD_TO_SPEED_DESC" = "Utilise une vitesse de lecture personnalisée lors d'un appui long.";+"HIDE_AUTOPLAY" = "Masquer le commutateur de lecture automatique";+"HIDE_AUTOPLAY_DESC" = "Masque le commutateur de lecture automatique en superposition sur la vidéo.";+"HIDE_CAPTIONS_BUTTON" = "Masquer le bouton des sous-titres";+"HIDE_CAPTIONS_BUTTON_DESC" = "Masque le bouton des sous-titres en superposition sur la vidéo.";+"HIDE_CAST_BUTTON_PLAYER" = "Masquer le bouton Cast";+"HIDE_CAST_BUTTON_PLAYER_DESC" = "Masque le bouton Cast (diffusion) en superposition sur la vidéo.";+"HIDE_NEXT_AND_PREV_BUTTON" = "Masquer les boutons précédent/suivant";+"HIDE_NEXT_AND_PREV_BUTTON_DESC" = "Masque les boutons de vidéo précédente et suivante en superposition sur la vidéo.";+"REPLACE_PREVNEXT_BUTTONS" = "Remplacer les boutons Précédent/Suivant";+"REPLACE_PREVNEXT_BUTTONS_DESC" = "Remplace les boutons de vidéo précédente et suivante dans le lecteur par des boutons de retour rapide et d'avance rapide.";+"REMOVE_DARK_OVERLAY" = "Supprimer le voile sombre";+"REMOVE_DARK_OVERLAY_DESC" = "Supprime le voile noir de superposition sur la vidéo.";+"HIDE_END_SCREEN" = "Masquer les fiches d'écran de fin";+"HIDE_END_SCREEN_DESC" = "Masque les fiches d'écran de fin affichées avant la fin de la vidéo.";+"REMOVE_AMBIANT" = "Supprimer le mode ambiant";+"REMOVE_AMBIANT_DESC" = "Supprime les effets lumineux du mode ambiant derrière le lecteur vidéo.";+"HIDE_SUGGESTED_VIDEO" = "Masquer les suggestions de vidéos";+"HIDE_SUGGESTED_VIDEO_DESC" = "Masque la grille de suggestions de vidéos qui apparaît à la fin d'une vidéo.";+"HIDE_PAID_OVERLAY" = "Masquer 'Inclut une communication commerciale'";+"HIDE_PAID_OVERLAY_DESC" = "Masque l'indication 'Inclut une communication commerciale' en superposition sur la vidéo.";+"HIDE_WATERMARK" = "Masquer le filigrane";+"HIDE_WATERMARK_DESC" = "Masque le filigrane de la chaîne en bas en superposition sur la vidéo.";+"PAUSE_ON_OVERLAY" = "Mettre en pause avec l'interface";+"PAUSE_ON_OVERLAY_DESC" = "Met la lecture en pause lorsque les commandes de superposition apparaissent.";+"DISABLES_SNAP_TO_CHAPTER" = "Désactiver l'aimantation aux chapitres";+"DISABLES_SNAP_TO_CHAPTER_DESC" = "Empêche la barre de défilement de s'aimanter automatiquement aux chapitres.";+"DISABLES_ENGAGE_PANEL" = "Désactiver le panneau d'engagement en plein écran";+"DISABLES_ENGAGE_PANEL_DESC" = "Empêche l'affichage du panneau d'engagement (commentaires, etc.) en plein écran.";+"GESTURES" = "Activer le contrôle par gestes";+"GESTURES_DESC" = "Faites glisser vers le haut ou vers le bas sur les bords gauche/droit de l'écran pour régler la luminosité, le volume ou la vitesse de lecture.";+"GESTURE_AREA" = "Zone d'activation des gestes";+"GESTURE_AREA_DESC" = "Ajuste la zone sur les bords où les gestes sont actifs. (Un réglage à 50 % sépare l'écran en deux parts égales sans zone morte au milieu.)";+"LEFT_SIDE_GESTURE" = "Geste de glissement côté gauche";+"RIGHT_SIDE_GESTURE" = "Geste de glissement côté droit";+"GESTURE_BRIGHTNESS" = "Luminosité";+"GESTURE_VOLUME" = "Volume";+"GESTURE_SPEED" = "Vitesse de lecture";+"GESTURE_NONE" = "Aucun";+"GESTURE_HUD" = "Afficher l'indicateur visuel de geste";+"GESTURE_HUD_DESC" = "Affiche le pourcentage actuel (%) à l'écran lors du réglage de la luminosité, du volume ou de la vitesse.";+"GESTURE_HUD_SIZE" = "Taille de l'indicateur visuel";+"GESTURE_HUD_SIZE_DESC" = "Ajuste la taille du texte et de l'icône de l'indicateur de geste.";+"SMALL" = "Petit (-1)";+"NORMAL" = "Normal (Par défaut)";+"LARGE" = "Grand (+1)";+"EXTRALARGE" = "Très grand (+2)";+"MAX" = "Maximum (+3)";+"GESTURE_HUD_POSITION" = "Position de l'indicateur visuel";+"GESTURE_HUD_POSITION_DESC" = "Définit la position verticale de l'indicateur de geste (Haut, Milieu, Bas).";+"TOP" = "Haut";+"MIDDLE" = "Milieu";+"BOTTOM" = "Bas";+"DISABLES_DOUBLE_TAP" = "Désactiver le double-clic";+"DISABLES_DOUBLE_TAP_DESC" = "Désactive le double-clic pour avancer/reculer en superposition.";+"DISABLES_LONG_HOLD" = "Désactiver l'appui long";+"DISABLES_LONG_HOLD_DESC" = "Désactive l'appui long pour accélérer la vidéo.";+"AUTO_EXIT_FULLSCREEN" = "Quitter automatiquement le plein écran";+"AUTO_EXIT_FULLSCREEN_DESC" = "Quitte automatiquement le mode plein écran à la fin de la vidéo.";+"AUTO_FEED_MUTE" = "Couper le son des vidéos du flux";+"AUTO_FEED_MUTE_DESC" = "Coupe automatiquement le son des vidéos lues dans les flux.";+"DISABLES_SHOW_REMAINING" = "Désactiver le temps restant";+"DISABLES_SHOW_REMAINING_DESC" = "Désactive la fonctionnalité qui affiche le temps restant d'une vidéo en appuyant sur l'horodatage.";+"ALWAYS_SHOW_REMAINING" = "Toujours afficher le temps restant";+"ALWAYS_SHOW_REMAINING_DESC" = "Garantit que le temps restant est toujours affiché par défaut sur le lecteur.";+"COPY_TIMESTAMP_ON_PAUSE" = "Copier les liens horodatés";+"COPY_TIMESTAMP_ON_PAUSE_DESC" = "Permet de copier le lien horodaté dans le presse-papiers en appuyant sur le bouton de pause.";+"SHOW_REMAINING_EXTRA" = "Afficher l'heure de fin estimée";+"SHOW_REMAINING_EXTRA_DESC" = "Ajoute l'heure de fin estimée à l'indicateur de temps du lecteur.";+"HIDE_FULLSCREEN_ACTIONS" = "Masquer les actions en plein écran";+"HIDE_FULLSCREEN_ACTIONS_DESC" = "Masque les boutons d'actions rapides (J'aime, Je n'aime pas, Plus de vidéos, etc.) en mode plein écran.";+"HIDE_FULL_VID_TITLE" = "Masquer le titre de la vidéo en plein écran";+"HIDE_FULL_VID_TITLE_DESC" = "Masque le titre de la vidéo affiché en haut à gauche en mode plein écran.";+"STOP_AUTOPLAY_VIDEO" = "Désactiver la lecture automatique";+"STOP_AUTOPLAY_VIDEO_DESC" = "Empêche le démarrage automatique de la vidéo à son ouverture.";+"HIDE_CONTENT_WARNING" = "Passer l'avertissement de contenu";+"HIDE_CONTENT_WARNING_DESC" = "Passe automatiquement les avertissements de contenu sensible sur certaines vidéos.";+"AUTO_FULLSCREEN" = "Plein écran automatique";+"AUTO_FULLSCREEN_DESC" = "Passe automatiquement en mode plein écran lors du démarrage de la lecture.";+"PORTRAIT_FULLSCREEN" = "Mode plein écran vertical";+"PORTRAIT_FULLSCREEN_DESC" = "Active la prise en charge du mode plein écran en mode portrait.";+"OLD_QUALITY_PICKER" = "Ancien sélecteur de qualité";+"OLD_QUALITY_PICKER_DESC" = "Rétablit l'ancien menu de sélection de qualité vidéo (affiche toutes les résolutions immédiatement).";+"EXTRA_SPEED" = "Options de vitesse supplémentaires";+"EXTRA_SPEED_DESC" = "Ajoute plus d'options de vitesse de lecture de vidéo jusqu'à 10x.";+"FORCE_MINIPLAYER" = "Forcer le mini-lecteur";+"FORCE_MINIPLAYER_DESC" = "Permet de lire toutes les vidéos dans le mini-lecteur, y compris celles conçues pour les enfants, lorsque vous fermez le lecteur.";+"FORCE_SEEKBAR" = "Toujours afficher la barre de progression";+"FORCE_SEEKBAR_DESC" = "Garde la barre de progression visible en permanence en mode plein écran.";+"TAP_TO_SEEK" = "Appuyer pour naviguer";+"TAP_TO_SEEK_DESC" = "Permet de sauter à n'importe quel moment de la vidéo en appuyant directement sur la barre de progression.";+"DISABLES_ZOOM" = "Désactiver le zoom libre";+"DISABLES_ZOOM_DESC" = "Désactive le nouveau geste de zoom libre.";+"USES_24_HOURS_TIME" = "Format 24 heures";+"USES_24_HOURS_TIME_DESC" = "Affiche l'heure de fin au format 24 heures.";+"PAUSE_TWO_FINGERS" = "Pause avec deux doigts";+"PAUSE_TWO_FINGERS_DESC" = "Met en pause/reprend la lecture en appuyant sur l'écran avec deux doigts.";+"SKIP_BACKWARD" = "Saut arrière";+"SKIP_BACKWARD_DESC" = "Remplace le bouton de piste précédente du Centre de contrôle par un bouton de retour arrière d'un nombre défini de secondes.";+"SKIP_FORWARD" = "Saut avant";+"SKIP_FORWARD_DESC" = "Remplace le bouton de piste suivante du Centre de contrôle par un bouton d'avance rapide d'un nombre défini de secondes.";+"REWIND_SECONDS" = "Secondes de retour rapide";+"FORWARD_SECONDS" = "Secondes d'avance rapide";+"HIDE_COMMENTS_SECTION" = "Masquer la section commentaires";+"HIDE_COMMENTS_SECTION_DESC" = "Supprime complètement toute la section des commentaires.";+"HIDE_COMMENTS_PREVIEW" = "Masquer l'aperçu des commentaires";+"HIDE_COMMENTS_PREVIEW_DESC" = "Supprime l'aperçu du premier commentaire tout en gardant la section complète dépliable.";+"LOCK_SPEED" = "Verrouiller la vitesse";+"LOCK_SPEED_DESC" = "Verrouille la vitesse ajustée en glissant vers le bas.";+"SEEK_ON_OVERLAY" = "Naviguer sur l'interface";+"SEEK_ON_OVERLAY_DESC" = "Permet de naviguer dans la vidéo en glissant vers la gauche et la droite en superposition.";+"DRC_AUDIO_OPTIONS" = "Volume stable automatique";+"DRC_AUDIO_OPTIONS_DESC" = "Détermine automatiquement s'il faut activer ou désactiver la fonction 'Volume stable'.";+"REMOVE_VIDEO_LIKE_BUTTON" = "Supprimer le bouton J'aime";+"REMOVE_VIDEO_LIKE_BUTTON_DESC" = "Supprime le bouton J'aime sous le lecteur vidéo et sur l'interface plein écran.";+"REMOVE_VIDEO_DISLIKE_BUTTON" = "Supprimer le bouton Je n'aime pas";+"REMOVE_VIDEO_DISLIKE_BUTTON_DESC" = "Supprime le bouton Je n'aime pas sous le lecteur vidéo et sur l'interface plein écran.";+"REMOVE_VIDEO_SHARE_BUTTON" = "Supprimer le bouton Partager";+"REMOVE_VIDEO_SHARE_BUTTON_DESC" = "Supprime le bouton Partager sous le lecteur vidéo et sur l'interface plein écran.";+"REMOVE_VIDEO_SAVE_BUTTON" = "Supprimer le bouton Enregistrer";+"REMOVE_VIDEO_SAVE_BUTTON_DESC" = "Supprime le bouton Enregistrer (dans une playlist) sous le lecteur vidéo et sur l'interface plein écran.";+"REMOVE_VIDEO_DOWNLOAD_BUTTON" = "Supprimer le bouton Télécharger";+"REMOVE_VIDEO_DOWNLOAD_BUTTON_DESC" = "Supprime le bouton de téléchargement sous le lecteur vidéo et sur l'interface plein écran.";+"REMOVE_VIDEO_CLIP_BUTTON" = "Supprimer le bouton Extrait";+"REMOVE_VIDEO_CLIP_BUTTON_DESC" = "Supprime le bouton Extrait sous le lecteur vidéo et sur l'interface plein écran.";+"REMOVE_VIDEO_REMIX_BUTTON" = "Supprimer le bouton Remix";+"REMOVE_VIDEO_REMIX_BUTTON_DESC" = "Supprime le bouton Remix sous le lecteur vidéo et sur l'interface plein écran.";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON" = "Supprimer le bouton Chat en direct";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON_DESC" = "Supprime le bouton Chat en direct sous le lecteur vidéo et sur l'interface plein écran.";++"SHORTS" = "Shorts";+"HIDE_SHORTS_TOPBAR" = "Masquer la barre supérieure";+"HIDE_SHORTS_TOPBAR_DESC" = "Masque toute la barre supérieure du lecteur Shorts.";+"HIDE_SHORTS_SUBBAR" = "Masquer la sous-barre";+"HIDE_SHORTS_SUBBAR_DESC" = "Masque les boutons d'onglets de type de Shorts dans le lecteur.";+"SHORTS_ONLY" = "Mode Shorts uniquement";+"SHORTS_ONLY_DESC" = "Limite l'utilisation de YouTube aux Shorts uniquement. Vous pouvez désactiver ce mode par un appui long avec deux doigts sur le lecteur Shorts.";+"SHORTS_ONLY_DISABLED" = "Le mode Shorts uniquement a été désactivé";+"SHORTS_ACTION" = "Action de fin de Shorts";+"LOOP" = "En boucle";+"SKIP_TO_NEXT_SHORTS" = "Passer au suivant";+"PAUSE_SHORTS" = "Arrêter";+"REMOVE_LIVE_SHORTS" = "Supprimer les directs";+"REMOVE_LIVE_SHORTS_DESC" = "Supprime les vidéos en direct du flux.";+"HIDE_SHORTS_PRODUCT" = "Masquer les produits";+"HIDE_SHORTS_PRODUCT_DESC" = "Masque les produits identifiés et liens d'achat en superposition sur les Shorts.";+"HIDE_SHORTS_RECBAR" = "Masquer la barre de recommandation";+"HIDE_SHORTS_RECBAR_DESC" = "Masque la barre d'action suggérée dans le lecteur Shorts (ex. Essayer ce son, Shopping, Aperçu de commentaire).";+"HIDE_SHORTS_DISCLOSURE" = "Masquer 'Génère une commission'";+"HIDE_SHORTS_DISCLOSURE_DESC" = "Masque la mention 'Génère une commission' en superposition dans les Shorts.";+"REMOVE_SHORTS_LIKE_BUTTON" = "Supprimer le bouton J'aime";+"REMOVE_SHORTS_LIKE_BUTTON_DESC" = "Supprime le bouton J'aime de l'interface Shorts.";+"REMOVE_SHORTS_COMMENT_BUTTON" = "Supprimer le bouton Commentaires";+"REMOVE_SHORTS_COMMENT_BUTTON_DESC" = "Supprime le bouton Commentaires de l'interface Shorts.";+"REMOVE_SHORTS_SHARE_BUTTON" = "Supprimer le bouton Partager";+"REMOVE_SHORTS_SHARE_BUTTON_DESC" = "Supprime le bouton Partager de l'interface Shorts.";+"REMOVE_SHORTS_REMIX_BUTTON" = "Supprimer le bouton Remix";+"REMOVE_SHORTS_REMIX_BUTTON_DESC" = "Supprime le bouton Remix de l'interface Shorts.";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON" = "Supprimer le bouton Métadonnées audio";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON_DESC" = "Supprime le bouton de métadonnées audio de l'interface Shorts.";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON" = "Supprimer le bouton Abonnements";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON_DESC" = "Supprime le bouton des abonnements dans l'en-tête de pause Shorts.";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON" = "Supprimer le bouton En direct";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON_DESC" = "Supprime le bouton En direct dans l'en-tête de pause Shorts.";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON" = "Supprimer le bouton Lens";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON_DESC" = "Supprime le bouton Lens dans l'en-tête de pause Shorts.";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON" = "Supprimer le bouton Tendances";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON_DESC" = "Supprime le bouton des tendances dans l'en-tête de pause Shorts.";+"ENABLES_SHORTS_QUALITY" = "Activer le sélecteur de qualité Shorts";+"ENABLES_SHORTS_QUALITY_DESC" = "Force l'activation du menu de sélection de la qualité vidéo dans les Shorts.";+"SHOW_SHORTS_SEEKBAR" = "Toujours afficher la barre de progression";+"SHOW_SHORTS_SEEKBAR_DESC" = "Garantit que la barre de progression reste toujours visible en bas du lecteur Shorts.";+"REMOVE_POSTS_SHORTS" = "Supprimer les publications";+"REMOVE_POSTS_SHORTS_DESC" = "Supprime les publications du flux.";+"SHORTS_FULLSCREEN" = "Pincer pour le plein écran";+"SHORTS_FULLSCREEN_DESC" = "Gère la visibilité de l'interface avec des gestes de pincement, affichant les Shorts en mode plein écran.";++"TABBAR" = "Barre d'onglets";+"DEFAULT_TAB" = "Onglet de démarrage par défaut";+"FORSTED_TAB_BAR" = "Barre d'onglets translucide";+"ENABLED" = "Activé";+"HOME_TAB" = "Accueil";+"SHORTS_TAB" = "Shorts";+"CREATE_TAB" = "Créer";+"SUBSCRIPTIONS_TAB" = "Abonnements";+"LIBRARY_TAB" = "Bibliothèque (Vous)";+"HIDE_TAB_INDI" = "Masquer les indicateurs d'onglets";+"HIDE_TAB_INDI_DESC" = "Masque tous les indicateurs d'onglets de la barre d'onglets.";+"HIDE_TAB_LABELS" = "Masquer les libellés d'onglets";+"HIDE_TAB_LABELS_DESC" = "Masque les noms d'onglets de la barre d'onglets.";+"HISTORY_TAB" = "Historique";+"GAMING_TAB" = "Jeux vidéo";+"SPORTS_TAB" = "Sport";+"NOTI_TAB" = "Notifications";+"NEWS_TAB" = "Actualités";+"MUSIC_TAB" = "Musique";+"WATCH_LATER_TAB" = "À regarder plus tard";+"PLAYLIST_TAB" = "Playlists";+"LIKE_TAB" = "Vidéos j'aime";+"LIVE_TAB" = "Direct";+"POST_TAB" = "Publications";+"VIDEO_TAB" = "Vos vidéos";+"MOVIE_TAB" = "Films";+"COURSE_TAB" = "Cours";+"MINIGAME_TAB" = "Jeux";+"FASHION_TAB" = "Mode et beauté";+"LEARNING_TAB" = "Savoirs & Cultures";+"MANAGE_TABS" = "Gérer les onglets";+"MANAGE_TABS_DESC" = "Réordonner et activer/désactiver les onglets";+"TAB_REORDER_HINT" = "Glissez pour réordonner. Activez/désactivez pour afficher/masquer.\\nLes paramètres d'onglets sont également accessibles en maintenant enfoncé le premier onglet de la barre.";+"TAB_LIMIT" = "Limite d'onglets";+"TAB_LIMIT_DESC" = "Seulement 6 onglets sont autorisés.";+"ZERO_TAB_DESC" = "Au moins 1 onglet doit être activé.";++"MISCELLANEOUS" = "Divers";+"BACKGROUND_PLAYBACK" = "Lecture en arrière-plan";+"BACKGROUND_PLAYBACK_DESC" = "Active la lecture en arrière-plan pour les vidéos.";+"DISABLES_SHORTS_PIP" = "Désactiver l'Incrustation (PiP) des Shorts";+"DISABLES_SHORTS_PIP_DESC" = "Tente de désactiver le mode PiP (image dans l'image) pour les Shorts (peut ne pas fonctionner dans tous les cas).";+"DISABLE_HINTS" = "Désactiver les astuces";+"DISABLE_HINTS_DESC" = "Désactive les astuces de tutoriel et les pop-ups interactives.";+"BLOCK_UPGRADE_DIALOGS" = "Bloquer les invitations à la mise à jour";+"BLOCK_UPGRADE_DIALOGS_DESC" = "Bloque les fenêtres contextuelles de YouTube vous demandant de mettre à jour l'application.";+"ARE_YOU_THERE_DIALOG" = "Masquer la boîte de dialogue 'Vous êtes toujours là ?'";+"ARE_YOU_THERE_DIALOG_DESC" = "Masque le message s'affichant en cas d'inactivité prolongée dans l'application.";+"FIXES_SLOW_MINIPLAYER" = "Corriger la lenteur du mini-lecteur";+"FIXES_SLOW_MINIPLAYER_DESC" = "Résout la lenteur d'agrandissement de la vidéo depuis le mini-lecteur (uniquement sur les anciennes versions de YouTube).";+"DISABLES_NEW_MINIPLAYER" = "Désactiver le nouveau mini-lecteur";+"DISABLES_NEW_MINIPLAYER_DESC" = "Utilise l'ancien style de mini-lecteur au lieu du nouveau (uniquement sur les anciennes versions de YouTube).";+"DISABLES_SNACK_BAR" = "Désactiver la barre de notification";+"DISABLES_SNACK_BAR_DESC" = "Désactive la barre de notification (snack bar) éphémère qui apparaît en bas de l'écran lors de certaines actions.";+"HIDE_STARTUP_ANIMATIONS" = "Masquer l'animation de démarrage";+"HIDE_STARTUP_ANIMATIONS_DESC" = "Masque l'animation d'introduction de YouTube à l'ouverture de l'application.";+"HIDE_LIKE_DISLIKE_VOTES" = "Masquer les animations de vote";+"HIDE_LIKE_DISLIKE_VOTES_DESC" = "Masque les messages et animations éphémères s'affichant lorsque vous aimez ou n'aimez pas une vidéo.";+"FLYOUT_MENU" = "Menu contextuel";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION" = "Supprimer l'option 'Lire ensuite dans la file'";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION_DESC" = "Supprime l'option 'Lire ensuite dans la file d'attente' du menu contextuel.";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION" = "Supprimer l'option 'Lire en dernier dans la file'";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION_DESC" = "Supprime l'option 'Lire en dernier dans la file d'attente' du menu contextuel.";+"REMOVE_DOWNLOAD_OPTION" = "Supprimer l'option 'Télécharger la vidéo'";+"REMOVE_DOWNLOAD_OPTION_DESC" = "Supprime l'option de téléchargement de vidéo par défaut du menu contextuel.";+"REMOVE_WATCH_LATER_OPTION" = "Supprimer l'option 'À regarder plus tard'";+"REMOVE_WATCH_LATER_OPTION_DESC" = "Supprime l'option d'enregistrement dans la liste 'À regarder plus tard' du menu contextuel.";+"REMOVE_SAVE_OPTION" = "Supprimer l'option 'Enregistrer dans une playlist'";+"REMOVE_SAVE_OPTION_DESC" = "Supprime l'option 'Enregistrer dans une playlist' du menu contextuel.";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION" = "Supprimer l'option 'Retirer de la playlist'";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION_DESC" = "Supprime l'option 'Retirer de la playlist' du menu contextuel.";+"REMOVE_SHARE_OPTION" = "Supprimer l'option 'Partager'";+"REMOVE_SHARE_OPTION_DESC" = "Supprime l'option 'Partager' du menu contextuel.";+"REMOVE_NOT_INTERESTED_OPTION" = "Supprimer l'option 'Pas intéressé'";+"REMOVE_NOT_INTERESTED_OPTION_DESC" = "Supprime l'option 'Pas intéressé' du menu contextuel.";+"REMOVE_DONT_RECOMMEND_OPTION" = "Supprimer 'Ne pas recommander la chaîne'";+"REMOVE_DONT_RECOMMEND_OPTION_DESC" = "Supprime l'option 'Ne pas recommander la chaîne' du menu contextuel.";+"REMOVE_INFO_OPTION" = "Supprimer 'Pourquoi ce contenu s'affiche ?'";+"REMOVE_INFO_OPTION_DESC" = "Supprime l'option 'Pourquoi ce contenu s'affiche ?' du menu contextuel.";+"REMOVE_FILTER_OPTION" = "Supprimer l'option 'Filtres de recherche'";+"REMOVE_FILTER_OPTION_DESC" = "Supprime l'option 'Filtres de recherche' du menu de recherche.";+"REMOVE_REPORT_OPTION" = "Supprimer l'option 'Signaler'";+"REMOVE_REPORT_OPTION_DESC" = "Supprime l'option 'Signaler' du menu contextuel.";+"REMOVE_YOUTUBE_MUSIC_OPTION" = "Supprimer 'Écouter avec YouTube Music'";+"REMOVE_YOUTUBE_MUSIC_OPTION_DESC" = "Supprime l'option 'Écouter avec YouTube Music' du menu contextuel.";+"REMOVE_FEED_BACK_OPTION" = "Supprimer l'option 'Envoyer des commentaires'";+"REMOVE_FEED_BACK_OPTION_DESC" = "Supprime l'option 'Envoyer des commentaires' du menu contextuel.";+"REMOVE_CAST_OPTION" = "Supprimer 'Regarder sur un téléviseur'";+"REMOVE_CAST_OPTION_DESC" = "Supprime l'option 'Regarder sur un téléviseur' du menu contextuel.";+"REMOVE_SHUFFLE_OPTION" = "Supprimer l'option 'Lecture aléatoire'";+"REMOVE_SHUFFLE_OPTION_DESC" = "Supprime l'option de lecture aléatoire du menu contextuel.";+"REMOVE_UN_SUB_OPTION" = "Supprimer l'option 'Se désabonner'";+"REMOVE_UN_SUB_OPTION_DESC" = "Supprime l'option de désabonnement du menu contextuel.";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION" = "Supprimer 'Masquer la vidéo de la playlist'";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION_DESC" = "Supprime l'option 'Masquer la vidéo de la playlist' du menu contextuel.";+"REMOVE_HELP_OPTION" = "Supprimer l'option 'Aide et commentaires'";+"REMOVE_HELP_OPTION_DESC" = "Supprime l'option 'Aide et commentaires' du menu contextuel.";+"REMOVE_NOTIFY_OPTION" = "Supprimer l'option 'M'informer'";+"REMOVE_NOTIFY_OPTION_DESC" = "Supprime l'option de notification (M'informer) du menu contextuel.";+"REMOVE_CLEARSCREEN_OPTION" = "Supprimer l'option 'Écran propre'";+"REMOVE_CLEARSCREEN_OPTION_DESC" = "Supprime l'option 'Écran propre' (masquer l'interface) du menu contextuel.";+"HIDE_COMMU_GUIDE" = "Masquer le règlement de la communauté";+"HIDE_COMMU_GUIDE_DESC" = "Masque l'en-tête du règlement de la communauté.";+"HIDE_ENGAGEMENT_SUBBAR" = "Masquer l'en-tête de tri des commentaires";+"HIDE_ENGAGEMENT_SUBBAR_DESC" = "Masque l'en-tête de tri des commentaires (Principaux commentaires, Les plus récents) pour qu'il n'apparaisse jamais.";+"DISABLES_RTL" = "Désactiver le formatage de droite à gauche";+"DISABLES_RTL_DESC" = "Force l'affichage du texte de gauche à droite (LTR) pour les langues s'écrivant habituellement de droite à gauche (RTL).";+"DEVICE_UI" = "Style d'interface";+"OPEN_LINK" = "Ouvrir le lien";+"FLOATING_KEYBOARD" = "Clavier flottant";+"FLOATING_KEYBOARD_DESC" = "Force l'activation du clavier flottant. Utile sur iPhone avec l'usurpation d'interface iPad.\\nNote : Fonctionne UNIQUEMENT lorsque le style iPad est sélectionné.";+"AUTO_OPEN_LINK" = "Analyse automatique du presse-papiers";+"AUTO_OPEN_LINK_DESC" = "Analyse le presse-papiers pour détecter les liens liés à YouTube à chaque ouverture de l'application.\\nPour un fonctionnement optimal, allez dans Réglages iOS → YouTube → Autoriser le collage et sélectionnez 'Autoriser'.";++"SB_DESCRIPTION" = "Passez automatiquement les segments sponsorisés grâce aux données partagées par la communauté.";+"SB_ENABLE" = "Activer SponsorBlock";+"SB_ENABLE_DESC" = "Active l'extension SponsorBlock pour passer les segments sponsorisés.";+"SB_SHOW_BUTTON" = "Afficher le bouton de superposition";+"SB_SHOW_BUTTON_DESC" = "Affiche un bouton SponsorBlock en superposition sur le lecteur.";+"SB_SHOW_NOTIFICATIONS" = "Afficher les notifications";+"SB_SHOW_NOTIFICATIONS_DESC" = "Affiche des notifications lorsque des segments sont passés. Les notifications pour les catégories nécessitant un saut manuel s'affichent toujours.";+"SB_HAPTIC_FEEDBACK" = "Retour haptique";+"SB_HAPTIC_FEEDBACK_DESC" = "Émet une vibration haptique lorsqu'un segment est passé.";+"SB_SEGMENTS_IN_PLAYER" = "Segments dans le lecteur";+"SB_SEGMENTS_IN_PLAYER_DESC" = "Affiche des segments colorés sur la barre de progression du lecteur principal.";+"SB_SEGMENTS_IN_FEED" = "Segments dans le flux";+"SB_SEGMENTS_IN_FEED_DESC" = "Affiche des segments colorés sur la barre de progression des lecteurs dans le flux.";+"SB_SEGMENTS_IN_MINIPLAYER" = "Segments dans le mini-lecteur";+"SB_SEGMENTS_IN_MINIPLAYER_DESC" = "Affiche des segments colorés sur la barre de progression du mini-lecteur.";+"SB_SHOW_DURATION" = "Afficher la durée sans les segments";+"SB_SHOW_DURATION_DESC" = "Affiche la durée totale de la vidéo sans compter les segments pouvant être sautés.";+"SB_CATEGORIES_HEADER" = "Catégories de segments";+"SB_SEGMENT_COLOR" = "Couleur du segment";++"SB_ACTION_DISABLE" = "Désactiver";+"SB_ACTION_AUTO_SKIP" = "Saut automatique";+"SB_ACTION_ASK" = "Demander avant de passer";+"SB_ACTION_DISPLAY" = "Afficher uniquement sur la barre de progression";+"SB_ACTION_SKIP_TO" = "Sauter au segment";++"SB_CAT_sponsor" = "Sponsor";+"SB_CAT_sponsor_DESC" = "Promotion payante pour un produit ou service non directement lié au créateur.";+"SB_CAT_intro" = "Générique / Intro";+"SB_CAT_intro_DESC" = "Entracte ou animation d'introduction généralement présente au début d'une vidéo.";+"SB_CAT_outro" = "Écran de fin / Crédits";+"SB_CAT_outro_DESC" = "Écrans de fin, crédits ou outros à la fin de la vidéo.";+"SB_CAT_interaction" = "Rappels d'interaction";+"SB_CAT_interaction_DESC" = "Rappels pour aimer, s'abonner ou suivre sur les réseaux sociaux.";+"SB_CAT_selfpromo" = "Auto-promotion";+"SB_CAT_selfpromo_DESC" = "Promotion non rémunérée des propres produits, articles dérivés ou contenus du créateur.";+"SB_CAT_music_offtopic" = "Section non musicale";+"SB_CAT_music_offtopic_DESC" = "Sections non musicales dans les clips vidéo (ex. dialogues, introductions).";+"SB_CAT_preview" = "Aperçu / Résumé";+"SB_CAT_preview_DESC" = "Résumé ou aperçu du contenu d'une autre vidéo ou d'un épisode précédent.";+"SB_CAT_hook" = "Accroche / Salutations";+"SB_CAT_hook_DESC" = "Court teaser du contenu à venir dans la vidéo ou salutations.";+"SB_CAT_poi_highlight" = "Point d'intérêt / Moment fort";+"SB_CAT_poi_highlight_DESC" = "Moment fort de la vidéo. Utilisez « Sauter à » pour y accéder directement.";+"SB_CAT_filler" = "Remplissage / Hors-sujet";+"SB_CAT_filler_DESC" = "Scènes de remplissage ou blagues qui ne sont pas essentielles à la vidéo.";++"SB_SKIPPED" = "Le segment %@ a été passé";+"SB_DETECTED" = "Segment %@ détecté.\\nVoulez-vous passer ce segment ?";+"SB_SKIP_NOW" = "Passer";+"SB_UNSKIP" = "Revenir";+"SB_JUMPED_TO_HIGHLIGHT" = "Sauté au moment fort";+"SB_JUMP_TO_HIGHLIGHT" = "Moment fort disponible. Souhaitez-vous y accéder ?";+"SB_SEGMENT_COLOR_SUFFIX" = "Couleur du segment";+"SB_SECTION_MAIN" = "Principal";+"SB_SKIP_ALERT_DURATION" = "Durée de l'alerte de saut";+"SB_UNSKIP_ALERT_DURATION" = "Durée de l'alerte de retour";+"SB_MIN_DURATION_SLIDER" = "Durée minimale de segment à passer";\ No newline at end of filediff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..959cd05Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..21b2a15Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..66f5994Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..cc0559eBinary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..02d77fdBinary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..e185071Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..784c003Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..89cf416Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..17db08eBinary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..066aaf3Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..c11c1aeBinary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..ee22dc5Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..3843e19Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..621cc75Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..db19790Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..9b728c7Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..dc9c7dbBinary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..5141b4dBinary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..8de5a90Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..1620921Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..fd63821Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..75cb858Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..272fe73Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..d184fd9Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..a48a237Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..7afd5edBinary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..b63ea72Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..f1952f9Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..3cc508fBinary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..d3384c6Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..9d51647Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..9f19fa2Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..fc35003Binary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected]new file mode 100644index 0000000..82b0f6fBinary files /dev/null and b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/icons/[email protected] differdiff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/it.lproj/Localizable.strings b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/it.lproj/Localizable.stringsnew file mode 100644index 0000000..298e6ee--- /dev/null+++ b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/it.lproj/Localizable.strings@@ -0,0 +1,578 @@+"SETTINGS" = "Impostazioni";+"INTERFACE" = "Interfaccia";++"SEARCH" = "Cerca";+"SEARCH_DESC" = "Cerca nelle impostazioni di YouMod.";++"URL_COPIED" = "Link del video copiato";+"COPY_URL" = "Copia link del video";+"COPY_URL_TIMESTAMP" = "Copia link del video con timestamp";+"URL_TIMESTAMP_COPIED" = "Link del video con timestamp copiato";+"CANCEL" = "Annulla";+"ERROR" = "Errore";+"ERROR_VIDEOID" = "Impossibile ottenere l'ID del video";+"ERROR_ADS" = "Impossibile copiare il link del video durante la riproduzione di pubblicità";++"LOOP_DISABLED" = "Ripetizione disattivata";+"LOOP_ENABLED" = "Ripetizione attivata";++"NEW_ISSUES" = "Segnala problemi o richiedi nuove funzionalità";+"NEW_ISSUES_DESC" = "Hai trovato bug o vuoi richiedere nuove funzionalità? Tocca qui.";+"SOURCE_CODES" = "Codici sorgente";+"SOURCE_CODES_DESC" = "Dai un'occhiata ai codici!";++"EXTRA" = "Extra";+"FIX_PLAYBACK_ISSUES" = "Correggi problemi di riproduzione (temporaneo)";+"FIX_PLAYBACK_ISSUES_DESC" = "Prova a correggere i problemi di riproduzione video per alcuni utenti. Attivandola, il player si ricarica automaticamente ogni volta che si verifica un errore o la riproduzione del video non riesce.";++"PERFER_HEADER" = "Preferenze di YouMod";+"PERFER" = "Preferenze";+"IMPORT" = "Importa impostazioni";+"IMPORT_DESC" = "Carica le tue preferenze da un file .plist.";+"IMPORT_DONE" = "Operazione riuscita";+"YES" = "Sì";+"APPLY_DESC" = "È necessario riavviare l'app. Vuoi riavviarla adesso?";+"EXPORT" = "Esporta impostazioni";+"EXPORT_DESC" = "Invia le tue preferenze in un file .plist.";+"RESTORE" = "Ripristina impostazioni";+"RESTORE_DESC" = "Carica le impostazioni predefinite come in una nuova installazione.";+"WARNING" = "Attenzione";+"RESETDEFAULT" = "Tutte le impostazioni verranno ripristinate ai valori predefiniti. Vuoi continuare?";+"ERROR_INVALID_FILE" = "File non valido";+"ERROR_NO_KEYS_IMPORT" = "Nessuna chiave disponibile da importare";+"ERROR_NO_KEYS_EXPORT" = "Nessuna chiave disponibile da esportare";+"OVERRIDE" = "Questa operazione sovrascriverà le impostazioni attuali. Vuoi continuare?";+"DISABLED" = "Disattivato";++"CACHE" = "Gestione cache";+"CLEARCACHE" = "Svuota cache";+"DONE" = "Fatto";+"AUTO_CLEARCACHE" = "Svuota automaticamente la cache";+"AUTO_CLEARCACHE_DESC" = "Svuota automaticamente la cache dell'app all'avvio.";++"DOWNLOADING" = "Download in corso";+"DOWNLOAD_MANAGER" = "Gestore download";+"DOWNLOAD_MANAGER_DESC" = "Sostituisce il downloader di video di YouTube con quello di YouMod. Consente di scaricare video, audio, sottotitoli e miniature.";+"POST_DOWNLOAD_ACTION" = "Azione dopo il download";+"POST_ACTION_SAVE_PHOTOS" = "Salva in Foto";+"POST_ACTION_SHARE" = "Condividi";+"POST_ACTION_ASK" = "Chiedi";+"ADD_SHORTS_DOWNLOAD" = "Aggiungi pulsante di download agli Shorts";+"ADD_SHORTS_DOWNLOAD_DESC" = "Aggiunge un pulsante di download nell'overlay video degli Shorts.";+"DOWNLOAD_SHORTS" = "Scarica Shorts";+"COPY_VID_INFO" = "Copia informazioni del video";+"COPY_TITLE" = "Copia titolo";+"COPY_DESCRIPTION" = "Copia descrizione";+"COPY_ALL_VID_INFO" = "Copia tutto";+"COPIED_TITLE" = "Titolo del video copiato";+"COPIED_DESCRIPTION" = "Descrizione del video copiata";+"COPY_AUTHOR" = "Copia autore";+"COPIED_AUTHOR" = "Autore del video copiato";+"SAVE_THUMBNAIL" = "Salva miniatura";+"DOWNLOAD_CAPTIONS" = "Scarica sottotitoli";+"DOWNLOAD_AUDIO" = "Scarica audio";+"DOWNLOAD_VIDEO" = "Scarica video";+"OPEN_VID_BEFORE" = "Apri un video prima di usare il gestore dei download";+"NO_CAPTIONS_URL" = "Nessun URL valido trovato per i sottotitoli";+"NO_AUDIO_URL" = "Nessun URL audio trovato";+"NO_STREAM_URL" = "Nessun URL dello stream trovato";+"CAPTIONS_FAILED" = "Download dei sottotitoli non riuscito";+"NO_CAPTIONS" = "Nessun sottotitolo disponibile per questo video";+"NO_AUDIO_STREAM_FOUND" = "Nessuno stream audio trovato";+"NO_VID_AUDIO_STREAM_FOUND" = "Nessuno stream video/audio trovato";+"COPIED_VID_INFO" = "Tutte le informazioni del video copiate";+"SAVED_TO_PHOTOS" = "Salvato in Foto";+"SAVE_FAILED" = "Salvataggio non riuscito";+"PHOTO_ACCESS_DENINED" = "Accesso alle Foto negato";+"THUMBNAIL_FAILED" = "Miniatura non riuscita";+"DOWNLOADING_THUMBNAIL" = "Download della miniatura in corso...";+"DOWNLOADING_AUDIO" = "Download dell'audio in corso...";+"DOWNLOADING_VIDEO" = "Download del video in corso...";+"DOWNLOADING_CAPTIONS" = "Download dei sottotitoli in corso...";+"NO_THUMBNAIL_FOUND" = "Nessuna miniatura trovata";+"DOWNLOAD_FAILED" = "Download non riuscito";+"AUDIO_SAVED" = "Audio salvato";+"DOWNLOAD_COMPLETED" = "Download completato";+"CANNOT_SAVE_TO_PHOTOS" = "Impossibile salvare in Foto";+"FINA_VIDEO" = "Finalizzazione del video in corso...";+"MERGING_VID_FALLBACK" = "Unione del video con fallback in corso...";+"MERGING_VID" = "Unione del video in corso...";+"CONVERTING" = "Conversione in";+"ALREADY_DOWNLOADING" = "Download già in corso";+"DOWNLOAD_CANCELLED" = "Download annullato";+"TRIMMING_AUDIO" = "Ritaglio dell'audio in corso...";+"SHOW_THUMBNAIL" = "Mostra miniatura";+"COPY_THUMBNAIL" = "Copia miniatura";+"THUMBNAIL_OPTIONS" = "Scarica miniatura";+"COPY" = "Copia";+"COPIED_TO_CLIPBOARD" = "Copiato negli appunti";+"CONNECTING_TO_SERVER" = "Connessione al server in corso...";+"DOWNLOADING_TO_SERVER" = "Download sul server in corso...";+"COPY_COMMENT_TEXT" = "Copia testo del commento";+"SAVE_COMMENT_IMAGE" = "Salva commento come immagine";+"COPY_COMMENT_IMAGE" = "Copia commento come immagine";+"COPY_POST_TEXT" = "Copia testo del post";+"SAVE_POST_IMAGE" = "Salva post come immagine";+"COPY_POST_IMAGE" = "Copia post come immagine";+"DOWNLOAD_SERVER" = "Server di download";+"CHOOSE_DOWNLOAD_SERVER" = "Scegli il server di download";+"DOWNLOAD_COMMENT" = "Salva informazioni sui commenti";+"DOWNLOAD_COMMENT_DESC" = "Consente di copiare il testo del commento e di salvare il commento come immagine tenendo premuto a lungo sul pulsante dei tre puntini.";+"DOWNLOAD_POST" = "Salva informazioni sui post";+"DOWNLOAD_POST_DESC" = "Consente di copiare il testo del post e di salvare il post come immagine tenendo premuto a lungo.";+"TRANSLATE_COMMENT" = "Traduci commento";+"TRANSLATE_POST" = "Traduci post";+"SERVER_EUROPRE1" = "Europa";+"SERVER_ASIA1" = "Thailandia - Asia";+"SHOW_OPTIONS" = "Mostra opzioni";+"ENGLISH" = "Inglese";+"TRANSLATION" = "Traduzione";+"LANGUAGE" = "Lingua";+"TRANSLATING" = "Traduzione in corso...";+"SELECT_LANG" = "Seleziona lingua";+"TRANSLATE_FAILED" = "Traduzione non riuscita, riprova.";+"SAVE_CURRENT_IMAGE" = "Salva immagine corrente";+"COPY_CURRENT_IMAGE" = "Copia immagine corrente";+"DOWNLOAD_METHOD" = "Metodo di download";+"DOWNLOAD_METHOD_DESC" = "Come vengono scaricati i video. 'Sul dispositivo' funziona con le versioni più recenti di YouTube.";+"METHOD_DIRECT" = "Diretto";+"METHOD_SERVER" = "Server";+"METHOD_ONDEVICE" = "Sul dispositivo (SABR)";++"APPEARANCE" = "Aspetto";+"OLED_THEME" = "Modalità scura OLED";+"OLED_THEME_DESC" = "Usa il colore nero puro (OLED) per il tema scuro dell'app.";+"OLED_KEYBOARD" = "Tastiera OLED";+"OLED_KEYBOARD_DESC" = "Fa usare alla tastiera il colore nero puro (OLED) con il tema scuro.";++"NAVBAR" = "Barra di navigazione";+"STICKY_NAVBAR" = "Barra di navigazione fissa";+"STICKY_NAVBAR_DESC" = "Fissa la barra di navigazione in modo che rimanga visibile quando scorri verso il basso.";+"NAVIGATION_ICON" = "Icona di navigazione";+"NAVIGATION_ICON_DESC" = "Cambia il logo di YouTube nella barra di navigazione.";+"PREMIUM" = "Premium";+"REMOVE_YTLOGO" = "Rimuovi logo";+"YOUTUBE" = "YouTube";+"HIDE_NOTIFICATION_BUTTON" = "Nascondi pulsante notifiche";+"HIDE_NOTIFICATION_BUTTON_DESC" = "Nasconde il pulsante notifiche nella barra di navigazione.";+"HIDE_SEARCH_BUTTON" = "Nascondi pulsante di ricerca";+"HIDE_SEARCH_BUTTON_DESC" = "Nasconde il pulsante di ricerca nella barra di navigazione.";+"HIDE_VOICE_SEARCH_BUTTON" = "Nascondi pulsante di ricerca vocale";+"HIDE_VOICE_SEARCH_BUTTON_DESC" = "Nasconde il pulsante di ricerca vocale nella barra di navigazione.";+"HIDE_CAST_BUTTON_NAVBAR" = "Nascondi pulsante di trasmissione";+"HIDE_CAST_BUTTON_NAVBAR_DESC" = "Nasconde il pulsante di trasmissione nella barra di navigazione.";++"FEED" = "Feed";+"HIDE_SUBBAR" = "Nascondi barra dei filtri";+"HIDE_SUBBAR_DESC" = "Nasconde la barra dei filtri nella parte superiore del feed.";+"HIDE_HORI_SHELF" = "Rimuovi sezioni orizzontali";+"HIDE_HORI_SHELF_DESC" = "Rimuove tutte le sezioni orizzontali (Notizie, Continua a guardare, Raccolte di post, ecc.) dal feed, tranne i Playables.";+"HIDE_MUSIC_PLAYLISTS" = "Nascondi generatore di playlist musicali";+"HIDE_MUSIC_PLAYLISTS_DESC" = "Nasconde il generatore di playlist musicali (Seleziona tre brani musicali) nel feed.";+"HIDE_FEED_POST" = "Nascondi post";+"HIDE_FEED_POST_DESC" = "Nasconde i post nel feed.";+"HIDE_SURVEYS" = "Nascondi sondaggi";+"HIDE_SURVEYS_DESC" = "Nasconde i sondaggi che YouTube mostra a volte.";+"HIDE_SHORTS_SHELF" = "Nascondi sezione Shorts";+"HIDE_SHORTS_SHELF_DESC" = "Nasconde la sezione Shorts nel feed, inclusa quella nella scheda Iscrizioni.";+"KEEP_SHORTS_SUBSCRIPT" = "Mantieni Shorts in Iscrizioni";+"KEEP_SHORTS_SUBSCRIPT_DESC" = "Impedisce la rimozione degli Shorts dalla scheda Iscrizioni.";+"HIDE_SEARCH_HISTORY" = "Nascondi cronologia ricerche";+"HIDE_SEARCH_HISTORY_DESC" = "Nasconde la cronologia delle ricerche precedenti e i suggerimenti quando usi la barra di ricerca.\\nNOTA: la cronologia delle ricerche resterà comunque accessibile negli altri client di YouTube.";+"REMOVE_CHANNEL_COMMUNITY_BUTTON" = "Rimuovi pulsante Community";+"REMOVE_CHANNEL_COMMUNITY_BUTTON_DESC" = "Rimuove il pulsante Community nell'intestazione del canale.";+"REMOVE_CHANNEL_SPONSOR_BUTTON" = "Rimuovi pulsante Abbonati";+"REMOVE_CHANNEL_SPONSOR_BUTTON_DESC" = "Rimuove il pulsante di abbonamento/sponsorizzazione nei feed, nei canali e negli Shorts.";+"HIDE_PLAYABLES" = "Rimuovi Playables";+"HIDE_PLAYABLES_DESC" = "Rimuove i Playables (mini-giochi) dal feed.";+"HIDE_RELATED_VIDEOS" = "Nascondi video correlati";+"HIDE_RELATED_VIDEOS_DESC" = "Nasconde i video correlati sotto il player. (Non nell'overlay)";++"PLAYER" = "Player";+"PLAYBACK_SPEED" = "Velocità di riproduzione";+"CONTROL_CENTER" = "Centro di Controllo";+"PLAYER_ACTIONS" = "Azioni del player";+"GESTURE_HEADER" = "Gesti";+"QUALITY_WIFI" = "Qualità di riproduzione su Wi-Fi";+"QUALITY_WIFI_DESC" = "Applica automaticamente la qualità selezionata durante lo streaming su Wi-Fi.";+"QUALITY_CELLULAR" = "Qualità di riproduzione su rete cellulare";+"QUALITY_CELLULAR_DESC" = "Applica automaticamente la qualità selezionata durante lo streaming su dati mobili.";+"QUALITY_LOW_POWER" = "Qualità di riproduzione in modalità a basso consumo";+"QUALITY_LOW_POWER_DESC" = "Applica automaticamente la qualità selezionata quando la modalità a basso consumo è attiva sul dispositivo.";+"DEFAULT" = "Predefinita";+"BEST" = "Massima";+"AUDIO_TRACK" = "Traccia audio preferita";+"ORIGINAL" = "Originale";+"SELECT_MANUALLY" = "Seleziona manualmente";+"AUDIO_TRACK_SELECT" = "Traccia audio selezionata";+"AUDIO_TRACK_SELECT_DESC" = "Specifica la lingua preferita della traccia audio da usare per la riproduzione, se disponibile.";+"NO_AUTO_DUBBED" = "Usa traccia audio originale";+"NO_AUTO_DUBBED_DESC" = "Usa la traccia audio originale se la traccia nella lingua preferita è doppiata automaticamente o non viene trovata.";+"CAPTION_TRACK" = "Sottotitoli preferiti";+"CAPTION_TRACK_SELECT" = "Sottotitoli selezionati";+"CAPTION_TRACK_SELECT_DESC" = "Specifica la lingua preferita dei sottotitoli da visualizzare, se disponibile.";+"DISABLES_CAPTION_TRACK" = "Disattiva automaticamente i sottotitoli";+"DISABLES_CAPTION_TRACK_DESC" = "Disattiva automaticamente i sottotitoli se la lingua preferita è generata automaticamente o non viene trovata.";+"DEFAULT_SPEED" = "Velocità di riproduzione predefinita";+"DEFAULT_SPEED_DESC" = "Sostituisce la velocità di riproduzione predefinita.";+"QUALITY_BUTTON" = "Controlli qualità";+"SPEED_BUTTON" = "Controlli velocità";+"MUTE_BUTTON" = "Silenzia";+"SHARE_BUTTON" = "Condividi";+"LOOP_BUTTON" = "Ripeti";+"CAPTION_BUTTON" = "Sottotitoli";+"DOWNLOAD_BUTTON" = "Scarica";+"SPONSORBLOCK_BUTTON" = "SponsorBlock";+"MANAGE_OVERLAY_BUTTONS" = "Gestisci pulsanti overlay";+"MANAGE_OVERLAY_BUTTONS_DESC" = "Riordina e attiva/disattiva i pulsanti overlay";+"OVERLAY_BUTTON_REORDER_HINT" = "Trascina per riordinare i pulsanti overlay. Attiva/disattiva per mostrarli/nasconderli.";+"HOLD_TO_SPEED" = "Tieni premuto per velocizzare";+"HOLD_TO_SPEED_DESC" = "Usa la velocità di riproduzione personalizzata quando tieni premuto per velocizzare.";+"HIDE_AUTOPLAY" = "Nascondi interruttore riproduzione automatica";+"HIDE_AUTOPLAY_DESC" = "Nasconde l'interruttore della riproduzione automatica nell'overlay del video.";+"HIDE_CAPTIONS_BUTTON" = "Nascondi pulsante sottotitoli";+"HIDE_CAPTIONS_BUTTON_DESC" = "Nasconde il pulsante dei sottotitoli nell'overlay del video.";+"HIDE_CAST_BUTTON_PLAYER" = "Nascondi pulsante di trasmissione";+"HIDE_CAST_BUTTON_PLAYER_DESC" = "Nasconde il pulsante di trasmissione nell'overlay del video.";+"HIDE_NEXT_AND_PREV_BUTTON" = "Nascondi pulsanti precedente e successivo";+"HIDE_NEXT_AND_PREV_BUTTON_DESC" = "Nasconde i pulsanti precedente e successivo nell'overlay del video.";+"REPLACE_PREVNEXT_BUTTONS" = "Sostituisci pulsanti Precedente/Successivo";+"REPLACE_PREVNEXT_BUTTONS_DESC" = "Sostituisce i pulsanti video precedente e successivo nel player con i pulsanti Riavvolgi e Avanti veloce.";+"REMOVE_DARK_OVERLAY" = "Rimuovi overlay scuro";+"REMOVE_DARK_OVERLAY_DESC" = "Rimuove l'overlay scuro dal video.";+"HIDE_END_SCREEN" = "Nascondi schede di fine video";+"HIDE_END_SCREEN_DESC" = "Nasconde le schede di fine video mostrate prima della conclusione del video.";+"REMOVE_AMBIANT" = "Rimuovi luci ambientali";+"REMOVE_AMBIANT_DESC" = "Rimuove gli effetti delle luci ambientali luminose dietro il player video.";+"HIDE_SUGGESTED_VIDEO" = "Nascondi video suggeriti";+"HIDE_SUGGESTED_VIDEO_DESC" = "Nasconde la griglia di video suggeriti che compare al termine della riproduzione di un video.";+"HIDE_PAID_OVERLAY" = "Nascondi 'Include una promozione a pagamento'";+"HIDE_PAID_OVERLAY_DESC" = "Nasconde 'Include una promozione a pagamento' nell'overlay del video.";+"HIDE_WATERMARK" = "Nascondi filigrana";+"HIDE_WATERMARK_DESC" = "Nasconde la filigrana del canale nella parte inferiore dell'overlay del video.";+"PAUSE_ON_OVERLAY" = "Pausa alla comparsa dell'overlay";+"PAUSE_ON_OVERLAY_DESC" = "Mette in pausa la riproduzione quando compare l'overlay.";+"DISABLES_SNAP_TO_CHAPTER" = "Disattiva aggancio ai capitoli";+"DISABLES_SNAP_TO_CHAPTER_DESC" = "Impedisce alla barra di avanzamento di agganciarsi ai capitoli.";+"DISABLES_ENGAGE_PANEL" = "Disattiva pannello di interazione a schermo intero";+"DISABLES_ENGAGE_PANEL_DESC" = "Impedisce la visualizzazione del pannello di interazione a schermo intero.";+"GESTURES" = "Attiva controlli tramite gesti";+"GESTURES_DESC" = "Scorri verso l'alto o verso il basso sui bordi sinistro/destro dello schermo del video per regolare luminosità, volume o velocità di riproduzione.";+"GESTURE_AREA" = "Area di attivazione dei gesti";+"GESTURE_AREA_DESC" = "Regola l'area dei bordi in cui i gesti sono attivi. (Impostando il 50%, lo schermo viene diviso a metà senza alcuna zona morta al centro.)";+"LEFT_SIDE_GESTURE" = "Gesto sul lato sinistro";+"RIGHT_SIDE_GESTURE" = "Gesto sul lato destro";+"GESTURE_BRIGHTNESS" = "Luminosità";+"GESTURE_VOLUME" = "Volume";+"GESTURE_SPEED" = "Velocità di riproduzione";+"GESTURE_NONE" = "Nessuno";+"GESTURE_HUD" = "Mostra HUD dei gesti";+"GESTURE_HUD_DESC" = "Mostra a schermo la percentuale (%) corrente durante la regolazione di luminosità, volume o velocità di riproduzione.";+"GESTURE_HUD_SIZE" = "Dimensione HUD dei gesti";+"GESTURE_HUD_SIZE_DESC" = "Regola la dimensione del testo e delle icone dell'HUD dei gesti.";+"SMALL" = "Piccola (-1)";+"NORMAL" = "Normale (predefinita)";+"LARGE" = "Grande (+1)";+"EXTRALARGE" = "Extra large (+2)";+"MAX" = "Massima (+3)";+"GESTURE_HUD_POSITION" = "Posizione HUD dei gesti";+"GESTURE_HUD_POSITION_DESC" = "Imposta la posizione verticale dell'HUD dei gesti (in alto, al centro, in basso).";+"TOP" = "In alto";+"MIDDLE" = "Al centro";+"BOTTOM" = "In basso";+"DISABLES_DOUBLE_TAP" = "Disattiva doppio tocco";+"DISABLES_DOUBLE_TAP_DESC" = "Disattiva il doppio tocco per avanzare/riavvolgere nell'overlay del video.";+"DISABLES_LONG_HOLD" = "Disattiva pressione prolungata";+"DISABLES_LONG_HOLD_DESC" = "Disattiva la pressione prolungata per velocizzare il video nell'overlay del video.";+"AUTO_EXIT_FULLSCREEN" = "Uscita automatica da schermo intero";+"AUTO_EXIT_FULLSCREEN_DESC" = "Esce automaticamente da schermo intero al termine del video.";+"AUTO_FEED_MUTE" = "Silenzia automaticamente i video nel feed";+"AUTO_FEED_MUTE_DESC" = "Silenzia automaticamente i video riprodotti nel feed.";+"DISABLES_SHOW_REMAINING" = "Disattiva tempo rimanente";+"DISABLES_SHOW_REMAINING_DESC" = "Disattiva la funzione che mostra quanto tempo rimane nel video quando tocchi il timestamp.";+"ALWAYS_SHOW_REMAINING" = "Mostra sempre il tempo rimanente";+"ALWAYS_SHOW_REMAINING_DESC" = "Fa in modo che il tempo rimanente sia sempre visualizzato per impostazione predefinita nell'overlay del player.";+"COPY_TIMESTAMP_ON_PAUSE" = "Copia link con timestamp";+"COPY_TIMESTAMP_ON_PAUSE_DESC" = "Consente di copiare negli appunti il link con timestamp premendo il pulsante di pausa.";+"SHOW_REMAINING_EXTRA" = "Mostra tempo rimanente extra";+"SHOW_REMAINING_EXTRA_DESC" = "Aggiunge l'orario stimato di fine all'etichetta nell'overlay del video.";+"HIDE_FULLSCREEN_ACTIONS" = "Nascondi azioni a schermo intero";+"HIDE_FULLSCREEN_ACTIONS_DESC" = "Nasconde i pulsanti di azione rapida (Mi piace, Non mi piace, Altri video, ecc.) quando il video è in modalità schermo intero.";+"HIDE_FULL_VID_TITLE" = "Nascondi titolo del video a schermo intero";+"HIDE_FULL_VID_TITLE_DESC" = "Nasconde il titolo del video mostrato in alto a sinistra in modalità schermo intero.";+"STOP_AUTOPLAY_VIDEO" = "Disattiva riproduzione automatica";+"STOP_AUTOPLAY_VIDEO_DESC" = "Impedisce la riproduzione automatica del video quando lo apri.";+"HIDE_CONTENT_WARNING" = "Salta avviso sui contenuti";+"HIDE_CONTENT_WARNING_DESC" = "Salta automaticamente l'avviso relativo a contenuti sensibili presente in alcuni video.";+"AUTO_FULLSCREEN" = "Schermo intero automatico";+"AUTO_FULLSCREEN_DESC" = "Attiva automaticamente la modalità schermo intero all'avvio della riproduzione del video.";+"PORTRAIT_FULLSCREEN" = "Modalità schermo intero verticale";+"PORTRAIT_FULLSCREEN_DESC" = "Abilita il supporto alla modalità schermo intero verticale.";+"OLD_QUALITY_PICKER" = "Usa il vecchio selettore qualità";+"OLD_QUALITY_PICKER_DESC" = "Ripristina il menu di selezione della qualità video alla versione classica (mostra subito l'elenco di tutte le risoluzioni).";+"EXTRA_SPEED" = "Opzioni di velocità extra";+"EXTRA_SPEED_DESC" = "Aggiunge ulteriori opzioni di velocità di riproduzione fino a 10x.";+"FORCE_MINIPLAYER" = "Forza miniplayer";+"FORCE_MINIPLAYER_DESC" = "Consente a tutti i video, inclusi quelli realizzati per i bambini, di essere riprodotti nel miniplayer quando chiudi il player.";+"FORCE_SEEKBAR" = "Mostra sempre la barra di avanzamento";+"FORCE_SEEKBAR_DESC" = "Fa in modo che la barra di avanzamento (seekbar) rimanga sempre visibile in modalità schermo intero.";+"TAP_TO_SEEK" = "Tocca per spostarti";+"TAP_TO_SEEK_DESC" = "Passa rapidamente a qualsiasi punto del video toccando la barra di avanzamento.";+"DISABLES_ZOOM" = "Disattiva gesto di zoom libero";+"DISABLES_ZOOM_DESC" = "Disattiva i nuovi gesti di zoom libero.";+"USES_24_HOURS_TIME" = "Formato 24 ore";+"USES_24_HOURS_TIME_DESC" = "Mostra l'orario di fine nel formato 24 ore.";+"PAUSE_TWO_FINGERS" = "Pausa con due dita";+"PAUSE_TWO_FINGERS_DESC" = "Metti in pausa/riprendi la riproduzione toccando lo schermo con due dita.";+"SKIP_BACKWARD" = "Salta indietro";+"SKIP_BACKWARD_DESC" = "Sostituisce il pulsante traccia precedente nel Centro di Controllo con un pulsante di salto indietro di un numero impostabile di secondi.";+"SKIP_FORWARD" = "Salta avanti";+"SKIP_FORWARD_DESC" = "Sostituisce il pulsante traccia successiva nel Centro di Controllo con un pulsante di salto avanti di un numero impostabile di secondi.";+"REWIND_SECONDS" = "Secondi di riavvolgimento";+"FORWARD_SECONDS" = "Secondi di avanzamento veloce";+"HIDE_COMMENTS_SECTION" = "Nascondi sezione commenti";+"HIDE_COMMENTS_SECTION_DESC" = "Rimuove completamente l'intera sezione commenti.";+"HIDE_COMMENTS_PREVIEW" = "Nascondi anteprima commenti";+"HIDE_COMMENTS_PREVIEW_DESC" = "Rimuove il riquadro di anteprima del commento principale, mantenendo espandibile l'intera sezione.";+"LOCK_SPEED" = "Blocca velocità";+"LOCK_SPEED_DESC" = "Blocca la velocità regolata scorrendo verso il basso.";+"SEEK_ON_OVERLAY" = "Spostamento nell'overlay";+"SEEK_ON_OVERLAY_DESC" = "Consente di spostarsi nel video scorrendo verso sinistra e destra sull'overlay del video.";+"DRC_AUDIO_OPTIONS" = "Volume stabile automatico";+"DRC_AUDIO_OPTIONS_DESC" = "Sceglie automaticamente se attivare o disattivare il Volume stabile.";+"REMOVE_VIDEO_LIKE_BUTTON" = "Rimuovi pulsante Mi piace";+"REMOVE_VIDEO_LIKE_BUTTON_DESC" = "Rimuove il pulsante Mi piace sotto il player del video e nell'overlay a schermo intero.";+"REMOVE_VIDEO_DISLIKE_BUTTON" = "Rimuovi pulsante Non mi piace";+"REMOVE_VIDEO_DISLIKE_BUTTON_DESC" = "Rimuove il pulsante Non mi piace sotto il player del video e nell'overlay a schermo intero.";+"REMOVE_VIDEO_SHARE_BUTTON" = "Rimuovi pulsante Condividi";+"REMOVE_VIDEO_SHARE_BUTTON_DESC" = "Rimuove il pulsante Condividi sotto il player del video e nell'overlay a schermo intero.";+"REMOVE_VIDEO_SAVE_BUTTON" = "Rimuovi pulsante Salva";+"REMOVE_VIDEO_SAVE_BUTTON_DESC" = "Rimuove il pulsante Salva nella playlist sotto il player del video e nell'overlay a schermo intero.";+"REMOVE_VIDEO_DOWNLOAD_BUTTON" = "Rimuovi pulsante Scarica";+"REMOVE_VIDEO_DOWNLOAD_BUTTON_DESC" = "Rimuove il pulsante di download sotto il player del video e nell'overlay a schermo intero.";+"REMOVE_VIDEO_CLIP_BUTTON" = "Rimuovi pulsante Crea clip";+"REMOVE_VIDEO_CLIP_BUTTON_DESC" = "Rimuove il pulsante Crea clip sotto il player del video e nell'overlay a schermo intero.";+"REMOVE_VIDEO_REMIX_BUTTON" = "Rimuovi pulsante Remix";+"REMOVE_VIDEO_REMIX_BUTTON_DESC" = "Rimuove il pulsante Remix sotto il player del video e nell'overlay a schermo intero.";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON" = "Rimuovi pulsante chat in diretta";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON_DESC" = "Rimuove il pulsante della chat in diretta sotto il player del video e nell'overlay a schermo intero.";++"SHORTS" = "Shorts";+"HIDE_SHORTS_TOPBAR" = "Nascondi barra superiore";+"HIDE_SHORTS_TOPBAR_DESC" = "Nasconde l'intera vista della barra superiore nel player.";+"HIDE_SHORTS_SUBBAR" = "Nascondi barra delle categorie";+"HIDE_SHORTS_SUBBAR_DESC" = "Nasconde la barra delle categorie di Shorts nel player.";+"SHORTS_ONLY" = "Modalità solo Shorts";+"SHORTS_ONLY_DESC" = "Limita le funzionalità di YouTube alla sola visualizzazione degli Shorts. Puoi disattivare la modalità solo Shorts tenendo premuto a lungo con due dita nel player degli Shorts.";+"SHORTS_ONLY_DISABLED" = "La modalità solo Shorts è stata disattivata";+"SHORTS_ACTION" = "Azione Shorts al termine del video";+"LOOP" = "Ripeti";+"SKIP_TO_NEXT_SHORTS" = "Passa al successivo";+"PAUSE_SHORTS" = "Ferma";+"REMOVE_LIVE_SHORTS" = "Rimuovi video in diretta";+"REMOVE_LIVE_SHORTS_DESC" = "Rimuove i video in diretta dal feed.";+"HIDE_SHORTS_PRODUCT" = "Nascondi prodotti";+"HIDE_SHORTS_PRODUCT_DESC" = "Nasconde i prodotti taggati e i link di acquisto nell'overlay degli Shorts.";+"HIDE_SHORTS_RECBAR" = "Nascondi barra dei consigli";+"HIDE_SHORTS_RECBAR_DESC" = "Nasconde la barra delle azioni consigliate nel player degli Shorts (es. Prova questo suono, Shopping, Anteprima commento).";+"HIDE_SHORTS_DISCLOSURE" = "Nascondi 'Riceve commissioni'";+"HIDE_SHORTS_DISCLOSURE_DESC" = "Nasconde l'avviso 'Riceve commissioni' nell'overlay degli Shorts.";+"REMOVE_SHORTS_LIKE_BUTTON" = "Rimuovi pulsante Mi piace";+"REMOVE_SHORTS_LIKE_BUTTON_DESC" = "Rimuove il pulsante Mi piace dall'overlay di Shorts.";+"REMOVE_SHORTS_COMMENT_BUTTON" = "Rimuovi pulsante Commenti";+"REMOVE_SHORTS_COMMENT_BUTTON_DESC" = "Rimuove il pulsante Commenti dall'overlay di Shorts.";+"REMOVE_SHORTS_SHARE_BUTTON" = "Rimuovi pulsante Condividi";+"REMOVE_SHORTS_SHARE_BUTTON_DESC" = "Rimuove il pulsante Condividi dall'overlay di Shorts.";+"REMOVE_SHORTS_REMIX_BUTTON" = "Rimuovi pulsante Remix";+"REMOVE_SHORTS_REMIX_BUTTON_DESC" = "Rimuove il pulsante Remix dall'overlay di Shorts.";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON" = "Rimuovi pulsante Metadati audio";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON_DESC" = "Rimuove il pulsante dei metadati audio dall'overlay di Shorts.";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON" = "Rimuovi pulsante Iscrizioni";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON_DESC" = "Rimuove il pulsante delle iscrizioni nell'intestazione di pausa di Shorts.";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON" = "Rimuovi pulsante Live";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON_DESC" = "Rimuove il pulsante Live nell'intestazione di pausa di Shorts.";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON" = "Rimuovi pulsante Lens";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON_DESC" = "Rimuove il pulsante Lens nell'intestazione di pausa di Shorts.";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON" = "Rimuovi pulsante Tendenze";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON_DESC" = "Rimuove il pulsante delle tendenze nell'intestazione di pausa di Shorts.";+"ENABLES_SHORTS_QUALITY" = "Attiva selettore qualità Shorts";+"ENABLES_SHORTS_QUALITY_DESC" = "Forza l'attivazione del menu di selezione della qualità video negli Shorts.";+"SHOW_SHORTS_SEEKBAR" = "Mostra sempre la barra di avanzamento";+"SHOW_SHORTS_SEEKBAR_DESC" = "Garantisce che la barra di avanzamento (seekbar) sia sempre visibile nella parte inferiore del player degli Shorts.";+"REMOVE_POSTS_SHORTS" = "Rimuovi post";+"REMOVE_POSTS_SHORTS_DESC" = "Rimuove i post dal feed.";+"SHORTS_FULLSCREEN" = "Pizzica per schermo intero";+"SHORTS_FULLSCREEN_DESC" = "Gestisce la visibilità dell'overlay con i gesti di pizzicamento (pinch in e pinch out), mostrando gli Shorts a schermo intero.";++"TABBAR" = "Barra delle schede";+"DEFAULT_TAB" = "Scheda predefinita all'avvio";+"FORSTED_TAB_BAR" = "Barra delle schede traslucida";+"ENABLED" = "Attivato";+"HOME_TAB" = "Home";+"SHORTS_TAB" = "Shorts";+"CREATE_TAB" = "Crea";+"SUBSCRIPTIONS_TAB" = "Iscrizioni";+"LIBRARY_TAB" = "Libreria (Tu)";+"HIDE_TAB_INDI" = "Nascondi indicatori delle schede";+"HIDE_TAB_INDI_DESC" = "Nasconde tutti gli indicatori delle schede nella barra delle schede.";+"HIDE_TAB_LABELS" = "Nascondi etichette delle schede";+"HIDE_TAB_LABELS_DESC" = "Nasconde tutte le etichette delle schede nella barra delle schede.";+"HISTORY_TAB" = "Cronologia";+"GAMING_TAB" = "Gaming";+"SPORTS_TAB" = "Sport";+"NOTI_TAB" = "Notifiche";+"NEWS_TAB" = "Notizie";+"MUSIC_TAB" = "Musica";+"WATCH_LATER_TAB" = "Guarda più tardi";+"PLAYLIST_TAB" = "Playlist";+"LIKE_TAB" = "Video piaciuti";+"LIVE_TAB" = "Live";+"POST_TAB" = "Post";+"VIDEO_TAB" = "I tuoi video";+"MOVIE_TAB" = "Film";+"COURSE_TAB" = "Corsi";+"MINIGAME_TAB" = "Playables";+"FASHION_TAB" = "Moda e bellezza";+"LEARNING_TAB" = "Apprendimento";+"MANAGE_TABS" = "Gestisci schede";+"MANAGE_TABS_DESC" = "Riordina e attiva/disattiva le schede";+"TAB_REORDER_HINT" = "Trascina per riordinare. Attiva/disattiva per mostrare/nascondere.\\nLe impostazioni delle schede sono accessibili anche tenendo premuto a lungo la prima scheda nella barra delle schede.";+"TAB_LIMIT" = "Limite di schede";+"TAB_LIMIT_DESC" = "Sono consentite al massimo 6 schede.";+"ZERO_TAB_DESC" = "Deve essere attiva almeno 1 scheda.";++"MISCELLANEOUS" = "Varie";+"BACKGROUND_PLAYBACK" = "Riproduzione in background";+"BACKGROUND_PLAYBACK_DESC" = "Abilita la riproduzione in background dei video.";+"DISABLES_SHORTS_PIP" = "Disattiva PiP per gli Shorts";+"DISABLES_SHORTS_PIP_DESC" = "Tenta di disattivare il PiP per gli Shorts; potrebbe non disattivarlo al 100%.";+"DISABLE_HINTS" = "Disattiva suggerimenti";+"DISABLE_HINTS_DESC" = "Disattiva i suggerimenti tutorial e i pop-up interattivi.";+"BLOCK_UPGRADE_DIALOGS" = "Blocca finestre di aggiornamento";+"BLOCK_UPGRADE_DIALOGS_DESC" = "Blocca le finestre di YouTube che ti chiedono di aggiornare l'app.";+"ARE_YOU_THERE_DIALOG" = "Nascondi finestra 'Ci sei ancora?'";+"ARE_YOU_THERE_DIALOG_DESC" = "Nasconde la finestra mostrata quando resti inattivo nell'app troppo a lungo.";+"FIXES_SLOW_MINIPLAYER" = "Correggi miniplayer lento";+"FIXES_SLOW_MINIPLAYER_DESC" = "Corregge la lentezza del miniplayer nell'espansione del video; funziona solo con le versioni precedenti di YouTube.";+"DISABLES_NEW_MINIPLAYER" = "Disattiva nuovo miniplayer";+"DISABLES_NEW_MINIPLAYER_DESC" = "Usa il miniplayer vecchio stile al posto di quello nuovo; funziona solo con le versioni precedenti di YouTube.";+"DISABLES_SNACK_BAR" = "Disattiva snack bar";+"DISABLES_SNACK_BAR_DESC" = "Disattiva la snack bar quando premi alcuni pulsanti o esegui azioni nell'app.";+"HIDE_STARTUP_ANIMATIONS" = "Nascondi animazioni di avvio di YouTube";+"HIDE_STARTUP_ANIMATIONS_DESC" = "Nasconde le animazioni di avvio di YouTube all'apertura dell'app.";+"HIDE_LIKE_DISLIKE_VOTES" = "Nascondi voti Mi piace/Non mi piace";+"HIDE_LIKE_DISLIKE_VOTES_DESC" = "Nasconde i messaggi che compaiono quando metti Mi piace/Non mi piace ai video.";+"FLYOUT_MENU" = "Menu a comparsa";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION" = "Rimuovi opzione 'Riproduci come successivo in coda'";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION_DESC" = "Rimuove l'opzione 'Riproduci come successivo in coda' dal menu a comparsa.";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION" = "Rimuovi opzione 'Riproduci per ultimo in coda'";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION_DESC" = "Rimuove l'opzione 'Riproduci per ultimo in coda' dal menu a comparsa.";+"REMOVE_DOWNLOAD_OPTION" = "Rimuovi opzione 'Scarica video'";+"REMOVE_DOWNLOAD_OPTION_DESC" = "Rimuove l'opzione 'Scarica video' dal menu a comparsa.";+"REMOVE_WATCH_LATER_OPTION" = "Rimuovi opzione 'Salva in Guarda più tardi'";+"REMOVE_WATCH_LATER_OPTION_DESC" = "Rimuove l'opzione 'Salva in Guarda più tardi' dal menu a comparsa.";+"REMOVE_SAVE_OPTION" = "Rimuovi opzione 'Salva in playlist'";+"REMOVE_SAVE_OPTION_DESC" = "Rimuove l'opzione 'Salva in playlist' dal menu a comparsa.";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION" = "Rimuovi opzione 'Rimuovi dalla playlist'";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION_DESC" = "Rimuove l'opzione 'Rimuovi dalla playlist' dal menu a comparsa.";+"REMOVE_SHARE_OPTION" = "Rimuovi opzione 'Condividi'";+"REMOVE_SHARE_OPTION_DESC" = "Rimuove l'opzione 'Condividi' dal menu a comparsa.";+"REMOVE_NOT_INTERESTED_OPTION" = "Rimuovi opzione 'Non mi interessa'";+"REMOVE_NOT_INTERESTED_OPTION_DESC" = "Rimuove l'opzione 'Non mi interessa' dal menu a comparsa.";+"REMOVE_DONT_RECOMMEND_OPTION" = "Rimuovi opzione 'Non consigliare il canale'";+"REMOVE_DONT_RECOMMEND_OPTION_DESC" = "Rimuove l'opzione 'Non consigliare il canale' dal menu a comparsa.";+"REMOVE_INFO_OPTION" = "Rimuovi opzione 'Perché vedo questo?'";+"REMOVE_INFO_OPTION_DESC" = "Rimuove l'opzione 'Perché vedo questo?' dal menu a comparsa.";+"REMOVE_FILTER_OPTION" = "Rimuovi opzione 'Filtri di ricerca'";+"REMOVE_FILTER_OPTION_DESC" = "Rimuove l'opzione 'Filtri di ricerca' dal menu a comparsa.";+"REMOVE_REPORT_OPTION" = "Rimuovi opzione 'Segnala'";+"REMOVE_REPORT_OPTION_DESC" = "Rimuove l'opzione 'Segnala' dal menu a comparsa.";+"REMOVE_YOUTUBE_MUSIC_OPTION" = "Rimuovi opzione 'Ascolta con YouTube Music'";+"REMOVE_YOUTUBE_MUSIC_OPTION_DESC" = "Rimuove l'opzione 'Ascolta con YouTube Music' dal menu a comparsa.";+"REMOVE_FEED_BACK_OPTION" = "Rimuovi opzione 'Invia feedback'";+"REMOVE_FEED_BACK_OPTION_DESC" = "Rimuove l'opzione 'Invia feedback' dal menu a comparsa.";+"REMOVE_CAST_OPTION" = "Rimuovi opzione 'Guarda in TV'";+"REMOVE_CAST_OPTION_DESC" = "Rimuove l'opzione 'Guarda in TV' dal menu a comparsa.";+"REMOVE_SHUFFLE_OPTION" = "Rimuovi opzione 'Riproduzione casuale'";+"REMOVE_SHUFFLE_OPTION_DESC" = "Rimuove l'opzione 'Riproduzione casuale' dal menu a comparsa.";+"REMOVE_UN_SUB_OPTION" = "Rimuovi opzione 'Annulla iscrizione'";+"REMOVE_UN_SUB_OPTION_DESC" = "Rimuove l'opzione 'Annulla iscrizione' dal menu a comparsa.";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION" = "Rimuovi opzione 'Nascondi video dalla playlist'";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION_DESC" = "Rimuove l'opzione 'Nascondi video dalla playlist' dal menu a comparsa.";+"REMOVE_HELP_OPTION" = "Rimuovi opzione 'Guida e feedback'";+"REMOVE_HELP_OPTION_DESC" = "Rimuove l'opzione 'Guida e feedback' dal menu a comparsa.";+"REMOVE_NOTIFY_OPTION" = "Rimuovi opzione 'Avvisami'";+"REMOVE_NOTIFY_OPTION_DESC" = "Rimuove l'opzione 'Avvisami' dal menu a comparsa.";+"REMOVE_CLEARSCREEN_OPTION" = "Rimuovi opzione 'Pulisci schermo'";+"REMOVE_CLEARSCREEN_OPTION_DESC" = "Rimuove l'opzione 'Pulisci schermo' dal menu a comparsa.";+"HIDE_COMMU_GUIDE" = "Nascondi linee guida della community";+"HIDE_COMMU_GUIDE_DESC" = "Nasconde l'intestazione delle linee guida della community.";+"HIDE_ENGAGEMENT_SUBBAR" = "Nascondi intestazione commenti";+"HIDE_ENGAGEMENT_SUBBAR_DESC" = "Nasconde l'intestazione di ordinamento dei commenti (In evidenza, Più recenti) così che non appaia mai.";+"DISABLES_RTL" = "Disattiva formato RTL";+"DISABLES_RTL_DESC" = "Visualizza forzatamente il testo nel formato da sinistra a destra (LTR) per le lingue che vengono normalmente mostrate da destra a sinistra (RTL).";+"DEVICE_UI" = "Stile interfaccia";+"OPEN_LINK" = "Apri link";+"FLOATING_KEYBOARD" = "Tastiera flottante";+"FLOATING_KEYBOARD_DESC" = "Attiva forzatamente la tastiera flottante. Utile per gli iPhone con spoofing dello stile iPad.\\nNota: funziona SOLO quando è selezionato lo stile iPad.";+"AUTO_OPEN_LINK" = "Controllo automatico degli appunti";+"AUTO_OPEN_LINK_DESC" = "Controlla negli appunti la presenza di link di YouTube ogni volta che l'app viene aperta.\\nPer un funzionamento corretto, vai in Impostazioni iOS → YouTube → Incolla da altre app e seleziona 'Consenti'";++"SB_DESCRIPTION" = "Salta automaticamente i segmenti sponsorizzati utilizzando dati inviati dalla community.";+"SB_ENABLE" = "Attiva SponsorBlock";+"SB_ENABLE_DESC" = "Attiva l'estensione SponsorBlock per saltare i segmenti sponsorizzati.";+"SB_SHOW_BUTTON" = "Mostra pulsante overlay";+"SB_SHOW_BUTTON_DESC" = "Mostra un pulsante per attivare/disattivare SponsorBlock nell'overlay del player.";+"SB_SHOW_NOTIFICATIONS" = "Mostra notifiche";+"SB_SHOW_NOTIFICATIONS_DESC" = "Mostra notifiche quando i segmenti vengono saltati. Le notifiche per le categorie con salto manuale vengono sempre mostrate.";+"SB_HAPTIC_FEEDBACK" = "Feedback aptico";+"SB_HAPTIC_FEEDBACK_DESC" = "Fornisce un feedback aptico quando viene saltato un segmento.";+"SB_SEGMENTS_IN_PLAYER" = "Segmenti nel player";+"SB_SEGMENTS_IN_PLAYER_DESC" = "Mostra i segmenti colorati sulla barra di avanzamento del player video principale.";+"SB_SEGMENTS_IN_FEED" = "Segmenti nel feed";+"SB_SEGMENTS_IN_FEED_DESC" = "Mostra i segmenti colorati sulla barra di avanzamento dei player nel feed.";+"SB_SEGMENTS_IN_MINIPLAYER" = "Segmenti nel miniplayer";+"SB_SEGMENTS_IN_MINIPLAYER_DESC" = "Mostra i segmenti colorati sulla barra di avanzamento del miniplayer.";+"SB_SHOW_DURATION" = "Mostra durata senza segmenti";+"SB_SHOW_DURATION_DESC" = "Mostra la durata totale del video escludendo i segmenti saltabili.";+"SB_CATEGORIES_HEADER" = "Categorie dei segmenti";+"SB_SEGMENT_COLOR" = "Colore segmento";++"SB_ACTION_DISABLE" = "Disattiva";+"SB_ACTION_AUTO_SKIP" = "Salta automaticamente";+"SB_ACTION_ASK" = "Chiedi prima di saltare";+"SB_ACTION_DISPLAY" = "Mostra solo sulla barra di avanzamento";+"SB_ACTION_SKIP_TO" = "Salta al segmento";++"SB_CAT_sponsor" = "Sponsor";+"SB_CAT_sponsor_DESC" = "Promozione a pagamento per un prodotto o servizio non direttamente correlato al creator.";+"SB_CAT_intro" = "Intro / Sigla";+"SB_CAT_intro_DESC" = "Intermezzo o animazione introduttiva tipicamente presente all'inizio del video.";+"SB_CAT_outro" = "Schermate finali / Crediti";+"SB_CAT_outro_DESC" = "Schermate finali, crediti o outro al termine del video.";+"SB_CAT_interaction" = "Promemoria interazione";+"SB_CAT_interaction_DESC" = "Inviti a mettere Mi piace, iscriversi o seguire sui social network.";+"SB_CAT_selfpromo" = "Autopromozione";+"SB_CAT_selfpromo_DESC" = "Promozione non retribuita dei prodotti, merchandising o altri contenuti del creator.";+"SB_CAT_music_offtopic" = "Sezione non musicale";+"SB_CAT_music_offtopic_DESC" = "Parti non musicali nei video musicali (es. dialoghi, introduzioni).";+"SB_CAT_preview" = "Anteprima / Riassunto";+"SB_CAT_preview_DESC" = "Riassunto o anteprima dei contenuti di un altro video o dell'episodio precedente.";+"SB_CAT_hook" = "Anteprima / Saluti";+"SB_CAT_hook_DESC" = "Breve anticipazione di ciò che avverrà nel video o saluti iniziali.";+"SB_CAT_poi_highlight" = "Punto saliente / Highlight";+"SB_CAT_poi_highlight_DESC" = "Punto di maggiore interesse o momento clou. Usa 'Salta a' per raggiungerlo subito.";+"SB_CAT_filler" = "Riempitivo / Fuori tema";+"SB_CAT_filler_DESC" = "Scene tangenziali o battute non essenziali per il tema principale del video.";++"SB_SKIPPED" = "Il segmento %@ è stato saltato";+"SB_DETECTED" = "Rilevato segmento %@.\\nVuoi saltare il segmento?";+"SB_SKIP_NOW" = "Salta";+"SB_UNSKIP" = "Annulla salto";+"SB_JUMPED_TO_HIGHLIGHT" = "Raggiunto il punto saliente";+"SB_JUMP_TO_HIGHLIGHT" = "È disponibile un punto saliente. Vuoi saltare a quel punto?";+"SB_SEGMENT_COLOR_SUFFIX" = "Colore segmento";+"SB_SECTION_MAIN" = "Principale";+"SB_SKIP_ALERT_DURATION" = "Durata avviso di salto";+"SB_UNSKIP_ALERT_DURATION" = "Durata avviso di annullamento salto";+"SB_MIN_DURATION_SLIDER" = "Durata minima del segmento da saltare";diff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/ko.lproj/Localizable.strings b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/ko.lproj/Localizable.stringsnew file mode 100644index 0000000..d9b9894--- /dev/null+++ b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/ko.lproj/Localizable.strings@@ -0,0 +1,578 @@+"SETTINGS" = "설정";+"INTERFACE" = "인터페이스";++"SEARCH" = "검색";+"SEARCH_DESC" = "YouMod 설정 검색";++"URL_COPIED" = "동영상 링크 복사됨";+"COPY_URL" = "동영상 링크 복사";+"COPY_URL_TIMESTAMP" = "타임스탬프 포함 동영상 링크 복사";+"URL_TIMESTAMP_COPIED" = "타임스탬프 포함 동영상 링크 복사됨";+"CANCEL" = "취소";+"ERROR" = "오류";+"ERROR_VIDEOID" = "동영상 ID를 가져올 수 없습니다";+"ERROR_ADS" = "광고 재생 중에는 동영상 링크를 복사할 수 없습니다";++"LOOP_DISABLED" = "반복 재생 꺼짐";+"LOOP_ENABLED" = "반복 재생 켜짐";++"NEW_ISSUES" = "문제 신고 또는 새 기능 요청";+"NEW_ISSUES_DESC" = "버그를 발견했거나 새 기능을 요청하고 싶으신가요? 여기를 탭하세요.";+"SOURCE_CODES" = "소스 코드";+"SOURCE_CODES_DESC" = "코드를 확인해보세요!";++"EXTRA" = "기타";+"FIX_PLAYBACK_ISSUES" = "재생 문제 해결 (임시)";+"FIX_PLAYBACK_ISSUES_DESC" = "일부 사용자의 동영상 재생 문제를 해결하려고 시도합니다. 이 옵션을 켜면 오류가 발생하거나 재생에 실패할 때마다 플레이어가 자동으로 다시 로드됩니다.";++"PERFER_HEADER" = "YouMod 환경설정";+"PERFER" = "환경설정";+"IMPORT" = "설정 가져오기";+"IMPORT_DESC" = ".plist 파일에서 환경설정을 불러옵니다.";+"IMPORT_DONE" = "완료됨";+"YES" = "예";+"APPLY_DESC" = "앱을 다시 시작해야 합니다. 지금 앱을 다시 시작하시겠습니까?";+"EXPORT" = "설정 내보내기";+"EXPORT_DESC" = "환경설정을 .plist 파일로 내보냅니다.";+"RESTORE" = "설정 복원";+"RESTORE_DESC" = "처음 설치했을 때와 같은 기본 설정을 불러옵니다.";+"WARNING" = "경고";+"RESETDEFAULT" = "모든 설정이 기본값으로 초기화됩니다. 계속하시겠습니까?";+"ERROR_INVALID_FILE" = "잘못된 파일";+"ERROR_NO_KEYS_IMPORT" = "가져올 수 있는 항목이 없습니다";+"ERROR_NO_KEYS_EXPORT" = "내보낼 수 있는 항목이 없습니다";+"OVERRIDE" = "현재 설정을 덮어씁니다. 계속하시겠습니까?";+"DISABLED" = "꺼짐";++"CACHE" = "캐시 관리";+"CLEARCACHE" = "캐시 지우기";+"DONE" = "완료";+"AUTO_CLEARCACHE" = "캐시 자동 삭제";+"AUTO_CLEARCACHE_DESC" = "앱을 시작할 때 캐시를 자동으로 삭제합니다.";++"DOWNLOADING" = "다운로드";+"DOWNLOAD_MANAGER" = "다운로드 관리자";+"DOWNLOAD_MANAGER_DESC" = "YouTube의 동영상 다운로더를 YouMod 다운로더로 대체합니다. 동영상, 오디오, 자막, 썸네일을 다운로드할 수 있습니다.";+"POST_DOWNLOAD_ACTION" = "다운로드 후 동작";+"POST_ACTION_SAVE_PHOTOS" = "사진 앱에 저장";+"POST_ACTION_SHARE" = "공유";+"POST_ACTION_ASK" = "매번 묻기";+"ADD_SHORTS_DOWNLOAD" = "Shorts에 다운로드 버튼 추가";+"ADD_SHORTS_DOWNLOAD_DESC" = "Shorts 동영상 오버레이에 다운로드 버튼을 추가합니다.";+"DOWNLOAD_SHORTS" = "Shorts 다운로드";+"COPY_VID_INFO" = "동영상 정보 복사";+"COPY_TITLE" = "제목 복사";+"COPY_DESCRIPTION" = "설명 복사";+"COPY_ALL_VID_INFO" = "전체 복사";+"COPIED_TITLE" = "동영상 제목 복사됨";+"COPIED_DESCRIPTION" = "동영상 설명 복사됨";+"COPY_AUTHOR" = "작성자 복사";+"COPIED_AUTHOR" = "동영상 작성자 복사됨";+"SAVE_THUMBNAIL" = "썸네일 저장";+"DOWNLOAD_CAPTIONS" = "자막 다운로드";+"DOWNLOAD_AUDIO" = "오디오 다운로드";+"DOWNLOAD_VIDEO" = "동영상 다운로드";+"OPEN_VID_BEFORE" = "다운로드 관리자를 사용하기 전에 동영상을 먼저 열어주세요";+"NO_CAPTIONS_URL" = "유효한 자막 URL을 찾을 수 없습니다";+"NO_AUDIO_URL" = "오디오 URL을 찾을 수 없습니다";+"NO_STREAM_URL" = "스트림 URL을 찾을 수 없습니다";+"CAPTIONS_FAILED" = "자막 다운로드에 실패했습니다";+"NO_CAPTIONS" = "이 동영상에는 사용 가능한 자막이 없습니다";+"NO_AUDIO_STREAM_FOUND" = "오디오 스트림을 찾을 수 없습니다";+"NO_VID_AUDIO_STREAM_FOUND" = "동영상/오디오 스트림을 찾을 수 없습니다";+"COPIED_VID_INFO" = "모든 동영상 정보가 복사됨";+"SAVED_TO_PHOTOS" = "사진 앱에 저장됨";+"SAVE_FAILED" = "저장 실패";+"PHOTO_ACCESS_DENINED" = "사진 접근 권한이 거부됨";+"THUMBNAIL_FAILED" = "썸네일 처리 실패";+"DOWNLOADING_THUMBNAIL" = "썸네일 다운로드 중...";+"DOWNLOADING_AUDIO" = "오디오 다운로드 중...";+"DOWNLOADING_VIDEO" = "동영상 다운로드 중...";+"DOWNLOADING_CAPTIONS" = "자막 다운로드 중...";+"NO_THUMBNAIL_FOUND" = "썸네일을 찾을 수 없습니다";+"DOWNLOAD_FAILED" = "다운로드 실패";+"AUDIO_SAVED" = "오디오 저장됨";+"DOWNLOAD_COMPLETED" = "다운로드 완료";+"CANNOT_SAVE_TO_PHOTOS" = "사진 앱에 저장할 수 없습니다";+"FINA_VIDEO" = "동영상 마무리 처리 중...";+"MERGING_VID_FALLBACK" = "대체 방식으로 동영상 병합 중...";+"MERGING_VID" = "동영상 병합 중...";+"CONVERTING" = "변환 중:";+"ALREADY_DOWNLOADING" = "이미 다운로드 중입니다";+"DOWNLOAD_CANCELLED" = "다운로드가 취소됨";+"TRIMMING_AUDIO" = "오디오 자르는 중...";+"SHOW_THUMBNAIL" = "썸네일 보기";+"COPY_THUMBNAIL" = "썸네일 복사";+"THUMBNAIL_OPTIONS" = "썸네일 다운로드";+"COPY" = "복사";+"COPIED_TO_CLIPBOARD" = "클립보드에 복사됨";+"CONNECTING_TO_SERVER" = "서버에 연결 중...";+"DOWNLOADING_TO_SERVER" = "서버로 다운로드 중...";+"COPY_COMMENT_TEXT" = "댓글 텍스트 복사";+"SAVE_COMMENT_IMAGE" = "댓글을 이미지로 저장";+"COPY_COMMENT_IMAGE" = "댓글을 이미지로 복사";+"COPY_POST_TEXT" = "게시물 텍스트 복사";+"SAVE_POST_IMAGE" = "게시물을 이미지로 저장";+"COPY_POST_IMAGE" = "게시물을 이미지로 복사";+"DOWNLOAD_SERVER" = "다운로드 서버";+"CHOOSE_DOWNLOAD_SERVER" = "다운로드 서버 선택";+"DOWNLOAD_COMMENT" = "댓글 정보 저장";+"DOWNLOAD_COMMENT_DESC" = "점 세 개 버튼을 길게 눌러 댓글 텍스트를 복사하거나 댓글을 이미지로 저장할 수 있습니다.";+"DOWNLOAD_POST" = "게시물 정보 저장";+"DOWNLOAD_POST_DESC" = "길게 눌러 게시물 텍스트를 복사하거나 게시물을 이미지로 저장할 수 있습니다.";+"TRANSLATE_COMMENT" = "댓글 번역";+"TRANSLATE_POST" = "게시물 번역";+"SERVER_EUROPRE1" = "유럽";+"SERVER_ASIA1" = "태국 - 아시아";+"SHOW_OPTIONS" = "옵션 보기";+"ENGLISH" = "영어";+"TRANSLATION" = "번역";+"LANGUAGE" = "언어";+"TRANSLATING" = "번역 중...";+"SELECT_LANG" = "언어 선택";+"TRANSLATE_FAILED" = "번역에 실패했습니다. 다시 시도해주세요.";+"SAVE_CURRENT_IMAGE" = "현재 이미지 저장";+"COPY_CURRENT_IMAGE" = "현재 이미지 복사";+"DOWNLOAD_METHOD" = "다운로드 방식";+"DOWNLOAD_METHOD_DESC" = "동영상을 다운로드하는 방식입니다. 기기 내 처리 방식은 최신 YouTube 버전에서 작동합니다.";+"METHOD_DIRECT" = "직접";+"METHOD_SERVER" = "서버";+"METHOD_ONDEVICE" = "기기 내 처리 (SABR)";++"APPEARANCE" = "화면 표시";+"OLED_THEME" = "OLED 다크 모드";+"OLED_THEME_DESC" = "앱의 다크 테마에 순수한 검은색(OLED) 색상을 사용합니다.";+"OLED_KEYBOARD" = "OLED 키보드";+"OLED_KEYBOARD_DESC" = "다크 테마에서 키보드가 순수한 검은색(OLED) 색상을 사용하도록 합니다.";++"NAVBAR" = "내비게이션 바";+"STICKY_NAVBAR" = "내비게이션 바 고정";+"STICKY_NAVBAR_DESC" = "아래로 스크롤해도 내비게이션 바가 계속 보이도록 고정합니다.";+"NAVIGATION_ICON" = "내비게이션 아이콘";+"NAVIGATION_ICON_DESC" = "내비게이션 바의 YouTube 로고를 변경합니다.";+"PREMIUM" = "Premium";+"REMOVE_YTLOGO" = "로고 제거";+"YOUTUBE" = "YouTube";+"HIDE_NOTIFICATION_BUTTON" = "알림 버튼 숨기기";+"HIDE_NOTIFICATION_BUTTON_DESC" = "내비게이션 바의 알림 버튼을 숨깁니다.";+"HIDE_SEARCH_BUTTON" = "검색 버튼 숨기기";+"HIDE_SEARCH_BUTTON_DESC" = "내비게이션 바의 검색 버튼을 숨깁니다.";+"HIDE_VOICE_SEARCH_BUTTON" = "음성 검색 버튼 숨기기";+"HIDE_VOICE_SEARCH_BUTTON_DESC" = "내비게이션 바의 음성 검색 버튼을 숨깁니다.";+"HIDE_CAST_BUTTON_NAVBAR" = "캐스트 버튼 숨기기";+"HIDE_CAST_BUTTON_NAVBAR_DESC" = "내비게이션 바의 캐스트 버튼을 숨깁니다.";++"FEED" = "피드";+"HIDE_SUBBAR" = "서브바 숨기기";+"HIDE_SUBBAR_DESC" = "피드 상단의 서브바를 숨깁니다.";+"HIDE_HORI_SHELF" = "가로 피드 제거";+"HIDE_HORI_SHELF_DESC" = "피드에서 Playables를 제외한 모든 가로 피드(뉴스, 계속 시청하기, 게시물 모음 등)를 제거합니다.";+"HIDE_MUSIC_PLAYLISTS" = "음악 재생목록 생성기 숨기기";+"HIDE_MUSIC_PLAYLISTS_DESC" = "피드에서 음악 재생목록 생성기(세 곡 선택)를 숨깁니다.";+"HIDE_FEED_POST" = "게시물 숨기기";+"HIDE_FEED_POST_DESC" = "피드의 게시물을 숨깁니다.";+"HIDE_SURVEYS" = "설문조사 숨기기";+"HIDE_SURVEYS_DESC" = "YouTube가 가끔 표시하는 동영상 설문조사를 숨깁니다.";+"HIDE_SHORTS_SHELF" = "Shorts 섹션 숨기기";+"HIDE_SHORTS_SHELF_DESC" = "구독 탭을 포함해 피드의 Shorts 섹션을 숨깁니다.";+"KEEP_SHORTS_SUBSCRIPT" = "구독 탭에 Shorts 유지";+"KEEP_SHORTS_SUBSCRIPT_DESC" = "구독 탭에서 Shorts가 제거되지 않도록 합니다.";+"HIDE_SEARCH_HISTORY" = "검색 기록 숨기기";+"HIDE_SEARCH_HISTORY_DESC" = "검색창 사용 시 이전 검색 기록과 추천 검색어를 숨깁니다.\nNOTE: 다른 YouTube 클라이언트에서는 검색 기록을 계속 확인할 수 있습니다.";+"REMOVE_CHANNEL_COMMUNITY_BUTTON" = "커뮤니티 버튼 제거";+"REMOVE_CHANNEL_COMMUNITY_BUTTON_DESC" = "채널 헤더에서 커뮤니티 버튼을 제거합니다.";+"REMOVE_CHANNEL_SPONSOR_BUTTON" = "가입(스폰서) 버튼 제거";+"REMOVE_CHANNEL_SPONSOR_BUTTON_DESC" = "피드, 채널 헤더 및 Shorts에서 채널 가입/스폰서 버튼을 제거합니다.";+"HIDE_PLAYABLES" = "Playables 제거";+"HIDE_PLAYABLES_DESC" = "피드에서 Playables(미니게임)를 제거합니다.";+"HIDE_RELATED_VIDEOS" = "관련 동영상 숨기기";+"HIDE_RELATED_VIDEOS_DESC" = "플레이어 아래의 관련 동영상을 숨깁니다. (오버레이는 제외)";++"PLAYER" = "플레이어";+"PLAYBACK_SPEED" = "재생 속도";+"CONTROL_CENTER" = "제어 센터";+"PLAYER_ACTIONS" = "플레이어 동작";+"GESTURE_HEADER" = "제스처";+"QUALITY_WIFI" = "Wi-Fi 재생 화질";+"QUALITY_WIFI_DESC" = "Wi-Fi로 스트리밍할 때 선택한 화질을 자동으로 적용합니다.";+"QUALITY_CELLULAR" = "셀룰러 재생 화질";+"QUALITY_CELLULAR_DESC" = "모바일 데이터로 스트리밍할 때 선택한 화질을 자동으로 적용합니다.";+"QUALITY_LOW_POWER" = "저전력 모드 재생 화질";+"QUALITY_LOW_POWER_DESC" = "기기의 저전력 모드가 켜져 있을 때 선택한 화질을 자동으로 적용합니다.";+"DEFAULT" = "기본값";+"BEST" = "최고 화질";+"AUDIO_TRACK" = "선호하는 오디오 트랙";+"ORIGINAL" = "원본";+"SELECT_MANUALLY" = "수동으로 선택";+"AUDIO_TRACK_SELECT" = "선택된 오디오 트랙";+"AUDIO_TRACK_SELECT_DESC" = "사용 가능한 경우 재생에 사용할 선호 오디오 트랙 언어를 지정합니다.";+"NO_AUTO_DUBBED" = "원본 오디오 트랙 사용";+"NO_AUTO_DUBBED_DESC" = "선호 언어 트랙이 자동 더빙되었거나 찾을 수 없는 경우 원본 오디오 트랙을 사용합니다.";+"CAPTION_TRACK" = "선호하는 자막";+"CAPTION_TRACK_SELECT" = "선택된 자막";+"CAPTION_TRACK_SELECT_DESC" = "사용 가능한 경우 표시할 선호 자막 언어를 지정합니다.";+"DISABLES_CAPTION_TRACK" = "자막 자동으로 끄기";+"DISABLES_CAPTION_TRACK_DESC" = "선호 언어가 자동 생성된 것이거나 찾을 수 없는 경우 자막을 자동으로 끕니다.";+"DEFAULT_SPEED" = "기본 재생 속도";+"DEFAULT_SPEED_DESC" = "기본 재생 속도를 재정의합니다.";+"QUALITY_BUTTON" = "화질 조절";+"SPEED_BUTTON" = "속도 조절";+"MUTE_BUTTON" = "음소거";+"SHARE_BUTTON" = "공유";+"LOOP_BUTTON" = "반복 재생";+"CAPTION_BUTTON" = "자막";+"DOWNLOAD_BUTTON" = "다운로드";+"SPONSORBLOCK_BUTTON" = "SponsorBlock";+"MANAGE_OVERLAY_BUTTONS" = "오버레이 버튼 관리";+"MANAGE_OVERLAY_BUTTONS_DESC" = "오버레이 버튼 순서 변경 및 켜기/끄기";+"OVERLAY_BUTTON_REORDER_HINT" = "드래그하여 오버레이 버튼 순서를 변경하세요. 스위치로 표시 여부를 설정할 수 있습니다.";+"HOLD_TO_SPEED" = "길게 눌러 배속 재생";+"HOLD_TO_SPEED_DESC" = "길게 누르면 지정한 배속으로 재생됩니다.";+"HIDE_AUTOPLAY" = "자동재생 스위치 숨기기";+"HIDE_AUTOPLAY_DESC" = "동영상 오버레이의 자동재생 스위치를 숨깁니다.";+"HIDE_CAPTIONS_BUTTON" = "자막 버튼 숨기기";+"HIDE_CAPTIONS_BUTTON_DESC" = "동영상 오버레이의 자막 버튼을 숨깁니다.";+"HIDE_CAST_BUTTON_PLAYER" = "캐스트 버튼 숨기기";+"HIDE_CAST_BUTTON_PLAYER_DESC" = "동영상 오버레이의 캐스트 버튼을 숨깁니다.";+"HIDE_NEXT_AND_PREV_BUTTON" = "이전/다음 버튼 숨기기";+"HIDE_NEXT_AND_PREV_BUTTON_DESC" = "동영상 오버레이의 이전/다음 버튼을 숨깁니다.";+"REPLACE_PREVNEXT_BUTTONS" = "이전/다음 버튼 대체";+"REPLACE_PREVNEXT_BUTTONS_DESC" = "플레이어의 이전/다음 동영상 버튼을 되감기/빨리감기 버튼으로 대체합니다.";+"REMOVE_DARK_OVERLAY" = "어두운 오버레이 제거";+"REMOVE_DARK_OVERLAY_DESC" = "동영상 오버레이에서 어두운 배경 오버레이를 제거합니다.";+"HIDE_END_SCREEN" = "엔드 스크린 카드 숨기기";+"HIDE_END_SCREEN_DESC" = "동영상이 끝나기 전 표시되는 엔드 스크린 카드를 숨깁니다.";+"REMOVE_AMBIANT" = "앰비언트 라이트 제거";+"REMOVE_AMBIANT_DESC" = "동영상 플레이어 뒤의 빛나는 앰비언트 라이트 효과를 제거합니다.";+"HIDE_SUGGESTED_VIDEO" = "추천 동영상 숨기기";+"HIDE_SUGGESTED_VIDEO_DESC" = "동영상 재생이 끝난 후 표시되는 추천 동영상 그리드를 숨깁니다.";+"HIDE_PAID_OVERLAY" = "'유료 프로모션 포함' 숨기기";+"HIDE_PAID_OVERLAY_DESC" = "동영상 오버레이의 '유료 프로모션 포함' 문구를 숨깁니다.";+"HIDE_WATERMARK" = "워터마크 숨기기";+"HIDE_WATERMARK_DESC" = "동영상 오버레이 하단의 채널 워터마크를 숨깁니다.";+"PAUSE_ON_OVERLAY" = "오버레이 표시 시 일시정지";+"PAUSE_ON_OVERLAY_DESC" = "오버레이가 나타나면 재생을 일시정지합니다.";+"DISABLES_SNAP_TO_CHAPTER" = "챕터 스냅 비활성화";+"DISABLES_SNAP_TO_CHAPTER_DESC" = "탐색바가 챕터에 붙지 않도록 합니다.";+"DISABLES_ENGAGE_PANEL" = "전체화면에서 참여 패널 비활성화";+"DISABLES_ENGAGE_PANEL_DESC" = "전체화면 모드에서 참여 패널이 표시되지 않도록 합니다.";+"GESTURES" = "제스처 조작 사용";+"GESTURES_DESC" = "동영상 화면의 좌우 가장자리를 위아래로 스와이프하여 밝기, 볼륨, 재생 속도를 조절합니다.";+"GESTURE_AREA" = "제스처 활성화 영역";+"GESTURE_AREA_DESC" = "제스처가 작동하는 가장자리 영역을 조절합니다. (50%로 설정하면 중간에 사각지대 없이 화면이 절반으로 나뉩니다.)";+"LEFT_SIDE_GESTURE" = "왼쪽 스와이프 제스처";+"RIGHT_SIDE_GESTURE" = "오른쪽 스와이프 제스처";+"GESTURE_BRIGHTNESS" = "밝기";+"GESTURE_VOLUME" = "볼륨";+"GESTURE_SPEED" = "재생 속도";+"GESTURE_NONE" = "없음";+"GESTURE_HUD" = "제스처 HUD 표시";+"GESTURE_HUD_DESC" = "밝기, 볼륨, 재생 속도를 조절할 때 화면에 현재 퍼센트(%)를 표시합니다.";+"GESTURE_HUD_SIZE" = "제스처 HUD 크기";+"GESTURE_HUD_SIZE_DESC" = "제스처 HUD의 텍스트와 아이콘 크기를 조절합니다.";+"SMALL" = "작게 (-1)";+"NORMAL" = "보통 (기본값)";+"LARGE" = "크게 (+1)";+"EXTRALARGE" = "아주 크게 (+2)";+"MAX" = "최대 (+3)";+"GESTURE_HUD_POSITION" = "제스처 HUD 위치";+"GESTURE_HUD_POSITION_DESC" = "제스처 HUD의 세로 위치(위, 중간, 아래)를 설정합니다.";+"TOP" = "위";+"MIDDLE" = "중간";+"BOTTOM" = "아래";+"DISABLES_DOUBLE_TAP" = "더블 탭 비활성화";+"DISABLES_DOUBLE_TAP_DESC" = "동영상 오버레이에서 더블 탭으로 탐색하는 기능을 비활성화합니다.";+"DISABLES_LONG_HOLD" = "길게 누르기 비활성화";+"DISABLES_LONG_HOLD_DESC" = "동영상 오버레이에서 길게 눌러 배속 재생하는 기능을 비활성화합니다.";+"AUTO_EXIT_FULLSCREEN" = "전체화면 자동 종료";+"AUTO_EXIT_FULLSCREEN_DESC" = "동영상이 끝나면 전체화면을 자동으로 종료합니다.";+"AUTO_FEED_MUTE" = "피드 동영상 자동 음소거";+"AUTO_FEED_MUTE_DESC" = "피드에서 재생되는 동영상을 자동으로 음소거합니다.";+"DISABLES_SHOW_REMAINING" = "남은 시간 표시 비활성화";+"DISABLES_SHOW_REMAINING_DESC" = "타임스탬프를 탭했을 때 남은 시간을 표시하는 기능을 비활성화합니다.";+"ALWAYS_SHOW_REMAINING" = "남은 시간 항상 표시";+"ALWAYS_SHOW_REMAINING_DESC" = "플레이어 오버레이에 남은 시간이 기본적으로 항상 표시되도록 합니다.";+"COPY_TIMESTAMP_ON_PAUSE" = "타임스탬프 링크 복사";+"COPY_TIMESTAMP_ON_PAUSE_DESC" = "일시정지 버튼을 눌러 타임스탬프가 포함된 링크를 클립보드에 복사할 수 있습니다.";+"SHOW_REMAINING_EXTRA" = "추가 남은 시간 표시";+"SHOW_REMAINING_EXTRA_DESC" = "동영상 오버레이 라벨에 예상 종료 시각을 추가합니다.";+"HIDE_FULLSCREEN_ACTIONS" = "전체화면 동작 버튼 숨기기";+"HIDE_FULLSCREEN_ACTIONS_DESC" = "전체화면 모드에서 빠른 동작 버튼(좋아요, 싫어요, 더 보기 등)을 숨깁니다.";+"HIDE_FULL_VID_TITLE" = "전체화면 동영상 제목 숨기기";+"HIDE_FULL_VID_TITLE_DESC" = "전체화면 모드에서 좌측 상단에 표시되는 동영상 제목을 숨깁니다.";+"STOP_AUTOPLAY_VIDEO" = "자동재생 비활성화";+"STOP_AUTOPLAY_VIDEO_DESC" = "동영상을 열었을 때 자동으로 재생되지 않도록 합니다.";+"HIDE_CONTENT_WARNING" = "콘텐츠 경고 건너뛰기";+"HIDE_CONTENT_WARNING_DESC" = "일부 동영상에서 민감한 콘텐츠 경고 알림을 자동으로 건너뜁니다.";+"AUTO_FULLSCREEN" = "자동 전체화면";+"AUTO_FULLSCREEN_DESC" = "동영상 재생을 시작하면 자동으로 전체화면 모드로 전환합니다.";+"PORTRAIT_FULLSCREEN" = "세로 전체화면 모드";+"PORTRAIT_FULLSCREEN_DESC" = "세로 전체화면 모드 지원을 활성화합니다.";+"OLD_QUALITY_PICKER" = "이전 화질 선택 메뉴 사용";+"OLD_QUALITY_PICKER_DESC" = "동영상 화질 선택 메뉴를 이전 버전(모든 해상도를 바로 나열)으로 되돌립니다.";+"EXTRA_SPEED" = "추가 배속 옵션";+"EXTRA_SPEED_DESC" = "최대 10배속까지 동영상 재생 속도 옵션을 추가합니다.";+"FORCE_MINIPLAYER" = "미니플레이어 강제 사용";+"FORCE_MINIPLAYER_DESC" = "플레이어를 닫을 때 아동용 동영상을 포함한 모든 동영상이 미니플레이어에서 재생되도록 합니다.";+"FORCE_SEEKBAR" = "진행 바 항상 표시";+"FORCE_SEEKBAR_DESC" = "전체화면 모드에서 진행 바(탐색바)가 항상 표시되도록 합니다.";+"TAP_TO_SEEK" = "탭하여 탐색";+"TAP_TO_SEEK_DESC" = "진행 바를 탭하여 원하는 지점으로 빠르게 이동합니다.";+"DISABLES_ZOOM" = "자유 확대/축소 제스처 비활성화";+"DISABLES_ZOOM_DESC" = "새로운 자유 확대/축소 제스처를 비활성화합니다.";+"USES_24_HOURS_TIME" = "24시간 형식";+"USES_24_HOURS_TIME_DESC" = "종료 시각을 24시간 형식으로 표시합니다.";+"PAUSE_TWO_FINGERS" = "두 손가락으로 일시정지";+"PAUSE_TWO_FINGERS_DESC" = "화면을 두 손가락으로 탭하여 재생을 일시정지/재개합니다.";+"SKIP_BACKWARD" = "뒤로 건너뛰기";+"SKIP_BACKWARD_DESC" = "제어 센터의 이전 트랙 버튼을 지정한 초만큼 뒤로 건너뛰는 버튼으로 대체합니다.";+"SKIP_FORWARD" = "앞으로 건너뛰기";+"SKIP_FORWARD_DESC" = "제어 센터의 다음 트랙 버튼을 지정한 초만큼 앞으로 건너뛰는 버튼으로 대체합니다.";+"REWIND_SECONDS" = "되감기 초";+"FORWARD_SECONDS" = "빨리감기 초";+"HIDE_COMMENTS_SECTION" = "댓글 섹션 숨기기";+"HIDE_COMMENTS_SECTION_DESC" = "댓글 섹션 전체를 완전히 제거합니다.";+"HIDE_COMMENTS_PREVIEW" = "미리보기 댓글 숨기기";+"HIDE_COMMENTS_PREVIEW_DESC" = "인기 댓글 미리보기 상자를 제거하되 전체 댓글 섹션은 펼쳐볼 수 있도록 유지합니다.";+"LOCK_SPEED" = "속도 고정";+"LOCK_SPEED_DESC" = "아래로 스와이프하여 조절한 속도를 고정합니다.";+"SEEK_ON_OVERLAY" = "오버레이에서 탐색";+"SEEK_ON_OVERLAY_DESC" = "동영상 오버레이에서 좌우로 스와이프하여 재생 위치를 탐색할 수 있습니다.";+"DRC_AUDIO_OPTIONS" = "안정적인 볼륨 자동 적용";+"DRC_AUDIO_OPTIONS_DESC" = "안정적인 볼륨 기능의 사용 여부를 자동으로 결정합니다.";+"REMOVE_VIDEO_LIKE_BUTTON" = "좋아요 버튼 제거";+"REMOVE_VIDEO_LIKE_BUTTON_DESC" = "동영상 플레이어 아래와 전체화면 오버레이에서 좋아요 버튼을 제거합니다.";+"REMOVE_VIDEO_DISLIKE_BUTTON" = "싫어요 버튼 제거";+"REMOVE_VIDEO_DISLIKE_BUTTON_DESC" = "동영상 플레이어 아래와 전체화면 오버레이에서 싫어요 버튼을 제거합니다.";+"REMOVE_VIDEO_SHARE_BUTTON" = "공유 버튼 제거";+"REMOVE_VIDEO_SHARE_BUTTON_DESC" = "동영상 플레이어 아래와 전체화면 오버레이에서 공유 버튼을 제거합니다.";+"REMOVE_VIDEO_SAVE_BUTTON" = "저장 버튼 제거";+"REMOVE_VIDEO_SAVE_BUTTON_DESC" = "동영상 플레이어 아래와 전체화면 오버레이에서 재생목록 저장 버튼을 제거합니다.";+"REMOVE_VIDEO_DOWNLOAD_BUTTON" = "오프라인 저장 버튼 제거";+"REMOVE_VIDEO_DOWNLOAD_BUTTON_DESC" = "동영상 플레이어 아래와 전체화면 오버레이에서 다운로드 버튼을 제거합니다.";+"REMOVE_VIDEO_CLIP_BUTTON" = "클립 버튼 제거";+"REMOVE_VIDEO_CLIP_BUTTON_DESC" = "동영상 플레이어 아래와 전체화면 오버레이에서 클립 버튼을 제거합니다.";+"REMOVE_VIDEO_REMIX_BUTTON" = "리믹스 버튼 제거";+"REMOVE_VIDEO_REMIX_BUTTON_DESC" = "동영상 플레이어 아래와 전체화면 오버레이에서 리믹스 버튼을 제거합니다.";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON" = "실시간 채팅 버튼 제거";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON_DESC" = "동영상 플레이어 아래와 전체화면 오버레이에서 실시간 채팅 버튼을 제거합니다.";++"SHORTS" = "Shorts";+"HIDE_SHORTS_TOPBAR" = "상단 메뉴 숨기기";+"HIDE_SHORTS_TOPBAR_DESC" = "플레이어의 모든 상단 메뉴를 숨깁니다.";+"HIDE_SHORTS_SUBBAR" = "서브바 숨기기";+"HIDE_SHORTS_SUBBAR_DESC" = "플레이어의 Shorts 타입 바를 숨깁니다.";+"SHORTS_ONLY" = "Shorts 전용 모드";+"SHORTS_ONLY_DESC" = "YouTube 기능을 Shorts 시청으로만 제한합니다. Shorts 플레이어에서 두 손가락으로 길게 눌러 Shorts 전용 모드를 끌 수 있습니다.";+"SHORTS_ONLY_DISABLED" = "Shorts 전용 모드가 꺼졌습니다";+"SHORTS_ACTION" = "동영상 종료 후 Shorts 동작";+"LOOP" = "반복 재생";+"SKIP_TO_NEXT_SHORTS" = "다음으로 건너뛰기";+"PAUSE_SHORTS" = "정지";+"REMOVE_LIVE_SHORTS" = "라이브 동영상 제거";+"REMOVE_LIVE_SHORTS_DESC" = "피드에서 라이브 동영상을 제거합니다.";+"HIDE_SHORTS_PRODUCT" = "제품 숨기기";+"HIDE_SHORTS_PRODUCT_DESC" = "Shorts 오버레이에서 태그된 제품과 쇼핑 링크를 숨깁니다.";+"HIDE_SHORTS_RECBAR" = "추천 메뉴 숨기기";+"HIDE_SHORTS_RECBAR_DESC" = "Shorts 플레이어의 추천 동작 바(예: 이 사운드 사용해보기, 쇼핑, 댓글 미리보기)를 숨깁니다.";+"HIDE_SHORTS_DISCLOSURE" = "'수수료 받음' 숨기기";+"HIDE_SHORTS_DISCLOSURE_DESC" = "Shorts에서 '수수료 받음' 안내 오버레이를 숨깁니다.";+"REMOVE_SHORTS_LIKE_BUTTON" = "좋아요 버튼 제거";+"REMOVE_SHORTS_LIKE_BUTTON_DESC" = "Shorts 오버레이에서 좋아요 버튼을 제거합니다.";+"REMOVE_SHORTS_COMMENT_BUTTON" = "댓글 버튼 제거";+"REMOVE_SHORTS_COMMENT_BUTTON_DESC" = "Shorts 오버레이에서 댓글 버튼을 제거합니다.";+"REMOVE_SHORTS_SHARE_BUTTON" = "공유 버튼 제거";+"REMOVE_SHORTS_SHARE_BUTTON_DESC" = "Shorts 오버레이에서 공유 버튼을 제거합니다.";+"REMOVE_SHORTS_REMIX_BUTTON" = "리믹스 버튼 제거";+"REMOVE_SHORTS_REMIX_BUTTON_DESC" = "Shorts 오버레이에서 리믹스 버튼을 제거합니다.";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON" = "사운드 메타데이터 버튼 제거";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON_DESC" = "Shorts 오버레이에서 사운드 메타데이터 버튼을 제거합니다.";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON" = "구독 버튼 제거";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON_DESC" = "Shorts 일시정지 헤더에서 구독 버튼을 제거합니다.";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON" = "라이브 버튼 제거";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON_DESC" = "Shorts 일시정지 헤더에서 라이브 버튼을 제거합니다.";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON" = "렌즈 버튼 제거";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON_DESC" = "Shorts 일시정지 헤더에서 렌즈 버튼을 제거합니다.";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON" = "인기 급상승 버튼 제거";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON_DESC" = "Shorts 일시정지 헤더에서 인기 급상승 버튼을 제거합니다.";+"ENABLES_SHORTS_QUALITY" = "Shorts 화질 선택 메뉴 사용";+"ENABLES_SHORTS_QUALITY_DESC" = "Shorts에서 동영상 화질 선택 메뉴를 강제로 사용하도록 합니다.";+"SHOW_SHORTS_SEEKBAR" = "탐색바 항상 표시";+"SHOW_SHORTS_SEEKBAR_DESC" = "Shorts 플레이어 하단에 진행/탐색 바가 항상 표시되도록 합니다.";+"REMOVE_POSTS_SHORTS" = "게시물 제거";+"REMOVE_POSTS_SHORTS_DESC" = "피드에서 게시물을 제거합니다.";+"SHORTS_FULLSCREEN" = "핀치하여 전체화면";+"SHORTS_FULLSCREEN_DESC" = "핀치 인/아웃 제스처로 오버레이 표시 여부를 조절하며 Shorts를 전체화면 모드로 표시합니다.";++"TABBAR" = "탭 메뉴";+"DEFAULT_TAB" = "기본 시작 탭";+"FORSTED_TAB_BAR" = "반투명 탭 메뉴";+"ENABLED" = "켜짐";+"HOME_TAB" = "홈";+"SHORTS_TAB" = "Shorts";+"CREATE_TAB" = "만들기";+"SUBSCRIPTIONS_TAB" = "구독";+"LIBRARY_TAB" = "보관함 (나)";+"HIDE_TAB_INDI" = "탭 표시기 숨기기";+"HIDE_TAB_INDI_DESC" = "탭바의 모든 탭 표시기를 숨깁니다.";+"HIDE_TAB_LABELS" = "탭 라벨 숨기기";+"HIDE_TAB_LABELS_DESC" = "탭 메뉴의 모든 탭 라벨을 숨깁니다.";+"HISTORY_TAB" = "시청 기록";+"GAMING_TAB" = "게임";+"SPORTS_TAB" = "스포츠";+"NOTI_TAB" = "알림";+"NEWS_TAB" = "뉴스";+"MUSIC_TAB" = "음악";+"WATCH_LATER_TAB" = "나중에 볼 동영상";+"PLAYLIST_TAB" = "재생목록";+"LIKE_TAB" = "좋아요 표시한 동영상";+"LIVE_TAB" = "라이브";+"POST_TAB" = "게시물";+"VIDEO_TAB" = "내 동영상";+"MOVIE_TAB" = "영화";+"COURSE_TAB" = "강좌";+"MINIGAME_TAB" = "Playables";+"FASHION_TAB" = "패션 & 뷰티";+"LEARNING_TAB" = "교육";+"MANAGE_TABS" = "탭 관리";+"MANAGE_TABS_DESC" = "탭 순서 변경 및 켜기/끄기";+"TAB_REORDER_HINT" = "드래그하여 순서를 변경하세요. 스위치로 표시 여부를 설정할 수 있습니다.\n탭바의 첫 번째 탭을 길게 눌러도 탭 설정에 접근할 수 있습니다.";+"TAB_LIMIT" = "탭 제한";+"TAB_LIMIT_DESC" = "최대 6개의 탭만 사용할 수 있습니다.";+"ZERO_TAB_DESC" = "최소 1개의 탭은 활성화되어 있어야 합니다.";++"MISCELLANEOUS" = "기타";+"BACKGROUND_PLAYBACK" = "백그라운드 재생";+"BACKGROUND_PLAYBACK_DESC" = "동영상의 백그라운드 재생을 활성화합니다.";+"DISABLES_SHORTS_PIP" = "Shorts PiP 비활성화";+"DISABLES_SHORTS_PIP_DESC" = "Shorts의 PiP(화면 속 화면)를 비활성화하려고 시도합니다. 100% 비활성화되지 않을 수 있습니다.";+"DISABLE_HINTS" = "힌트 비활성화";+"DISABLE_HINTS_DESC" = "튜토리얼 힌트와 상호작용 팝업을 비활성화합니다.";+"BLOCK_UPGRADE_DIALOGS" = "업그레이드 대화상자 차단";+"BLOCK_UPGRADE_DIALOGS_DESC" = "앱 업그레이드를 요청하는 YouTube 대화상자를 차단합니다.";+"ARE_YOU_THERE_DIALOG" = "'아직 보고 계신가요?' 대화상자 숨기기";+"ARE_YOU_THERE_DIALOG_DESC" = "앱에서 오랫동안 활동이 없을 때 표시되는 대화상자를 숨깁니다.";+"FIXES_SLOW_MINIPLAYER" = "느린 미니플레이어 수정";+"FIXES_SLOW_MINIPLAYER_DESC" = "동영상을 확대할 때 미니플레이어가 느려지는 문제를 수정합니다. 이전 버전의 YouTube에서만 작동합니다.";+"DISABLES_NEW_MINIPLAYER" = "새 미니플레이어 비활성화";+"DISABLES_NEW_MINIPLAYER_DESC" = "새 미니플레이어 대신 이전 스타일의 미니플레이어를 사용합니다. 이전 버전의 YouTube에서만 작동합니다.";+"DISABLES_SNACK_BAR" = "스낵바 비활성화";+"DISABLES_SNACK_BAR_DESC" = "앱에서 일부 버튼을 누르거나 동작을 수행할 때 나타나는 스낵바를 비활성화합니다.";+"HIDE_STARTUP_ANIMATIONS" = "YouTube 시작 애니메이션 숨기기";+"HIDE_STARTUP_ANIMATIONS_DESC" = "앱을 열 때 YouTube의 시작 애니메이션을 숨깁니다.";+"HIDE_LIKE_DISLIKE_VOTES" = "좋아요/싫어요 알림 숨기기";+"HIDE_LIKE_DISLIKE_VOTES_DESC" = "동영상에 좋아요/싫어요를 누를 때 나타나는 메시지를 숨깁니다.";+"FLYOUT_MENU" = "플라이아웃 메뉴";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION" = "'대기열의 다음에 재생' 옵션 제거";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION_DESC" = "플라이아웃 메뉴에서 '대기열의 다음에 재생' 옵션을 제거합니다.";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION" = "'대기열의 마지막에 재생' 옵션 제거";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION_DESC" = "플라이아웃 메뉴에서 '대기열의 마지막에 재생' 옵션을 제거합니다.";+"REMOVE_DOWNLOAD_OPTION" = "'동영상 다운로드' 옵션 제거";+"REMOVE_DOWNLOAD_OPTION_DESC" = "플라이아웃 메뉴에서 '동영상 다운로드' 옵션을 제거합니다.";+"REMOVE_WATCH_LATER_OPTION" = "'나중에 볼 동영상에 저장' 옵션 제거";+"REMOVE_WATCH_LATER_OPTION_DESC" = "플라이아웃 메뉴에서 '나중에 볼 동영상에 저장' 옵션을 제거합니다.";+"REMOVE_SAVE_OPTION" = "'재생목록에 저장' 옵션 제거";+"REMOVE_SAVE_OPTION_DESC" = "플라이아웃 메뉴에서 '재생목록에 저장' 옵션을 제거합니다.";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION" = "'재생목록에서 삭제' 옵션 제거";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION_DESC" = "플라이아웃 메뉴에서 '재생목록에서 삭제' 옵션을 제거합니다.";+"REMOVE_SHARE_OPTION" = "'공유' 옵션 제거";+"REMOVE_SHARE_OPTION_DESC" = "플라이아웃 메뉴에서 '공유' 옵션을 제거합니다.";+"REMOVE_NOT_INTERESTED_OPTION" = "'관심 없음' 옵션 제거";+"REMOVE_NOT_INTERESTED_OPTION_DESC" = "플라이아웃 메뉴에서 '관심 없음' 옵션을 제거합니다.";+"REMOVE_DONT_RECOMMEND_OPTION" = "'채널 추천 안함' 옵션 제거";+"REMOVE_DONT_RECOMMEND_OPTION_DESC" = "플라이아웃 메뉴에서 '채널 추천 안함' 옵션을 제거합니다.";+"REMOVE_INFO_OPTION" = "'이 동영상이 표시되는 이유' 옵션 제거";+"REMOVE_INFO_OPTION_DESC" = "플라이아웃 메뉴에서 '이 동영상이 표시되는 이유' 옵션을 제거합니다.";+"REMOVE_FILTER_OPTION" = "'검색 필터' 옵션 제거";+"REMOVE_FILTER_OPTION_DESC" = "플라이아웃 메뉴에서 '검색 필터' 옵션을 제거합니다.";+"REMOVE_REPORT_OPTION" = "'신고' 옵션 제거";+"REMOVE_REPORT_OPTION_DESC" = "플라이아웃 메뉴에서 '신고' 옵션을 제거합니다.";+"REMOVE_YOUTUBE_MUSIC_OPTION" = "'YouTube Music으로 듣기' 옵션 제거";+"REMOVE_YOUTUBE_MUSIC_OPTION_DESC" = "플라이아웃 메뉴에서 'YouTube Music으로 듣기' 옵션을 제거합니다.";+"REMOVE_FEED_BACK_OPTION" = "'의견 보내기' 옵션 제거";+"REMOVE_FEED_BACK_OPTION_DESC" = "플라이아웃 메뉴에서 '의견 보내기' 옵션을 제거합니다.";+"REMOVE_CAST_OPTION" = "'TV에서 보기' 옵션 제거";+"REMOVE_CAST_OPTION_DESC" = "플라이아웃 메뉴에서 'TV에서 보기' 옵션을 제거합니다.";+"REMOVE_SHUFFLE_OPTION" = "'셔플' 옵션 제거";+"REMOVE_SHUFFLE_OPTION_DESC" = "플라이아웃 메뉴에서 '셔플' 옵션을 제거합니다.";+"REMOVE_UN_SUB_OPTION" = "'구독 취소' 옵션 제거";+"REMOVE_UN_SUB_OPTION_DESC" = "플라이아웃 메뉴에서 '구독 취소' 옵션을 제거합니다.";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION" = "'재생목록에서 동영상 숨기기' 옵션 제거";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION_DESC" = "플라이아웃 메뉴에서 '재생목록에서 동영상 숨기기' 옵션을 제거합니다.";+"REMOVE_HELP_OPTION" = "'고객센터 및 의견 보내기' 옵션 제거";+"REMOVE_HELP_OPTION_DESC" = "플라이아웃 메뉴에서 '고객센터 및 의견 보내기' 옵션을 제거합니다.";+"REMOVE_NOTIFY_OPTION" = "'알림 받기' 옵션 제거";+"REMOVE_NOTIFY_OPTION_DESC" = "플라이아웃 메뉴에서 '알림 받기' 옵션을 제거합니다.";+"REMOVE_CLEARSCREEN_OPTION" = "'화면 지우기' 옵션 제거";+"REMOVE_CLEARSCREEN_OPTION_DESC" = "플라이아웃 메뉴에서 '화면 지우기' 옵션을 제거합니다.";+"HIDE_COMMU_GUIDE" = "커뮤니티 가이드 숨기기";+"HIDE_COMMU_GUIDE_DESC" = "커뮤니티 가이드 헤더를 숨깁니다.";+"HIDE_ENGAGEMENT_SUBBAR" = "댓글 헤더 숨기기";+"HIDE_ENGAGEMENT_SUBBAR_DESC" = "댓글 정렬 헤더(인기순, 최신순)가 표시되지 않도록 숨깁니다.";+"DISABLES_RTL" = "RTL 서식 비활성화";+"DISABLES_RTL_DESC" = "오른쪽에서 왼쪽(RTL)으로 표시되는 언어의 텍스트를 강제로 왼쪽에서 오른쪽(LTR) 형식으로 표시합니다.";+"DEVICE_UI" = "인터페이스 스타일";+"OPEN_LINK" = "링크 열기";+"FLOATING_KEYBOARD" = "플로팅 키보드";+"FLOATING_KEYBOARD_DESC" = "플로팅 키보드를 강제로 활성화합니다. iPad 스타일로 스푸핑된 iPhone에서 유용합니다.\n참고: iPad 스타일이 선택된 경우에만 작동합니다.";+"AUTO_OPEN_LINK" = "클립보드 자동 확인";+"AUTO_OPEN_LINK_DESC" = "앱을 열 때마다 클립보드에서 YouTube 관련 링크를 확인합니다.\n정상적으로 작동하려면 iOS 설정 → YouTube → 다른 앱에서 붙여넣기에서 '허용'을 선택하세요.";++"SB_DESCRIPTION" = "커뮤니티가 제출한 데이터를 사용해 스폰서 구간을 자동으로 건너뜁니다.";+"SB_ENABLE" = "SponsorBlock 사용";+"SB_ENABLE_DESC" = "스폰서 구간을 건너뛰기 위해 SponsorBlock 확장 기능을 활성화합니다.";+"SB_SHOW_BUTTON" = "오버레이 버튼 표시";+"SB_SHOW_BUTTON_DESC" = "플레이어 오버레이에 SponsorBlock 켜기/끄기 버튼을 표시합니다.";+"SB_SHOW_NOTIFICATIONS" = "알림 표시";+"SB_SHOW_NOTIFICATIONS_DESC" = "구간이 건너뛰어질 때 알림을 표시합니다. 수동 건너뛰기 카테고리의 알림은 항상 표시됩니다.";+"SB_HAPTIC_FEEDBACK" = "햅틱 피드백";+"SB_HAPTIC_FEEDBACK_DESC" = "구간이 건너뛰어질 때 햅틱 피드백을 제공합니다.";+"SB_SEGMENTS_IN_PLAYER" = "플레이어에 구간 표시";+"SB_SEGMENTS_IN_PLAYER_DESC" = "메인 동영상 플레이어의 진행 바에 색상으로 구간을 표시합니다.";+"SB_SEGMENTS_IN_FEED" = "피드에 구간 표시";+"SB_SEGMENTS_IN_FEED_DESC" = "피드에 있는 플레이어의 진행 바에 색상으로 구간을 표시합니다.";+"SB_SEGMENTS_IN_MINIPLAYER" = "미니플레이어에 구간 표시";+"SB_SEGMENTS_IN_MINIPLAYER_DESC" = "미니플레이어의 진행 바에 색상으로 구간을 표시합니다.";+"SB_SHOW_DURATION" = "구간 제외 재생 시간 표시";+"SB_SHOW_DURATION_DESC" = "건너뛸 수 있는 구간을 제외한 전체 동영상 재생 시간을 표시합니다.";+"SB_CATEGORIES_HEADER" = "구간 카테고리";+"SB_SEGMENT_COLOR" = "구간 색상";++"SB_ACTION_DISABLE" = "사용 안함";+"SB_ACTION_AUTO_SKIP" = "자동 건너뛰기";+"SB_ACTION_ASK" = "건너뛰기 전에 묻기";+"SB_ACTION_DISPLAY" = "탐색바에만 표시";+"SB_ACTION_SKIP_TO" = "구간으로 건너뛰기";++"SB_CAT_sponsor" = "스폰서";+"SB_CAT_sponsor_DESC" = "크리에이터와 직접적인 관련이 없는 제품 또는 서비스에 대한 유료 프로모션입니다.";+"SB_CAT_intro" = "인트로/오프닝";+"SB_CAT_intro_DESC" = "일반적으로 동영상 시작 부분에 표시되는 인트로 애니메이션 또는 막간입니다.";+"SB_CAT_outro" = "엔딩 카드/크레딧";+"SB_CAT_outro_DESC" = "동영상 끝부분의 엔딩 카드, 크레딧 또는 아웃트로입니다.";+"SB_CAT_interaction" = "상호작용 알림";+"SB_CAT_interaction_DESC" = "좋아요, 구독 또는 소셜 미디어 팔로우를 요청하는 구간입니다.";+"SB_CAT_selfpromo" = "자체 프로모션";+"SB_CAT_selfpromo_DESC" = "크리에이터 본인의 제품, 굿즈 또는 기타 콘텐츠에 대한 무료 홍보입니다.";+"SB_CAT_music_offtopic" = "비음악 구간";+"SB_CAT_music_offtopic_DESC" = "뮤직비디오 내의 비음악 구간(예: 대화, 인트로 등)입니다.";+"SB_CAT_preview" = "미리보기/요약";+"SB_CAT_preview_DESC" = "이전 에피소드 요약 또는 다른 동영상의 미리보기 콘텐츠입니다.";+"SB_CAT_hook" = "하이라이트 미리보기/인사";+"SB_CAT_hook_DESC" = "동영상에 나올 내용의 간단한 티저 또는 오프닝 인사말입니다.";+"SB_CAT_poi_highlight" = "주요 하이라이트";+"SB_CAT_poi_highlight_DESC" = "동영상의 핵심 포인트나 하이라이트입니다. '건너뛰기'를 사용하여 바로 이동하세요.";+"SB_CAT_filler" = "군더더기/잡담";+"SB_CAT_filler_DESC" = "동영상 주제와 직접 관련 없는 잡담, 개그 또는 부가적인 장면입니다.";++"SB_SKIPPED" = "%@ 구간을 건너뛰었습니다";+"SB_DETECTED" = "%@ 구간이 감지되었습니다.\n이 구간을 건너뛰시겠습니까?";+"SB_SKIP_NOW" = "건너뛰기";+"SB_UNSKIP" = "건너뛰기 취소";+"SB_JUMPED_TO_HIGHLIGHT" = "하이라이트로 이동함";+"SB_JUMP_TO_HIGHLIGHT" = "하이라이트를 사용할 수 있습니다. 해당 지점으로 이동하시겠습니까?";+"SB_SEGMENT_COLOR_SUFFIX" = "구간 색상";+"SB_SECTION_MAIN" = "기본";+"SB_SKIP_ALERT_DURATION" = "건너뛰기 알림 표시 시간";+"SB_UNSKIP_ALERT_DURATION" = "건너뛰기 취소 알림 표시 시간";+"SB_MIN_DURATION_SLIDER" = "건너뛸 최소 구간 길이";diff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/ru.lproj/Localizable.strings b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/ru.lproj/Localizable.stringsnew file mode 100644index 0000000..5f885b2--- /dev/null+++ b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/ru.lproj/Localizable.strings@@ -0,0 +1,578 @@+"SETTINGS" = "Настройки";+"INTERFACE" = "Интерфейс";++"SEARCH" = "Поиск";+"SEARCH_DESC" = "Поиск по настройкам YouMod.";++"URL_COPIED" = "Ссылка на видео скопирована";+"COPY_URL" = "Скопировать ссылку на видео";+"COPY_URL_TIMESTAMP" = "Скопировать ссылку на видео с таймкодом";+"URL_TIMESTAMP_COPIED" = "Ссылка на видео с таймкодом скопирована";+"CANCEL" = "Отмена";+"ERROR" = "Ошибка";+"ERROR_VIDEOID" = "Не удалось получить ID видео";+"ERROR_ADS" = "Невозможно скопировать ссылку во время показа рекламы";++"LOOP_DISABLED" = "Повтор отключён";+"LOOP_ENABLED" = "Повтор включён";++"NEW_ISSUES" = "Сообщить о проблеме или предложить новую функцию";+"NEW_ISSUES_DESC" = "Нашли баг или хотите предложить новую функцию? Нажмите здесь.";+"SOURCE_CODES" = "Исходный код";+"SOURCE_CODES_DESC" = "Взгляните на код!";++"EXTRA" = "Дополнительно";+"FIX_PLAYBACK_ISSUES" = "Исправить проблемы воспроизведения (временно)";+"FIX_PLAYBACK_ISSUES_DESC" = "Пытается исправить проблемы воспроизведения видео у некоторых пользователей. При включении плеер будет автоматически перезагружаться при каждой ошибке или неудачном воспроизведении видео.";++"PERFER_HEADER" = "Настройки YouMod";+"PERFER" = "Настройки";+"IMPORT" = "Импорт настроек";+"IMPORT_DESC" = "Загружает ваши настройки из файла .plist.";+"IMPORT_DONE" = "Успешно";+"YES" = "Да";+"APPLY_DESC" = "Требуется перезапуск приложения. Перезапустить его сейчас?";+"EXPORT" = "Экспорт настроек";+"EXPORT_DESC" = "Сохраняет ваши настройки в файл .plist.";+"RESTORE" = "Восстановить настройки";+"RESTORE_DESC" = "Загружает настройки по умолчанию, как при чистой установке.";+"WARNING" = "Внимание";+"RESETDEFAULT" = "Все настройки будут сброшены до значений по умолчанию. Продолжить?";+"ERROR_INVALID_FILE" = "Некорректный файл";+"ERROR_NO_KEYS_IMPORT" = "Нет доступных ключей для импорта";+"ERROR_NO_KEYS_EXPORT" = "Нет доступных ключей для экспорта";+"OVERRIDE" = "Текущие настройки будут перезаписаны. Продолжить?";+"DISABLED" = "Отключено";++"CACHE" = "Управление кэшем";+"CLEARCACHE" = "Очистить кэш";+"DONE" = "Готово";+"AUTO_CLEARCACHE" = "Автоочистка кэша";+"AUTO_CLEARCACHE_DESC" = "Автоматически очищает кэш приложения при запуске.";++"DOWNLOADING" = "Скачивание";+"DOWNLOAD_MANAGER" = "Менеджер загрузок";+"DOWNLOAD_MANAGER_DESC" = "Заменяет загрузчик видео YouTube на загрузчик YouMod. Позволяет скачивать видео, аудио, субтитры и обложки.";+"POST_DOWNLOAD_ACTION" = "Действие после загрузки";+"POST_ACTION_SAVE_PHOTOS" = "Сохранить в Фото";+"POST_ACTION_SHARE" = "Поделиться";+"POST_ACTION_ASK" = "Спросить";+"ADD_SHORTS_DOWNLOAD" = "Добавить кнопку загрузки в Shorts";+"ADD_SHORTS_DOWNLOAD_DESC" = "Добавляет кнопку загрузки в интерфейс видео Shorts.";+"DOWNLOAD_SHORTS" = "Скачать Shorts";+"COPY_VID_INFO" = "Скопировать информацию о видео";+"COPY_TITLE" = "Скопировать название";+"COPY_DESCRIPTION" = "Скопировать описание";+"COPY_ALL_VID_INFO" = "Скопировать всё";+"COPIED_TITLE" = "Название видео скопировано";+"COPIED_DESCRIPTION" = "Описание видео скопировано";+"COPY_AUTHOR" = "Скопировать автора";+"COPIED_AUTHOR" = "Автор видео скопирован";+"SAVE_THUMBNAIL" = "Сохранить обложку";+"DOWNLOAD_CAPTIONS" = "Скачать субтитры";+"DOWNLOAD_AUDIO" = "Скачать аудио";+"DOWNLOAD_VIDEO" = "Скачать видео";+"OPEN_VID_BEFORE" = "Сначала откройте видео, прежде чем использовать менеджер загрузок";+"NO_CAPTIONS_URL" = "Не найдено корректных ссылок на субтитры";+"NO_AUDIO_URL" = "Ссылка на аудио не найдена";+"NO_STREAM_URL" = "Ссылка на поток не найдена";+"CAPTIONS_FAILED" = "Не удалось скачать субтитры";+"NO_CAPTIONS" = "Для этого видео нет доступных субтитров";+"NO_AUDIO_STREAM_FOUND" = "Аудиопотоки не найдены";+"NO_VID_AUDIO_STREAM_FOUND" = "Видео- и аудиопотоки не найдены";+"COPIED_VID_INFO" = "Вся информация о видео скопирована";+"SAVED_TO_PHOTOS" = "Сохранено в Фото";+"SAVE_FAILED" = "Не удалось сохранить";+"PHOTO_ACCESS_DENINED" = "Доступ к Фото запрещён";+"THUMBNAIL_FAILED" = "Не удалось обработать обложку";+"DOWNLOADING_THUMBNAIL" = "Скачивание обложки...";+"DOWNLOADING_AUDIO" = "Скачивание аудио...";+"DOWNLOADING_VIDEO" = "Скачивание видео...";+"DOWNLOADING_CAPTIONS" = "Скачивание субтитров...";+"NO_THUMBNAIL_FOUND" = "Обложка не найдена";+"DOWNLOAD_FAILED" = "Не удалось скачать";+"AUDIO_SAVED" = "Аудио сохранено";+"DOWNLOAD_COMPLETED" = "Загрузка завершена";+"CANNOT_SAVE_TO_PHOTOS" = "Невозможно сохранить в Фото";+"FINA_VIDEO" = "Завершение обработки видео...";+"MERGING_VID_FALLBACK" = "Объединение видео (резервный режим)...";+"MERGING_VID" = "Объединение видео...";+"CONVERTING" = "Конвертация в";+"ALREADY_DOWNLOADING" = "Загрузка уже выполняется";+"DOWNLOAD_CANCELLED" = "Загрузка отменена";+"TRIMMING_AUDIO" = "Обрезка аудио...";+"SHOW_THUMBNAIL" = "Показать обложку";+"COPY_THUMBNAIL" = "Скопировать обложку";+"THUMBNAIL_OPTIONS" = "Скачать обложку";+"COPY" = "Копировать";+"COPIED_TO_CLIPBOARD" = "Скопировано в буфер обмена";+"CONNECTING_TO_SERVER" = "Подключение к серверу...";+"DOWNLOADING_TO_SERVER" = "Загрузка на сервер...";+"COPY_COMMENT_TEXT" = "Скопировать текст комментария";+"SAVE_COMMENT_IMAGE" = "Сохранить комментарий как изображение";+"COPY_COMMENT_IMAGE" = "Скопировать комментарий как изображение";+"COPY_POST_TEXT" = "Скопировать текст публикации";+"SAVE_POST_IMAGE" = "Сохранить публикацию как изображение";+"COPY_POST_IMAGE" = "Скопировать публикацию как изображение";+"DOWNLOAD_SERVER" = "Сервер загрузки";+"CHOOSE_DOWNLOAD_SERVER" = "Выберите сервер загрузки";+"DOWNLOAD_COMMENT" = "Сохранение информации о комментариях";+"DOWNLOAD_COMMENT_DESC" = "Позволяет скопировать текст комментария и сохранить комментарий как изображение долгим нажатием на кнопку с тремя точками.";+"DOWNLOAD_POST" = "Сохранение информации о публикациях";+"DOWNLOAD_POST_DESC" = "Позволяет скопировать текст публикации и сохранить публикацию как изображение долгим нажатием.";+"TRANSLATE_COMMENT" = "Перевести комментарий";+"TRANSLATE_POST" = "Перевести публикацию";+"SERVER_EUROPRE1" = "Европа";+"SERVER_ASIA1" = "Таиланд — Азия";+"SHOW_OPTIONS" = "Показать параметры";+"ENGLISH" = "Английский";+"TRANSLATION" = "Перевод";+"LANGUAGE" = "Язык";+"TRANSLATING" = "Перевод...";+"SELECT_LANG" = "Выберите язык";+"TRANSLATE_FAILED" = "Не удалось перевести, попробуйте ещё раз.";+"SAVE_CURRENT_IMAGE" = "Сохранить текущее изображение";+"COPY_CURRENT_IMAGE" = "Скопировать текущее изображение";+"DOWNLOAD_METHOD" = "Способ загрузки";+"DOWNLOAD_METHOD_DESC" = "Определяет, как скачиваются видео. Режим «На устройстве» работает в последних версиях YouTube.";+"METHOD_DIRECT" = "Прямой";+"METHOD_SERVER" = "Через сервер";+"METHOD_ONDEVICE" = "На устройстве (SABR)";++"APPEARANCE" = "Оформление";+"OLED_THEME" = "Тёмная тема OLED";+"OLED_THEME_DESC" = "Использует чистый чёрный (OLED) цвет для тёмной темы приложения.";+"OLED_KEYBOARD" = "Клавиатура OLED";+"OLED_KEYBOARD_DESC" = "Клавиатура использует чистый чёрный (OLED) цвет в тёмной теме.";++"NAVBAR" = "Панель навигации";+"STICKY_NAVBAR" = "Закреплённая панель навигации";+"STICKY_NAVBAR_DESC" = "Закрепляет панель навигации, чтобы она оставалась видимой при прокрутке вниз.";+"NAVIGATION_ICON" = "Значок навигации";+"NAVIGATION_ICON_DESC" = "Меняет логотип YouTube в панели навигации.";+"PREMIUM" = "Premium";+"REMOVE_YTLOGO" = "Убрать логотип";+"YOUTUBE" = "YouTube";+"HIDE_NOTIFICATION_BUTTON" = "Скрыть кнопку уведомлений";+"HIDE_NOTIFICATION_BUTTON_DESC" = "Скрывает кнопку уведомлений в панели навигации.";+"HIDE_SEARCH_BUTTON" = "Скрыть кнопку поиска";+"HIDE_SEARCH_BUTTON_DESC" = "Скрывает кнопку поиска в панели навигации.";+"HIDE_VOICE_SEARCH_BUTTON" = "Скрыть кнопку голосового поиска";+"HIDE_VOICE_SEARCH_BUTTON_DESC" = "Скрывает кнопку голосового поиска в панели навигации.";+"HIDE_CAST_BUTTON_NAVBAR" = "Скрыть кнопку трансляции";+"HIDE_CAST_BUTTON_NAVBAR_DESC" = "Скрывает кнопку трансляции в панели навигации.";++"FEED" = "Лента";+"HIDE_SUBBAR" = "Скрыть панель фильтров";+"HIDE_SUBBAR_DESC" = "Скрывает панель фильтров вверху ленты.";+"HIDE_HORI_SHELF" = "Убрать горизонтальные полки";+"HIDE_HORI_SHELF_DESC" = "Убирает все горизонтальные полки (Новости, Продолжить просмотр, Подборки публикаций и т.д.) из ленты, кроме Playables.";+"HIDE_MUSIC_PLAYLISTS" = "Скрыть генератор музыкальных плейлистов";+"HIDE_MUSIC_PLAYLISTS_DESC" = "Скрывает генератор музыкальных плейлистов (подбор трёх мелодий) в ленте.";+"HIDE_FEED_POST" = "Скрыть публикации";+"HIDE_FEED_POST_DESC" = "Скрывает публикации в ленте.";+"HIDE_SURVEYS" = "Скрыть опросы";+"HIDE_SURVEYS_DESC" = "Скрывает опросы, которые YouTube иногда показывает.";+"HIDE_SHORTS_SHELF" = "Скрыть полку Shorts";+"HIDE_SHORTS_SHELF_DESC" = "Скрывает полку Shorts в ленте, включая вкладку «Подписки».";+"KEEP_SHORTS_SUBSCRIPT" = "Сохранить Shorts в «Подписках»";+"KEEP_SHORTS_SUBSCRIPT_DESC" = "Не даёт удалять Shorts из вкладки «Подписки».";+"HIDE_SEARCH_HISTORY" = "Скрыть историю поиска";+"HIDE_SEARCH_HISTORY_DESC" = "Скрывает предыдущую историю поиска и подсказки при использовании строки поиска.\\nПРИМЕЧАНИЕ: история поиска останется доступной в других клиентах YouTube.";+"REMOVE_CHANNEL_COMMUNITY_BUTTON" = "Удалить кнопку «Сообщество»";+"REMOVE_CHANNEL_COMMUNITY_BUTTON_DESC" = "Удаляет кнопку сообщества в шапке канала.";+"REMOVE_CHANNEL_SPONSOR_BUTTON" = "Удалить кнопку «Спонсировать»";+"REMOVE_CHANNEL_SPONSOR_BUTTON_DESC" = "Удаляет кнопку спонсорства/подписки в ленте, на странице канала и в Shorts.";+"HIDE_PLAYABLES" = "Убрать Playables";+"HIDE_PLAYABLES_DESC" = "Убирает Playables (мини-игры) из ленты.";+"HIDE_RELATED_VIDEOS" = "Скрыть похожие видео";+"HIDE_RELATED_VIDEOS_DESC" = "Скрывает похожие видео под плеером (кроме полноэкранного режима).";++"PLAYER" = "Плеер";+"PLAYBACK_SPEED" = "Скорость воспроизведения";+"CONTROL_CENTER" = "Пункт управления";+"PLAYER_ACTIONS" = "Действия плеера";+"GESTURE_HEADER" = "Жесты";+"QUALITY_WIFI" = "Качество воспроизведения по Wi-Fi";+"QUALITY_WIFI_DESC" = "Автоматически применяет выбранное качество при воспроизведении по Wi-Fi.";+"QUALITY_CELLULAR" = "Качество воспроизведения по мобильной сети";+"QUALITY_CELLULAR_DESC" = "Автоматически применяет выбранное качество при воспроизведении по мобильному интернету.";+"QUALITY_LOW_POWER" = "Качество в режиме энергосбережения";+"QUALITY_LOW_POWER_DESC" = "Автоматически применяет выбранное качество, когда на устройстве включён режим энергосбережения.";+"DEFAULT" = "По умолчанию";+"BEST" = "Наилучшее";+"AUDIO_TRACK" = "Предпочитаемая аудиодорожка";+"ORIGINAL" = "Оригинальная";+"SELECT_MANUALLY" = "Выбрать вручную";+"AUDIO_TRACK_SELECT" = "Выбранная аудиодорожка";+"AUDIO_TRACK_SELECT_DESC" = "Задаёт предпочитаемый язык аудиодорожки для воспроизведения, если он доступен.";+"NO_AUTO_DUBBED" = "Использовать оригинальную аудиодорожку";+"NO_AUTO_DUBBED_DESC" = "Использует оригинальную аудиодорожку, если дорожка на предпочитаемом языке автоматически дублирована или не найдена.";+"CAPTION_TRACK" = "Предпочитаемые субтитры";+"CAPTION_TRACK_SELECT" = "Выбранные субтитры";+"CAPTION_TRACK_SELECT_DESC" = "Задаёт предпочитаемый язык субтитров для отображения, если он доступен.";+"DISABLES_CAPTION_TRACK" = "Автоматически отключать субтитры";+"DISABLES_CAPTION_TRACK_DESC" = "Автоматически отключает субтитры, если субтитры на предпочитаемом языке сгенерированы автоматически или не найдены.";+"DEFAULT_SPEED" = "Скорость воспроизведения по умолчанию";+"DEFAULT_SPEED_DESC" = "Заменяет стандартную скорость воспроизведения.";+"QUALITY_BUTTON" = "Управление качеством";+"SPEED_BUTTON" = "Управление скоростью";+"MUTE_BUTTON" = "Без звука";+"SHARE_BUTTON" = "Поделиться";+"LOOP_BUTTON" = "Повтор";+"CAPTION_BUTTON" = "Субтитры";+"DOWNLOAD_BUTTON" = "Скачать";+"SPONSORBLOCK_BUTTON" = "SponsorBlock";+"MANAGE_OVERLAY_BUTTONS" = "Управление кнопками оверлея";+"MANAGE_OVERLAY_BUTTONS_DESC" = "Изменение порядка и видимости кнопок оверлея";+"OVERLAY_BUTTON_REORDER_HINT" = "Перетащите, чтобы изменить порядок кнопок оверлея. Переключите, чтобы показать/скрыть.";+"HOLD_TO_SPEED" = "Ускорение удержанием";+"HOLD_TO_SPEED_DESC" = "Задаёт скорость воспроизведения для режима ускорения удержанием.";+"HIDE_AUTOPLAY" = "Скрыть переключатель автовоспроизведения";+"HIDE_AUTOPLAY_DESC" = "Скрывает переключатель автовоспроизведения в интерфейсе видео.";+"HIDE_CAPTIONS_BUTTON" = "Скрыть кнопку субтитров";+"HIDE_CAPTIONS_BUTTON_DESC" = "Скрывает кнопку субтитров в интерфейсе видео.";+"HIDE_CAST_BUTTON_PLAYER" = "Скрыть кнопку трансляции";+"HIDE_CAST_BUTTON_PLAYER_DESC" = "Скрывает кнопку трансляции в интерфейсе видео.";+"HIDE_NEXT_AND_PREV_BUTTON" = "Скрыть кнопки предыдущего и следующего видео";+"HIDE_NEXT_AND_PREV_BUTTON_DESC" = "Скрывает кнопки предыдущего и следующего видео в интерфейсе видео.";+"REPLACE_PREVNEXT_BUTTONS" = "Заменить кнопки предыдущего/следующего видео";+"REPLACE_PREVNEXT_BUTTONS_DESC" = "Заменяет кнопки предыдущего и следующего видео в плеере на кнопки перемотки назад и вперёд.";+"REMOVE_DARK_OVERLAY" = "Убрать затемнение";+"REMOVE_DARK_OVERLAY_DESC" = "Убирает тёмное затемнение в интерфейсе видео.";+"HIDE_END_SCREEN" = "Скрыть конечные заставки";+"HIDE_END_SCREEN_DESC" = "Скрывает конечные заставки, показываемые перед окончанием видео.";+"REMOVE_AMBIANT" = "Убрать фоновую подсветку";+"REMOVE_AMBIANT_DESC" = "Убирает эффект светящейся подсветки позади видеоплеера.";+"HIDE_SUGGESTED_VIDEO" = "Скрыть рекомендованные видео";+"HIDE_SUGGESTED_VIDEO_DESC" = "Скрывает сетку рекомендованных видео, появляющуюся по окончании видео.";+"HIDE_PAID_OVERLAY" = "Скрыть «Включает платную рекламу»";+"HIDE_PAID_OVERLAY_DESC" = "Скрывает надпись «Включает платную рекламу» в интерфейсе видео.";+"HIDE_WATERMARK" = "Скрыть водяной знак";+"HIDE_WATERMARK_DESC" = "Скрывает водяной знак канала внизу интерфейса видео.";+"PAUSE_ON_OVERLAY" = "Пауза при появлении интерфейса";+"PAUSE_ON_OVERLAY_DESC" = "Ставит воспроизведение на паузу при появлении интерфейса.";+"DISABLES_SNAP_TO_CHAPTER" = "Отключить привязку к главам";+"DISABLES_SNAP_TO_CHAPTER_DESC" = "Не позволяет полосе прогресса прилипать к главам.";+"DISABLES_ENGAGE_PANEL" = "Отключить панель взаимодействия в полноэкранном режиме";+"DISABLES_ENGAGE_PANEL_DESC" = "Не позволяет панели взаимодействия появляться в полноэкранном режиме.";+"GESTURES" = "Включить управление жестами";+"GESTURES_DESC" = "Проводите вверх или вниз по левому/правому краю экрана видео, чтобы регулировать яркость, громкость или скорость воспроизведения.";+"GESTURE_AREA" = "Область активации жестов";+"GESTURE_AREA_DESC" = "Настройка области у краёв экрана, где жесты активны. (Значение 50% делит экран пополам без мёртвой зоны в центре.)";+"LEFT_SIDE_GESTURE" = "Свайп по левой стороне";+"RIGHT_SIDE_GESTURE" = "Свайп по правой стороне";+"GESTURE_BRIGHTNESS" = "Яркость";+"GESTURE_VOLUME" = "Громкость";+"GESTURE_SPEED" = "Скорость воспроизведения";+"GESTURE_NONE" = "Нет";+"GESTURE_HUD" = "Показывать HUD жестов";+"GESTURE_HUD_DESC" = "Показывает текущий процент (%) на экране при регулировке яркости, громкости или скорости воспроизведения.";+"GESTURE_HUD_SIZE" = "Размер HUD жестов";+"GESTURE_HUD_SIZE_DESC" = "Настройка размера текста и значков HUD жестов.";+"SMALL" = "Маленький (-1)";+"NORMAL" = "Обычный (по умолчанию)";+"LARGE" = "Большой (+1)";+"EXTRALARGE" = "Очень большой (+2)";+"MAX" = "Максимальный (+3)";+"GESTURE_HUD_POSITION" = "Положение HUD жестов";+"GESTURE_HUD_POSITION_DESC" = "Задаёт вертикальное положение HUD жестов (вверху, посередине, внизу).";+"TOP" = "Вверху";+"MIDDLE" = "Посередине";+"BOTTOM" = "Внизу";+"DISABLES_DOUBLE_TAP" = "Отключить двойное касание";+"DISABLES_DOUBLE_TAP_DESC" = "Отключает двойное касание для перемотки в интерфейсе видео.";+"DISABLES_LONG_HOLD" = "Отключить долгое нажатие";+"DISABLES_LONG_HOLD_DESC" = "Отключает ускорение видео долгим нажатием в интерфейсе видео.";+"AUTO_EXIT_FULLSCREEN" = "Автовыход из полноэкранного режима";+"AUTO_EXIT_FULLSCREEN_DESC" = "Автоматически выходит из полноэкранного режима после окончания видео.";+"AUTO_FEED_MUTE" = "Автоотключение звука в ленте";+"AUTO_FEED_MUTE_DESC" = "Автоматически отключает звук у видео, воспроизводимых в ленте.";+"DISABLES_SHOW_REMAINING" = "Отключить оставшееся время";+"DISABLES_SHOW_REMAINING_DESC" = "Отключает показ оставшегося времени видео при нажатии на таймкод.";+"ALWAYS_SHOW_REMAINING" = "Всегда показывать оставшееся время";+"ALWAYS_SHOW_REMAINING_DESC" = "Оставшееся время всегда отображается по умолчанию в интерфейсе плеера.";+"COPY_TIMESTAMP_ON_PAUSE" = "Копировать ссылки с таймкодом";+"COPY_TIMESTAMP_ON_PAUSE_DESC" = "Позволяет скопировать ссылку с таймкодом в буфер обмена нажатием кнопки паузы.";+"SHOW_REMAINING_EXTRA" = "Показывать время окончания";+"SHOW_REMAINING_EXTRA_DESC" = "Добавляет примерное время окончания видео к метке в интерфейсе видео.";+"HIDE_FULLSCREEN_ACTIONS" = "Скрыть кнопки действий в полноэкранном режиме";+"HIDE_FULLSCREEN_ACTIONS_DESC" = "Скрывает кнопки быстрых действий («Нравится», «Не нравится», «Другие видео» и т.д.) в полноэкранном режиме.";+"HIDE_FULL_VID_TITLE" = "Скрыть название видео в полноэкранном режиме";+"HIDE_FULL_VID_TITLE_DESC" = "Скрывает название видео, отображаемое в левом верхнем углу в полноэкранном режиме.";+"STOP_AUTOPLAY_VIDEO" = "Отключить автовоспроизведение";+"STOP_AUTOPLAY_VIDEO_DESC" = "Не позволяет видео воспроизводиться автоматически при его открытии.";+"HIDE_CONTENT_WARNING" = "Пропускать предупреждение о контенте";+"HIDE_CONTENT_WARNING_DESC" = "Автоматически пропускает предупреждение о чувствительном контенте в некоторых видео.";+"AUTO_FULLSCREEN" = "Автопереход в полноэкранный режим";+"AUTO_FULLSCREEN_DESC" = "Автоматически разворачивает видео на весь экран при запуске воспроизведения.";+"PORTRAIT_FULLSCREEN" = "Портретный полноэкранный режим";+"PORTRAIT_FULLSCREEN_DESC" = "Включает поддержку полноэкранного режима в портретной ориентации.";+"OLD_QUALITY_PICKER" = "Использовать старое меню качества";+"OLD_QUALITY_PICKER_DESC" = "Возвращает классическое меню выбора качества видео (сразу показывает список всех разрешений).";+"EXTRA_SPEED" = "Дополнительные скорости";+"EXTRA_SPEED_DESC" = "Добавляет больше вариантов скорости воспроизведения вплоть до 10x.";+"FORCE_MINIPLAYER" = "Принудительный мини-плеер";+"FORCE_MINIPLAYER_DESC" = "Позволяет всем видео, включая детские, воспроизводиться в мини-плеере при сворачивании плеера.";+"FORCE_SEEKBAR" = "Всегда показывать полосу прогресса";+"FORCE_SEEKBAR_DESC" = "Полоса прогресса (seekbar) всегда остаётся видимой в полноэкранном режиме.";+"TAP_TO_SEEK" = "Перемотка касанием";+"TAP_TO_SEEK_DESC" = "Быстрый переход к любому месту видео касанием полосы прогресса.";+"DISABLES_ZOOM" = "Отключить свободное масштабирование";+"DISABLES_ZOOM_DESC" = "Отключает новые жесты свободного масштабирования.";+"USES_24_HOURS_TIME" = "24-часовой формат";+"USES_24_HOURS_TIME_DESC" = "Показывает время окончания в 24-часовом формате.";+"PAUSE_TWO_FINGERS" = "Пауза двумя пальцами";+"PAUSE_TWO_FINGERS_DESC" = "Ставит воспроизведение на паузу и возобновляет его касанием экрана двумя пальцами.";+"SKIP_BACKWARD" = "Перемотка назад";+"SKIP_BACKWARD_DESC" = "Заменяет кнопку предыдущего трека в Пункте управления на кнопку перемотки назад на заданное число секунд.";+"SKIP_FORWARD" = "Перемотка вперёд";+"SKIP_FORWARD_DESC" = "Заменяет кнопку следующего трека в Пункте управления на кнопку перемотки вперёд на заданное число секунд.";+"REWIND_SECONDS" = "Секунды перемотки назад";+"FORWARD_SECONDS" = "Секунды перемотки вперёд";+"HIDE_COMMENTS_SECTION" = "Скрыть раздел комментариев";+"HIDE_COMMENTS_SECTION_DESC" = "Полностью удаляет весь раздел комментариев.";+"HIDE_COMMENTS_PREVIEW" = "Скрыть превью комментариев";+"HIDE_COMMENTS_PREVIEW_DESC" = "Удаляет блок превью верхнего комментария, сохраняя возможность развернуть весь раздел.";+"LOCK_SPEED" = "Фиксация скорости";+"LOCK_SPEED_DESC" = "Фиксирует скорость, настроенную свайпом вниз.";+"SEEK_ON_OVERLAY" = "Перемотка свайпами";+"SEEK_ON_OVERLAY_DESC" = "Позволяет перематывать видео свайпами влево и вправо по интерфейсу видео.";+"DRC_AUDIO_OPTIONS" = "Автовыбор стабильной громкости";+"DRC_AUDIO_OPTIONS_DESC" = "Автоматически определяет, включать или отключать стабильную громкость.";+"REMOVE_VIDEO_LIKE_BUTTON" = "Удалить кнопку «Нравится»";+"REMOVE_VIDEO_LIKE_BUTTON_DESC" = "Удаляет кнопку «Нравится» под видеоплеером и в полноэкранном интерфейсе.";+"REMOVE_VIDEO_DISLIKE_BUTTON" = "Удалить кнопку «Не нравится»";+"REMOVE_VIDEO_DISLIKE_BUTTON_DESC" = "Удаляет кнопку «Не нравится» под видеоплеером и в полноэкранном интерфейсе.";+"REMOVE_VIDEO_SHARE_BUTTON" = "Удалить кнопку «Поделиться»";+"REMOVE_VIDEO_SHARE_BUTTON_DESC" = "Удаляет кнопку «Поделиться» под видеоплеером и в полноэкранном интерфейсе.";+"REMOVE_VIDEO_SAVE_BUTTON" = "Удалить кнопку «Сохранить»";+"REMOVE_VIDEO_SAVE_BUTTON_DESC" = "Удаляет кнопку сохранения в плейлист под видеоплеером и в полноэкранном интерфейсе.";+"REMOVE_VIDEO_DOWNLOAD_BUTTON" = "Удалить кнопку «Скачать»";+"REMOVE_VIDEO_DOWNLOAD_BUTTON_DESC" = "Удаляет кнопку загрузки под видеоплеером и в полноэкранном интерфейсе.";+"REMOVE_VIDEO_CLIP_BUTTON" = "Удалить кнопку «Создать клип»";+"REMOVE_VIDEO_CLIP_BUTTON_DESC" = "Удаляет кнопку «Создать клип» под видеоплеером и в полноэкранном интерфейсе.";+"REMOVE_VIDEO_REMIX_BUTTON" = "Удалить кнопку «Ремикс»";+"REMOVE_VIDEO_REMIX_BUTTON_DESC" = "Удаляет кнопку «Ремикс» под видеоплеером и в полноэкранном интерфейсе.";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON" = "Удалить кнопку чата трансляции";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON_DESC" = "Удаляет кнопку чата прямой трансляции под видеоплеером и в полноэкранном интерфейсе.";++"SHORTS" = "Shorts";+"HIDE_SHORTS_TOPBAR" = "Скрыть верхнюю панель";+"HIDE_SHORTS_TOPBAR_DESC" = "Скрывает всю верхнюю панель в плеере.";+"HIDE_SHORTS_SUBBAR" = "Скрыть панель категорий";+"HIDE_SHORTS_SUBBAR_DESC" = "Скрывает панель категорий Shorts в плеере.";+"SHORTS_ONLY" = "Режим только Shorts";+"SHORTS_ONLY_DESC" = "Ограничивает функции YouTube только просмотром Shorts. Отключить режим можно долгим нажатием двумя пальцами в плеере Shorts.";+"SHORTS_ONLY_DISABLED" = "Режим только Shorts отключён";+"SHORTS_ACTION" = "Действие Shorts после окончания видео";+"LOOP" = "Повтор";+"SKIP_TO_NEXT_SHORTS" = "Следующий";+"PAUSE_SHORTS" = "Остановить";+"REMOVE_LIVE_SHORTS" = "Убрать трансляции";+"REMOVE_LIVE_SHORTS_DESC" = "Убирает прямые трансляции из ленты.";+"HIDE_SHORTS_PRODUCT" = "Скрыть товары";+"HIDE_SHORTS_PRODUCT_DESC" = "Скрывает отмеченные товары и ссылки на покупки в интерфейсе Shorts.";+"HIDE_SHORTS_RECBAR" = "Скрыть панель рекомендаций";+"HIDE_SHORTS_RECBAR_DESC" = "Скрывает панель рекомендуемых действий в плеере Shorts (например «Попробовать этот звук», «Покупки», «Превью комментария»).";+"HIDE_SHORTS_DISCLOSURE" = "Скрыть «Получает комиссию»";+"HIDE_SHORTS_DISCLOSURE_DESC" = "Скрывает уведомление «Получает комиссию» в Shorts.";+"REMOVE_SHORTS_LIKE_BUTTON" = "Удалить кнопку «Нравится»";+"REMOVE_SHORTS_LIKE_BUTTON_DESC" = "Удаляет кнопку «Нравится» в интерфейсе Shorts.";+"REMOVE_SHORTS_COMMENT_BUTTON" = "Удалить кнопку «Комментарии»";+"REMOVE_SHORTS_COMMENT_BUTTON_DESC" = "Удаляет кнопку «Комментарии» в интерфейсе Shorts.";+"REMOVE_SHORTS_SHARE_BUTTON" = "Удалить кнопку «Поделиться»";+"REMOVE_SHORTS_SHARE_BUTTON_DESC" = "Удаляет кнопку «Поделиться» в интерфейсе Shorts.";+"REMOVE_SHORTS_REMIX_BUTTON" = "Удалить кнопку «Ремикс»";+"REMOVE_SHORTS_REMIX_BUTTON_DESC" = "Удаляет кнопку «Ремикс» в интерфейсе Shorts.";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON" = "Удалить кнопку информации о звуке";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON_DESC" = "Удаляет кнопку с информацией о треке/звуке в интерфейсе Shorts.";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON" = "Удалить кнопку «Подписки»";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON_DESC" = "Удаляет кнопку подписок в заголовке при паузе Shorts.";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON" = "Удалить кнопку «Live»";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON_DESC" = "Удаляет кнопку Live в заголовке при паузе Shorts.";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON" = "Удалить кнопку «Lens»";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON_DESC" = "Удаляет кнопку Lens в заголовке при паузе Shorts.";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON" = "Удалить кнопку «В тренде»";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON_DESC" = "Удаляет кнопку трендов в заголовке при паузе Shorts.";+"ENABLES_SHORTS_QUALITY" = "Включить выбор качества в Shorts";+"ENABLES_SHORTS_QUALITY_DESC" = "Принудительно включает меню выбора качества видео в Shorts.";+"SHOW_SHORTS_SEEKBAR" = "Всегда показывать полосу прогресса";+"SHOW_SHORTS_SEEKBAR_DESC" = "Полоса прогресса всегда видна в нижней части плеера Shorts.";+"REMOVE_POSTS_SHORTS" = "Убрать публикации";+"REMOVE_POSTS_SHORTS_DESC" = "Убирает публикации из ленты.";+"SHORTS_FULLSCREEN" = "Полноэкранный режим щипком";+"SHORTS_FULLSCREEN_DESC" = "Управляет видимостью интерфейса жестами сжатия и разведения пальцев, показывая Shorts в полноэкранном режиме.";++"TABBAR" = "Панель вкладок";+"DEFAULT_TAB" = "Вкладка при запуске";+"FORSTED_TAB_BAR" = "Полупрозрачная панель вкладок";+"ENABLED" = "Включено";+"HOME_TAB" = "Главная";+"SHORTS_TAB" = "Shorts";+"CREATE_TAB" = "Создать";+"SUBSCRIPTIONS_TAB" = "Подписки";+"LIBRARY_TAB" = "Библиотека (Вы)";+"HIDE_TAB_INDI" = "Скрыть индикаторы вкладок";+"HIDE_TAB_INDI_DESC" = "Скрывает все индикаторы вкладок в панели вкладок.";+"HIDE_TAB_LABELS" = "Скрыть подписи вкладок";+"HIDE_TAB_LABELS_DESC" = "Скрывает все подписи вкладок в панели вкладок.";+"HISTORY_TAB" = "История";+"GAMING_TAB" = "Игры";+"SPORTS_TAB" = "Спорт";+"NOTI_TAB" = "Уведомления";+"NEWS_TAB" = "Новости";+"MUSIC_TAB" = "Музыка";+"WATCH_LATER_TAB" = "Смотреть позже";+"PLAYLIST_TAB" = "Плейлисты";+"LIKE_TAB" = "Понравившиеся видео";+"LIVE_TAB" = "В эфире";+"POST_TAB" = "Публикации";+"VIDEO_TAB" = "Ваши видео";+"MOVIE_TAB" = "Фильмы";+"COURSE_TAB" = "Курсы";+"MINIGAME_TAB" = "Playables";+"FASHION_TAB" = "Мода и красота";+"LEARNING_TAB" = "Обучение";+"MANAGE_TABS" = "Управление вкладками";+"MANAGE_TABS_DESC" = "Изменение порядка и видимости вкладок";+"TAB_REORDER_HINT" = "Перетащите, чтобы изменить порядок. Переключите, чтобы показать/скрыть.\\nНастройки вкладок также доступны долгим нажатием на первую вкладку в панели вкладок.";+"TAB_LIMIT" = "Лимит вкладок";+"TAB_LIMIT_DESC" = "Разрешено не более 6 вкладок.";+"ZERO_TAB_DESC" = "Должна быть включена хотя бы одна вкладка.";++"MISCELLANEOUS" = "Разное";+"BACKGROUND_PLAYBACK" = "Фоновое воспроизведение";+"BACKGROUND_PLAYBACK_DESC" = "Включает фоновое воспроизведение видео.";+"DISABLES_SHORTS_PIP" = "Отключить PiP для Shorts";+"DISABLES_SHORTS_PIP_DESC" = "Пытается отключить PiP для Shorts, но это может сработать не всегда.";+"DISABLE_HINTS" = "Отключить подсказки";+"DISABLE_HINTS_DESC" = "Отключает обучающие подсказки и интерактивные всплывающие окна.";+"BLOCK_UPGRADE_DIALOGS" = "Блокировать предложения обновления";+"BLOCK_UPGRADE_DIALOGS_DESC" = "Блокирует окна YouTube с предложением обновить приложение.";+"ARE_YOU_THERE_DIALOG" = "Скрыть окно «Вы ещё смотрите?»";+"ARE_YOU_THERE_DIALOG_DESC" = "Скрывает окно, которое появляется при долгом бездействии в приложении.";+"FIXES_SLOW_MINIPLAYER" = "Исправить медленный мини-плеер";+"FIXES_SLOW_MINIPLAYER_DESC" = "Исправляет медленное разворачивание видео в мини-плеере; работает только в старых версиях YouTube.";+"DISABLES_NEW_MINIPLAYER" = "Отключить новый мини-плеер";+"DISABLES_NEW_MINIPLAYER_DESC" = "Использовать мини-плеер старого образца вместо нового; работает только в старых версиях YouTube.";+"DISABLES_SNACK_BAR" = "Отключить снекбар";+"DISABLES_SNACK_BAR_DESC" = "Отключает снекбар при нажатии некоторых кнопок и выполнении действий в приложении.";+"HIDE_STARTUP_ANIMATIONS" = "Скрыть стартовые анимации YouTube";+"HIDE_STARTUP_ANIMATIONS_DESC" = "Скрывает стартовые анимации YouTube при открытии приложения.";+"HIDE_LIKE_DISLIKE_VOTES" = "Скрыть сообщения о лайках и дизлайках";+"HIDE_LIKE_DISLIKE_VOTES_DESC" = "Скрывает сообщения, появляющиеся при отметке «Нравится» или «Не нравится» у видео.";+"FLYOUT_MENU" = "Контекстное меню";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION" = "Убрать опцию «Воспроизвести следующим в очереди»";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION_DESC" = "Удаляет опцию «Воспроизвести следующим в очереди» из контекстного меню.";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION" = "Убрать опцию «Воспроизвести последним в очереди»";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION_DESC" = "Удаляет опцию «Воспроизвести последним в очереди» из контекстного меню.";+"REMOVE_DOWNLOAD_OPTION" = "Убрать опцию «Скачать видео»";+"REMOVE_DOWNLOAD_OPTION_DESC" = "Удаляет опцию «Скачать видео» из контекстного меню.";+"REMOVE_WATCH_LATER_OPTION" = "Убрать опцию сохранения в «Смотреть позже»";+"REMOVE_WATCH_LATER_OPTION_DESC" = "Удаляет опцию сохранения в «Смотреть позже» из контекстного меню.";+"REMOVE_SAVE_OPTION" = "Убрать опцию «Сохранить в плейлист»";+"REMOVE_SAVE_OPTION_DESC" = "Удаляет опцию «Сохранить в плейлист» из контекстного меню.";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION" = "Убрать опцию «Удалить из плейлиста»";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION_DESC" = "Удаляет опцию «Удалить из плейлиста» из контекстного меню.";+"REMOVE_SHARE_OPTION" = "Убрать опцию «Поделиться»";+"REMOVE_SHARE_OPTION_DESC" = "Удаляет опцию «Поделиться» из контекстного меню.";+"REMOVE_NOT_INTERESTED_OPTION" = "Убрать опцию «Не интересует»";+"REMOVE_NOT_INTERESTED_OPTION_DESC" = "Удаляет опцию «Не интересует» из контекстного меню.";+"REMOVE_DONT_RECOMMEND_OPTION" = "Убрать опцию «Не рекомендовать канал»";+"REMOVE_DONT_RECOMMEND_OPTION_DESC" = "Удаляет опцию «Не рекомендовать канал» из контекстного меню.";+"REMOVE_INFO_OPTION" = "Убрать опцию «Почему мне показывают это видео?»";+"REMOVE_INFO_OPTION_DESC" = "Удаляет опцию «Почему мне показывают это видео?» из контекстного меню.";+"REMOVE_FILTER_OPTION" = "Убрать опцию «Фильтры поиска»";+"REMOVE_FILTER_OPTION_DESC" = "Удаляет опцию «Фильтры поиска» из контекстного меню.";+"REMOVE_REPORT_OPTION" = "Убрать опцию «Пожаловаться»";+"REMOVE_REPORT_OPTION_DESC" = "Удаляет опцию «Пожаловаться» из контекстного меню.";+"REMOVE_YOUTUBE_MUSIC_OPTION" = "Убрать опцию «Слушать в YouTube Music»";+"REMOVE_YOUTUBE_MUSIC_OPTION_DESC" = "Удаляет опцию «Слушать в YouTube Music» из контекстного меню.";+"REMOVE_FEED_BACK_OPTION" = "Убрать опцию «Отправить отзыв»";+"REMOVE_FEED_BACK_OPTION_DESC" = "Удаляет опцию «Отправить отзыв» из контекстного меню.";+"REMOVE_CAST_OPTION" = "Убрать опцию «Смотреть на ТВ»";+"REMOVE_CAST_OPTION_DESC" = "Удаляет опцию «Смотреть на ТВ» из контекстного меню.";+"REMOVE_SHUFFLE_OPTION" = "Убрать опцию «Перемешать»";+"REMOVE_SHUFFLE_OPTION_DESC" = "Удаляет опцию «Перемешать» из контекстного меню.";+"REMOVE_UN_SUB_OPTION" = "Убрать опцию «Отменить подписку»";+"REMOVE_UN_SUB_OPTION_DESC" = "Удаляет опцию «Отменить подписку» из контекстного меню.";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION" = "Убрать опцию «Скрыть видео из плейлиста»";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION_DESC" = "Удаляет опцию «Скрыть видео из плейлиста» из контекстного меню.";+"REMOVE_HELP_OPTION" = "Убрать опцию «Справка и отзывы»";+"REMOVE_HELP_OPTION_DESC" = "Удаляет опцию «Справка и отзывы» из контекстного меню.";+"REMOVE_NOTIFY_OPTION" = "Убрать опцию «Уведомить меня»";+"REMOVE_NOTIFY_OPTION_DESC" = "Удаляет опцию «Уведомить меня» из контекстного меню.";+"REMOVE_CLEARSCREEN_OPTION" = "Убрать опцию «Очистить экран»";+"REMOVE_CLEARSCREEN_OPTION_DESC" = "Удаляет опцию «Очистить экран» из контекстного меню.";+"HIDE_COMMU_GUIDE" = "Скрыть правила сообщества";+"HIDE_COMMU_GUIDE_DESC" = "Скрывает заголовок правил сообщества.";+"HIDE_ENGAGEMENT_SUBBAR" = "Скрыть шапку комментариев";+"HIDE_ENGAGEMENT_SUBBAR_DESC" = "Скрывает шапку сортировки комментариев (Сначала популярные, Сначала новые), чтобы она никогда не появлялась.";+"DISABLES_RTL" = "Отключить формат RTL";+"DISABLES_RTL_DESC" = "Принудительно отображает текст слева направо (LTR) для языков, которые изначально пишутся справа налево (RTL).";+"DEVICE_UI" = "Стиль интерфейса";+"OPEN_LINK" = "Открыть ссылку";+"FLOATING_KEYBOARD" = "Плавающая клавиатура";+"FLOATING_KEYBOARD_DESC" = "Принудительно включает плавающую клавиатуру. Полезно для iPhone с подменой стиля на iPad.\\nПримечание: работает ТОЛЬКО при выборе стиля iPad.";+"AUTO_OPEN_LINK" = "Автопроверка буфера обмена";+"AUTO_OPEN_LINK_DESC" = "Проверяет буфер обмена на наличие ссылок YouTube при каждом открытии приложения.\\nДля корректной работы зайдите в Настройки iOS → YouTube → «Вставка из других приложений» и выберите «Разрешить»";++"SB_DESCRIPTION" = "Автоматически пропускает спонсорские отрезки, используя данные, отправленные сообществом.";+"SB_ENABLE" = "Включить SponsorBlock";+"SB_ENABLE_DESC" = "Активирует расширение SponsorBlock для пропуска спонсорских отрезков.";+"SB_SHOW_BUTTON" = "Показывать кнопку в оверлее";+"SB_SHOW_BUTTON_DESC" = "Показывает кнопку переключения SponsorBlock в интерфейсе плеера.";+"SB_SHOW_NOTIFICATIONS" = "Показывать уведомления";+"SB_SHOW_NOTIFICATIONS_DESC" = "Показывает уведомления при пропуске отрезков. Уведомления для категорий с ручным пропуском отображаются всегда.";+"SB_HAPTIC_FEEDBACK" = "Тактильный отклик";+"SB_HAPTIC_FEEDBACK_DESC" = "Тактильный отклик при пропуске отрезка.";+"SB_SEGMENTS_IN_PLAYER" = "Отрезки в плеере";+"SB_SEGMENTS_IN_PLAYER_DESC" = "Показывает цветные отрезки на полосе прогресса основного видеоплеера.";+"SB_SEGMENTS_IN_FEED" = "Отрезки в ленте";+"SB_SEGMENTS_IN_FEED_DESC" = "Показывает цветные отрезки на полосе прогресса плееров в ленте.";+"SB_SEGMENTS_IN_MINIPLAYER" = "Отрезки в мини-плеере";+"SB_SEGMENTS_IN_MINIPLAYER_DESC" = "Показывает цветные отрезки на полосе прогресса мини-плеера.";+"SB_SHOW_DURATION" = "Показывать длительность без отрезков";+"SB_SHOW_DURATION_DESC" = "Показывает общую длительность видео без учёта пропускаемых отрезков.";+"SB_CATEGORIES_HEADER" = "Категории отрезков";+"SB_SEGMENT_COLOR" = "Цвет отрезка";++"SB_ACTION_DISABLE" = "Отключить";+"SB_ACTION_AUTO_SKIP" = "Автопропуск";+"SB_ACTION_ASK" = "Спросить перед пропуском";+"SB_ACTION_DISPLAY" = "Показывать только на полосе прогресса";+"SB_ACTION_SKIP_TO" = "Перейти к отрезку";++"SB_CAT_sponsor" = "Спонсор";+"SB_CAT_sponsor_DESC" = "Платная реклама товара или услуги, не связанной напрямую с автором.";+"SB_CAT_intro" = "Интро / Заставка";+"SB_CAT_intro_DESC" = "Перебивка или вступительная заставка в начале видео.";+"SB_CAT_outro" = "Конечные заставки / Титры";+"SB_CAT_outro_DESC" = "Конечные заставки, титры или завершающая часть видео.";+"SB_CAT_interaction" = "Напоминание о подписке";+"SB_CAT_interaction_DESC" = "Просьбы поставить лайк, подписаться или перейти в соцсети.";+"SB_CAT_selfpromo" = "Самореклама";+"SB_CAT_selfpromo_DESC" = "Неоплачиваемая реклама собственных товаров, мерча или других проектов автора.";+"SB_CAT_music_offtopic" = "Немузыкальная часть";+"SB_CAT_music_offtopic_DESC" = "Разговоры или вступления без музыки в клипах.";+"SB_CAT_preview" = "Превью / Краткое содержание";+"SB_CAT_preview_DESC" = "Краткий пересказ предыдущих выпусков или анонс видео.";+"SB_CAT_hook" = "Тизер / Приветствие";+"SB_CAT_hook_DESC" = "Краткий фрагмент-тизер перед видео или приветствие.";+"SB_CAT_poi_highlight" = "Главный момент / Хайлайт";+"SB_CAT_poi_highlight_DESC" = "Ключевой момент видео. Используйте «Перейти», чтобы сразу открыть его.";+"SB_CAT_filler" = "Вода / Отступления";+"SB_CAT_filler_DESC" = "Сцены не по теме, шутки или моменты, не несущие смысловой нагрузки.";++"SB_SKIPPED" = "Отрезок %@ пропущен";+"SB_DETECTED" = "Обнаружен отрезок %@.\\nПропустить его?";+"SB_SKIP_NOW" = "Пропустить";+"SB_UNSKIP" = "Отменить пропуск";+"SB_JUMPED_TO_HIGHLIGHT" = "Переход к главному моменту выполнен";+"SB_JUMP_TO_HIGHLIGHT" = "Доступен главный момент. Перейти к нему?";+"SB_SEGMENT_COLOR_SUFFIX" = "Цвет отрезка";+"SB_SECTION_MAIN" = "Основное";+"SB_SKIP_ALERT_DURATION" = "Длительность уведомления о пропуске";+"SB_UNSKIP_ALERT_DURATION" = "Длительность уведомления об отмене пропуска";+"SB_MIN_DURATION_SLIDER" = "Минимальная длительность отрезка для пропуска";diff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/th.lproj/Localizable.strings b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/th.lproj/Localizable.stringsnew file mode 100644index 0000000..4c0d725--- /dev/null+++ b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/th.lproj/Localizable.strings@@ -0,0 +1,578 @@+"SETTINGS" = "การตั้งค่า";+"INTERFACE" = "ลักษณะ";++"SEARCH" = "ค้นหา";+"SEARCH_DESC" = "ค้นหาการตั้งค่า YouMod";++"URL_COPIED" = "คัดลอกลิงก์วิดีโอแล้ว";+"COPY_URL" = "คัดลอกลิงก์วิดีโอ";+"COPY_URL_TIMESTAMP" = "คัดลอกลิงก์วิดีโอพร้อมเวลา";+"URL_TIMESTAMP_COPIED" = "คัดลอกลิงก์วิดีโอพร้อมเวลาแล้ว";+"CANCEL" = "ยกเลิก";+"ERROR" = "เกิดข้อผิดผลาด";+"ERROR_VIDEOID" = "ไม่พบ ID วิดีโอ";+"ERROR_ADS" = "ไม่สามารถคัดลอกลิงก์วิดีโอขณะกำลังเล่นโฆษณาอยู่ได้";++"LOOP_DISABLED" = "ปิดใช้งานการวนซ้ำแล้ว";+"LOOP_ENABLED" = "เปิดใช้งานการวนซ้ำแล้ว";++"NEW_ISSUES" = "รายงานปัญหาหรือขอฟีเจอร์ใหม่";+"NEW_ISSUES_DESC" = "พบบัคหรืออยากได้ฟีเจอร์ใหม่? แตะที่นี่";+"SOURCE_CODES" = "ซอร์สโค้ด";+"SOURCE_CODES_DESC" = "ลองอ่านโค้ดดูสิ!";++"EXTRA" = "เพิ่มเติม";+"FIX_PLAYBACK_ISSUES" = "แก้ไขปัญหาการเล่นวิดีโอ (ชั่วคราว)";+"FIX_PLAYBACK_ISSUES_DESC" = "แก้ไขปัญหาการเล่นวิดีโอสำหรับผู้ใช้บางราย เมื่อเปิดใช้งานตัวเลือกนี้เครื่องเล่นจะรีโหลดอัตโนมัติเมื่อเกิดข้อผิดพลาดในการเล่นวิดีโอ";++"PERFER_HEADER" = "การตั้งค่า YouMod";+"PERFER" = "การตั้งค่า";+"IMPORT" = "นำเข้าการตั้งค่า";+"IMPORT_DESC" = "โหลดการตั้งค่าจากไฟล์ .plist";+"IMPORT_DONE" = "สำเร็จ";+"YES" = "ใช่";+"APPLY_DESC" = "จำเป็นต้องรีสตาร์ทแอป รีสตาร์ทแอปตอนนี้เลยหรือไม่?";+"EXPORT" = "ส่งออกการตั้งค่า";+"EXPORT_DESC" = "ส่งออกการตั้งค่าไปยังไฟล์ .plist";+"RESTORE" = "คืนค่าการตั้งค่า";+"RESTORE_DESC" = "โหลดการตั้งค่าค่าเริ่มต้นเหมือนติดตั้งใหม่";+"WARNING" = "คำเตือน";+"RESETDEFAULT" = "การกระทำนี้จะรีเซ็ตการตั้งค่าทั้งหมด ดำเนินการต่อหรือไม่?";+"ERROR_INVALID_FILE" = "ไฟล์ไม่ถูกต้อง";+"ERROR_NO_KEYS_IMPORT" = "ไม่มีคีย์สำหรับนำเข้า";+"ERROR_NO_KEYS_EXPORT" = "ไม่มีคีย์สำหรับส่งออก";+"OVERRIDE" = "การกระทำนี้จะเขียนทับการตั้งค่าปัจจุบัน ดำเนินการต่อหรือไม่?";+"DISABLED" = "ปิดใช้งาน";++"CACHE" = "การจัดการแคช";+"CLEARCACHE" = "ล้างแคช";+"DONE" = "เสร็จสิ้น";+"AUTO_CLEARCACHE" = "ล้างแคชอัตโนมัติ";+"AUTO_CLEARCACHE_DESC" = "ล้างแคชของแอปอัตโนมัติตอนเปิดแอป";++"DOWNLOADING" = "การดาวน์โหลด";+"DOWNLOAD_MANAGER" = "ตัวจัดการดาวน์โหลด";+"DOWNLOAD_MANAGER_DESC" = "แทนที่ตัวดาวน์โหลดวิดีโอของ YouTube ด้วยของ YouMod รองรับการดาวน์โหลดวิดีโอ เสียง คำบรรยาย และปกคลิป";+"POST_DOWNLOAD_ACTION" = "การกระทำหลังดาวน์โหลด";+"POST_ACTION_SAVE_PHOTOS" = "บันทึกลงคลังรูปภาพ";+"POST_ACTION_SHARE" = "แชร์";+"POST_ACTION_ASK" = "ถาม";+"ADD_SHORTS_DOWNLOAD" = "เพิ่มปุ่มดาวน์โหลดไปยัง Shorts";+"ADD_SHORTS_DOWNLOAD_DESC" = "เพิ่มปุ่มดาวน์โหลดไปยังโอเวอร์เลย์วิดีโอ Shorts";+"DOWNLOAD_SHORTS" = "ดาวน์โหลด Shorts";+"COPY_VID_INFO" = "คัดลอกข้อมูลวิดีโอ";+"COPY_TITLE" = "คัดลอกชื่อวิดีโอ";+"COPY_DESCRIPTION" = "คัดลอกคำอธิบายวิดีโอ";+"COPY_ALL_VID_INFO" = "คัดลอกทั้งหมด";+"COPIED_TITLE" = "คัดลอกชื่อวิดีโอแล้ว";+"COPIED_DESCRIPTION" = "คัดลอกคำอธิบายวิดีโอแล้ว";+"COPY_AUTHOR" = "คัดลอกชื่อช่อง";+"COPIED_AUTHOR" = "คัดลอกชื่อช่องวิดีโอแล้ว";+"SAVE_THUMBNAIL" = "บันทึกปกคลิป";+"DOWNLOAD_CAPTIONS" = "ดาวน์โหลดคำบรรยาย";+"DOWNLOAD_AUDIO" = "ดาวน์โหลดเสียง";+"DOWNLOAD_VIDEO" = "ดาวน์โหลดวิดีโอ";+"OPEN_VID_BEFORE" = "กรุณาเปิดวิดีโอก่อนใช้ตัวจัดการดาวน์โหลด";+"NO_CAPTIONS_URL" = "ไม่พบ URL ของคำบรรยายที่ถูกต้อง";+"NO_AUDIO_URL" = "ไม่พบ URL ของเสียง";+"NO_STREAM_URL" = "ไม่พบ URL ของสตรีม";+"CAPTIONS_FAILED" = "ดาวน์โหลดคำบรรยายไม่สำเร็จ";+"NO_CAPTIONS" = "ไม่มีคำบรรยายสำหรับวิดีโอนี้";+"NO_AUDIO_STREAM_FOUND" = "ไม่พบสตรีมเสียง";+"NO_VID_AUDIO_STREAM_FOUND" = "ไม่พบสตรีมวิดีโอ/เสียง";+"COPIED_VID_INFO" = "คัดลอกข้อมูลวิดีโอทั้งหมดแล้ว";+"SAVED_TO_PHOTOS" = "บันทึกลงในแอปรูปภาพแล้ว";+"SAVE_FAILED" = "บันทึกไม่สำเร็จ";+"PHOTO_ACCESS_DENINED" = "การเข้าถึงแอปรูปภาพถูกปฏิเสธ";+"THUMBNAIL_FAILED" = "บันทึกปกคลิปไม่สำเร็จ";+"DOWNLOADING_THUMBNAIL" = "กำลังดาวน์โหลดปกคลิป...";+"DOWNLOADING_AUDIO" = "กำลังดาวน์โหลดเสียง...";+"DOWNLOADING_VIDEO" = "กำลังดาวน์โหลดวิดีโอ...";+"DOWNLOADING_CAPTIONS" = "กำลังดาวน์โหลดคำบรรยาย...";+"NO_THUMBNAIL_FOUND" = "ไม่พบปกคลิป";+"DOWNLOAD_FAILED" = "ดาวน์โหลดไม่สำเร็จ";+"AUDIO_SAVED" = "บันทึกเสียงเรียบร้อยแล้ว";+"DOWNLOAD_COMPLETED" = "ดาวน์โหลดเสร็จสมบูรณ์";+"CANNOT_SAVE_TO_PHOTOS" = "ไม่สามารถบันทึกลงในแอปรูปภาพได้";+"FINA_VIDEO" = "กำลังจัดเตรียมวิดีโอ...";+"MERGING_VID_FALLBACK" = "กำลังรวมไฟล์วิดีโอ (โหมดสำรอง)...";+"MERGING_VID" = "กำลังรวมไฟล์วิดีโอ...";+"CONVERTING" = "กำลังแปลงเป็น";+"ALREADY_DOWNLOADING" = "กำลังดาวน์โหลดอยู่แล้ว";+"DOWNLOAD_CANCELLED" = "ยกเลิกการดาวน์โหลดแล้ว";+"TRIMMING_AUDIO" = "กำลังตัดต่อเสียง...";+"SHOW_THUMBNAIL" = "ดูปกคลิป";+"COPY_THUMBNAIL" = "คัดลอกปกคลิป";+"THUMBNAIL_OPTIONS" = "ดาวน์โหลดปกคลิป";+"COPY" = "คัดลอก";+"COPIED_TO_CLIPBOARD" = "คัดลอกไปยังคลิปบอร์ดแล้ว";+"CONNECTING_TO_SERVER" = "กำลังเชื่อมต่อกับเซิร์ฟเวอร์...";+"DOWNLOADING_TO_SERVER" = "กำลังดาวน์โหลดไปยังเซิร์ฟเวอร์...";+"COPY_COMMENT_TEXT" = "คัดลอกข้อความคอมเมนต์";+"SAVE_COMMENT_IMAGE" = "บันทึกคอมเมนต์เป็นรูปภาพ";+"COPY_COMMENT_IMAGE" = "คัดลอกคอมเมนต์เป็นรูปภาพ";+"COPY_POST_TEXT" = "คัดลอกข้อความโพสต์";+"SAVE_POST_IMAGE" = "บันทึกโพสต์เป็นรูปภาพ";+"COPY_POST_IMAGE" = "คัดลอกโพสต์เป็นรูปภาพ";+"DOWNLOAD_SERVER" = "เซิร์ฟเวอร์ดาวน์โหลด";+"CHOOSE_DOWNLOAD_SERVER" = "เลือกเซิร์ฟเวอร์ดาวน์โหลด";+"DOWNLOAD_COMMENT" = "บันทึกข้อมูลคอมเมนต์";+"DOWNLOAD_COMMENT_DESC" = "อนุญาตให้คัดลอกข้อความคอมเมนต์และบันทึกคอมเมนต์เป็นรูปภาพโดยการแตะปุ่มสามจุดค้างไว้";+"DOWNLOAD_POST" = "บันทึกข้อมูลโพสต์";+"DOWNLOAD_POST_DESC" = "อนุญาตให้คัดลอกข้อความโพสต์และบันทึกโพสต์เป็นรูปภาพโดยการแตะค้างไว้";+"TRANSLATE_COMMENT" = "แปลคอมเมนต์";+"TRANSLATE_POST" = "แปลโพสต์";+"SERVER_EUROPRE1" = "ยุโรป";+"SERVER_ASIA1" = "ไทย - เอเชีย";+"SHOW_OPTIONS" = "แสดงตัวเลือก";+"ENGLISH" = "อังกฤษ";+"TRANSLATION" = "แปลภาษา";+"LANGUAGE" = "ภาษา";+"TRANSLATING" = "กำลังแปล...";+"SELECT_LANG" = "เลือกภาษา";+"TRANSLATE_FAILED" = "แปลไม่สำเร็จ กรุณาลองใหม่อีกครั้ง";+"SAVE_CURRENT_IMAGE" = "บันทึกรูปปัจจุบัน";+"COPY_CURRENT_IMAGE" = "คัดลอกรูปปัจจุบัน";+"DOWNLOAD_METHOD" = "วิธีดาวน์โหลด";+"DOWNLOAD_METHOD_DESC" = "วิธีการดาวน์โหลดวิดีโอ แบบอุปกรณ์จะใช้งานได้กับ YouTube เวอร์ชันล่าสุด";+"METHOD_DIRECT" = "โดยตรง";+"METHOD_SERVER" = "ผ่านเซิร์ฟเวอร์";+"METHOD_ONDEVICE" = "บนอุปกรณ์ (SABR)";++"APPEARANCE" = "ลักษณะ";+"OLED_THEME" = "ธีม OLED";+"OLED_THEME_DESC" = "ใช้สีดำสนิท (OLED) ในโหมดมืดของแอป";+"OLED_KEYBOARD" = "คีย์บอร์ด OLED";+"OLED_KEYBOARD_DESC" = "ใช้สีดำสนิท (OLED) กับคีย์บอร์ดในโหมดมืด";++"NAVBAR" = "แถบนำทาง";+"STICKY_NAVBAR" = "ยึดแถบนำทาง";+"STICKY_NAVBAR_DESC" = "ล็อกแถบนำทางให้คงเห็นอยู่เมื่อเลื่อนลง";+"NAVIGATION_ICON" = "ไอคอนแถบนำทาง";+"NAVIGATION_ICON_DESC" = "เปลี่ยนโลโก้ YouTube ในแถบนำทาง";+"PREMIUM" = "พรีเมียม";+"REMOVE_YTLOGO" = "ลบโลโก้";+"YOUTUBE" = "YouTube";+"HIDE_NOTIFICATION_BUTTON" = "ซ่อนปุ่มแจ้งเตือน";+"HIDE_NOTIFICATION_BUTTON_DESC" = "ซ่อนปุ่มแจ้งเตือนในแถบนำทาง";+"HIDE_SEARCH_BUTTON" = "ซ่อนปุ่มค้นหา";+"HIDE_SEARCH_BUTTON_DESC" = "ซ่อนปุ่มค้นหาในแถบนำทาง";+"HIDE_VOICE_SEARCH_BUTTON" = "ซ่อนปุ่มค้นหาด้วยเสียง";+"HIDE_VOICE_SEARCH_BUTTON_DESC" = "ซ่อนปุ่มค้นหาด้วยเสียงในแถบนำทาง";+"HIDE_CAST_BUTTON_NAVBAR" = "ซ่อนปุ่มแคสต์";+"HIDE_CAST_BUTTON_NAVBAR_DESC" = "ซ่อนปุ่มแคสต์ในแถบนำทาง";++"FEED" = "ฟีด";+"HIDE_SUBBAR" = "ซ่อนแถบหมวดหมู่";+"HIDE_SUBBAR_DESC" = "ซ่อนแถบหมวดหมู่ในฟีด";+"HIDE_HORI_SHELF" = "ซ่อนฟีดแนวนอน";+"HIDE_HORI_SHELF_DESC" = "ลบฟีดแนวนอนทั้งหมด (เช่น ข่าวสาร, รับชมต่อ, โพสต์ ฯลฯ) ออกจากหน้าฟีด ยกเว้นเกม";+"HIDE_MUSIC_PLAYLISTS" = "ซ่อนเพลย์ลิสต์เพลง";+"HIDE_MUSIC_PLAYLISTS_DESC" = "ซ่อนตัวสร้างเพลย์ลิสต์ในฟีด";+"HIDE_FEED_POST" = "ซ่อนโพส";+"HIDE_FEED_POST_DESC" = "ซ่อนโพสในฟีด";+"HIDE_SURVEYS" = "ซ่อนแบบสำรวจ";+"HIDE_SURVEYS_DESC" = "ซ่อนแบบสำรวจวิดีโอที่ YouTube แสดงในบางครั้ง";+"HIDE_SHORTS_SHELF" = "ซ่อน Shorts";+"HIDE_SHORTS_SHELF_DESC" = "ซ่อน Shorts ในฟีด";+"KEEP_SHORTS_SUBSCRIPT" = "แสดง Shorts ในหน้าการติดตาม";+"KEEP_SHORTS_SUBSCRIPT_DESC" = "ป้องกันไม่ให้วิดีโอ Shorts ถูกลบออกจากแท็บการติดตาม";+"HIDE_SEARCH_HISTORY" = "ซ่อนประวัติการค้นหา";+"HIDE_SEARCH_HISTORY_DESC" = "ซ่อนประวัติและคำแนะนำการค้นหา\\nหมายเหตุ: ประวัติการค้นหายังสามารถเข้าถึงได้ในอุปกรณ์อื่น";+"REMOVE_CHANNEL_COMMUNITY_BUTTON" = "ลบปุ่มชุมชน";+"REMOVE_CHANNEL_COMMUNITY_BUTTON_DESC" = "ลบปุ่มชุมชนในแถบส่วนหัวของช่อง";+"REMOVE_CHANNEL_SPONSOR_BUTTON" = "ลบปุ่มสมัครสมาชิกช่อง";+"REMOVE_CHANNEL_SPONSOR_BUTTON_DESC" = "ลบปุ่มสนับสนุน / สมัครสมาชิกช่องในฟีด หน้าช่อง และ Shorts";+"HIDE_PLAYABLES" = "ซ่อนมินิเกม";+"HIDE_PLAYABLES_DESC" = "ซ่อนมินิเกมออกจากหน้าฟีด";+"HIDE_RELATED_VIDEOS" = "ซ่อนวิดีโอที่เกี่ยวข้อง";+"HIDE_RELATED_VIDEOS_DESC" = "ซ่อนวิดีโอที่เกี่ยวข้องใต้เครื่องเล่น (ไม่ใช่ในโอเวอร์เลย์)";++"PLAYER" = "เครื่องเล่น";+"PLAYBACK_SPEED" = "ความเร็ววิดีโอ";+"CONTROL_CENTER" = "ศูนย์ควบคุม";+"PLAYER_ACTIONS" = "การกระทำเครื่องเล่น";+"GESTURE_HEADER" = "ท่าทาง";+"QUALITY_WIFI" = "คุณภาพวิดีโอเมื่อเล่นบน WiFi";+"QUALITY_WIFI_DESC" = "เลือกคุณภาพวิดีโออัตโนมัติจากตัวเลือกเมื่อเล่นบน Wi-Fi";+"QUALITY_CELLULAR" = "คุณภาพวิดีโอเมื่อเล่นบนเซลลูลาร์";+"QUALITY_CELLULAR_DESC" = "เลือกคุณภาพวิดีโออัตโนมัติจากตัวเลือกเมื่อเล่นบนเซลลูลาร์";+"QUALITY_LOW_POWER" = "คุณภาพวิดีโอในโหมดประหยังพลังงาน";+"QUALITY_LOW_POWER_DESC" = "เลือกคุณภาพวิดีโออัตโนมัติจากตัวเลือกเมื่อเปิดโหลดประหยัดพลังงานในอุปกรณ์";+"DEFAULT" = "ค่าเริ่มต้น";+"BEST" = "ดีที่สุด";+"AUDIO_TRACK" = "แทร็กเสียงที่ต้องการ";+"ORIGINAL" = "ต้นฉบับ";+"SELECT_MANUALLY" = "เลือกเอง";+"AUDIO_TRACK_SELECT" = "แทร็กเสียงที่เลือก";+"AUDIO_TRACK_SELECT_DESC" = "เลือกแทร็กเสียงที่ต้องการโดยอัตโนมัติ ถ้ามี";+"NO_AUTO_DUBBED" = "ใช้เสียงต้นฉบับ";+"NO_AUTO_DUBBED_DESC" = "ใช้เสียงต้นฉบับถ้าไม่พบภาษาที่ต้องการหรือเป็นเสียงแบบพากย์อัตโนมัติ";+"CAPTION_TRACK" = "คำบรรยายที่ต้องการ";+"CAPTION_TRACK_SELECT" = "คำบรรยายที่เลือก";+"CAPTION_TRACK_SELECT_DESC" = "เลือกภาษาของคำบรรยายที่ต้องการให้แสดง ถ้ามี";+"DISABLES_CAPTION_TRACK" = "ปิดใช้งานคำบรรยายอัตโนมัติ";+"DISABLES_CAPTION_TRACK_DESC" = "ปิดใช้งานคำบรรยายอัตโนมัติถ้าภาษาที่เลือกเป็นแบบสร้างโดยอัตโนมัติหรือไม่พบ";+"DEFAULT_SPEED" = "ความเร็วเริ่มต้น";+"DEFAULT_SPEED_DESC" = "ตั้งค่าความเร็วเริ่มต้นเมื่อเปิดวิดีโอใหม่";+"QUALITY_BUTTON" = "ควบคุมคุณภาพวิดีโอ";+"SPEED_BUTTON" = "ควบคุมความเร็ววิดีโอ";+"MUTE_BUTTON" = "ปิดเสียง";+"SHARE_BUTTON" = "แชร์";+"LOOP_BUTTON" = "วนซ้ำวิดีโอ";+"CAPTION_BUTTON" = "คำบรรยาย";+"DOWNLOAD_BUTTON" = "ดาวน์โหลด";+"SPONSORBLOCK_BUTTON" = "SponsorBlock";+"MANAGE_OVERLAY_BUTTONS" = "จัดการปุ่มบนโอเวอร์เลย์";+"MANAGE_OVERLAY_BUTTONS_DESC" = "จัดเรียงและเปิด/ปิดใช้งานปุ่มบนโอเวอร์เลย์";+"OVERLAY_BUTTON_REORDER_HINT" = "ลากเพื่อจัดเรียงปุ่มบนโอเวอร์เลย์ เปิด/ปิดเพื่อแสดงหรือซ่อนปุ่ม";+"HOLD_TO_SPEED" = "ความเร็วเมื่อกดค้าง";+"HOLD_TO_SPEED_DESC" = "ใช้ความเร็วในการเล่นวิดีโอแบบกำหนดเองเมื่อกดค้างที่หน้าจอ";+"HIDE_AUTOPLAY" = "ซ่อนสวิตซ์เล่นอัตโนมัติ";+"HIDE_AUTOPLAY_DESC" = "ซ่อนสวิตซ์เล่นอัตโนมัติในโอเวอร์เลย์วิดีโอ";+"HIDE_CAPTIONS_BUTTON" = "ซ่อนปุ่มคำบรรยาย";+"HIDE_CAPTIONS_BUTTON_DESC" = "ซ่อนปุ่มคำบรรยายในโอเวอร์เลย์วิดีโอ";+"HIDE_CAST_BUTTON_PLAYER" = "ซ่อนปุ่มแคสต์";+"HIDE_CAST_BUTTON_PLAYER_DESC" = "ซ่อนปุ่มแคสต์ในโอเวอร์เลย์วิดีโอ";+"HIDE_NEXT_AND_PREV_BUTTON" = "ซ่อนปุ่มก่อนหน้าและปุ่มถัดไป";+"HIDE_NEXT_AND_PREV_BUTTON_DESC" = "ซ่อนปุ่มก่อนหน้าและปุ่มถัดไปในโอเวอร์เลย์วิดีโอ";+"REPLACE_PREVNEXT_BUTTONS" = "เปลี่ยนปุ่มก่อนหน้า/ถัดไป";+"REPLACE_PREVNEXT_BUTTONS_DESC" = "เปลี่ยนปุ่มเล่นวิดีโอก่อนหน้าและถัดไปในเครื่องเล่น เป็นปุ่มกรอกลับและปุ่มข้ามไปข้างหน้าแทน";+"REMOVE_DARK_OVERLAY" = "ลบโอเวอร์เลย์มืด";+"REMOVE_DARK_OVERLAY_DESC" = "ลบโอเวอร์เลย์มืดจากโอเวอร์เลย์วิดีโอ";+"HIDE_END_SCREEN" = "ซ่อนการ์ดท้าย";+"HIDE_END_SCREEN_DESC" = "ซ่อนการ์ดท้ายในโอเวอร์เลย์วิดีโอ";+"REMOVE_AMBIANT" = "ปิดโหมดแอมเบียนท์";+"REMOVE_AMBIANT_DESC" = "ลบเอฟเฟกต์เรืองแสงที่อยู่ด้านหลังเครื่องเล่นวิดีโอ";+"HIDE_SUGGESTED_VIDEO" = "ซ่อนวิดีโอแนะนำ";+"HIDE_SUGGESTED_VIDEO_DESC" = "ซ่อนตารางวิดีโอแนะนำที่ปรากฏขึ้นหลังจากวิดีโอเล่นจบ";+"HIDE_PAID_OVERLAY" = "ซ่อน 'มีโฆษณาจากสปอนเซอร์'";+"HIDE_PAID_OVERLAY_DESC" = "ซ่อนกล่องข้อความ 'มีโฆษณาจากสปอนเซอร์' ในโอเวอร์เลย์วิดีโอ";+"HIDE_WATERMARK" = "ซ่อนลายน้ำ";+"HIDE_WATERMARK_DESC" = "ซ่อนลายน้ำช่องในโอเวอร์เลย์วิดีโอ";+"PAUSE_ON_OVERLAY" = "หยุดวิดีโอบนโอเวอร์เลย์";+"PAUSE_ON_OVERLAY_DESC" = "หยุดวิดีโอเมื่อเห็นโอเวอร์เลย์";+"DISABLES_SNAP_TO_CHAPTER" = "ปิดใช้งานการเลื่อนไปยังตอนถัดไป";+"DISABLES_SNAP_TO_CHAPTER_DESC" = "ปิดใช้งานการแตะสองครั้งเพื่อข้ามไปยังตอนถัดไป";+"DISABLES_ENGAGE_PANEL" = "ปิดใช้งานแผงควบคุมในโหมดเต็มจอ";+"DISABLES_ENGAGE_PANEL_DESC" = "ป้องกันไม่ให้แผงควบคุมแสดงขึ้นมาในโหมดเต็มหน้าจอ";+"GESTURES" = "เปิดใช้งานการควบคุมด้วยท่าทาง";+"GESTURES_DESC" = "ปัดขึ้นหรือลงบริเวณขอบซ้ายหรือขวาของหน้าจอวิดีโอ เพื่อปรับความสว่าง ระดับเสียง หรือความเร็ววิดีโอ";+"GESTURE_AREA" = "พื้นที่เปิดใช้งานท่าทาง";+"GESTURE_AREA_DESC" = "ปรับพื้นที่บริเวณหน้าจอสำหรับเปิดใช้งานท่าทาง (ตั้งค่าเป็น 50% จะแบ่งหน้าจอเป็นสองฝั่งโดยไม่มีพื้นที่ว่างตรงกลาง)";+"LEFT_SIDE_GESTURE" = "ท่าทางการปัดฝั่งซ้าย";+"RIGHT_SIDE_GESTURE" = "ท่าทางการปัดฝั่งขวา";+"GESTURE_BRIGHTNESS" = "ความสว่าง";+"GESTURE_VOLUME" = "ระดับเสียง";+"GESTURE_SPEED" = "ความเร็ววิดีโอ";+"GESTURE_NONE" = "ไม่มี";+"GESTURE_HUD" = "แสดง HUD ท่าทาง";+"GESTURE_HUD_DESC" = "แสดงเปอร์เซ็นต์ (%) ปัจจุบันบนหน้าจอเมื่อปรับความสว่าง ระดับเสียง หรือความเร็ววิดีโอ";+"GESTURE_HUD_SIZE" = "ขนาดของ HUD ท่าทาง";+"GESTURE_HUD_SIZE_DESC" = "ปรับขนาดข้อความและไอคอนของ HUD ท่าทาง";+"SMALL" = "เล็ก (-1)";+"NORMAL" = "ปกติ (ค่าเริ่มต้น)";+"LARGE" = "ใหญ่ (+1)";+"EXTRALARGE" = "ใหญ่พิเศษ (+2)";+"MAX" = "สูงสุด (+3)";+"GESTURE_HUD_POSITION" = "ตำแหน่งของ HUD ท่าทาง";+"GESTURE_HUD_POSITION_DESC" = "ตั้งค่าตำแหน่งแนวตั้งของ HUD ท่าทาง (บน, กลาง, ล่าง)";+"TOP" = "ด้านบน";+"MIDDLE" = "ตรงกลาง";+"BOTTOM" = "ด้านล่าง";+"DISABLES_DOUBLE_TAP" = "ปิดใช้งานการแตะสองครั้ง";+"DISABLES_DOUBLE_TAP_DESC" = "ปิดการแตะสองครั้งในโอเวอร์เลย์วิดีโอ";+"DISABLES_LONG_HOLD" = "ปิดใช้งานการกดค้าง";+"DISABLES_LONG_HOLD_DESC" = "ปิดการเร่งความเร็วโดยการกดค้างในโอเวอร์เลย์วิดีโอ";+"AUTO_EXIT_FULLSCREEN" = "ออกจากเต็มจออัตโนมัติ";+"AUTO_EXIT_FULLSCREEN_DESC" = "ออกจากเต็มจออัตโนมัติเมื่อวิดีโอจบ";+"AUTO_FEED_MUTE" = "ปิดเสียงวิดีโอในฟีด";+"AUTO_FEED_MUTE_DESC" = "ปิดเสียงวิดีโอบนหน้าฟีดโดยอัตโนมัติ";+"DISABLES_SHOW_REMAINING" = "ซ่อนเวลาที่เหลือ";+"DISABLES_SHOW_REMAINING_DESC" = "ซ่อนเวลาที่เหลือในโอเวอร์เลย์วิดีโอ";+"ALWAYS_SHOW_REMAINING" = "แสดงเวลาที่เหลือเสมอ";+"ALWAYS_SHOW_REMAINING_DESC" = "แสดงเวลาที่เหลือเสมอในโอเวอร์เลย์วิดีโอ";+"COPY_TIMESTAMP_ON_PAUSE" = "คัดลอกลิงก์วิดีโอพร้อมเวลา";+"COPY_TIMESTAMP_ON_PAUSE_DESC" = "อนุญาตให้คัดลอกลิงก์วิดีโอพร้อมเวลาปัจจุบันไปยังคลิปบอร์ดเมื่อกดปุ่มหยุดเล่น";+"SHOW_REMAINING_EXTRA" = "แสดงเวลาที่เหลือ";+"SHOW_REMAINING_EXTRA_DESC" = "เพิ่มเวลาที่จะเล่นจบจริงในเวลาของวิดีโอ";+"HIDE_FULLSCREEN_ACTIONS" = "ซ่อนปุ่มในโหมดเต็มหน้าจอ";+"HIDE_FULLSCREEN_ACTIONS_DESC" = "ซ่อนปุ่มต่างๆ ด้านล่างในโหมดเต็มหน้าจอ";+"HIDE_FULL_VID_TITLE" = "ซ่อนชื่อวิดีโอ";+"HIDE_FULL_VID_TITLE_DESC" = "ซ่อนชื่อวิดีโอในโหมดเต็มหน้าจอ";+"STOP_AUTOPLAY_VIDEO" = "ปิดใช้งานเล่นวิดีโออัตโนมัติ";+"STOP_AUTOPLAY_VIDEO_DESC" = "ปิดใช้งานเล่นวิดีโออัตโนมัติเมื่อเปิดวิดีโอ";+"HIDE_CONTENT_WARNING" = "ข้ามคำเตือนเนื้อหา";+"HIDE_CONTENT_WARNING_DESC" = "ข้ามคำเตือนเนื้อหาอัตโนมัติในบางวิดีโอ";+"AUTO_FULLSCREEN" = "เต็มหน้าจออัตโนมัติ";+"AUTO_FULLSCREEN_DESC" = "เข้าสู่โหมดเต็มหน้าจอโดยอัตโนมัติ";+"PORTRAIT_FULLSCREEN" = "โหมดเต็มหน้าจอในแนวตั้ง";+"PORTRAIT_FULLSCREEN_DESC" = "เปิดใช้งานโหมดเต็มหน้าจอในแนวตั้ง";+"OLD_QUALITY_PICKER" = "ใช้ตัวเลือกคุณภาพแบบเก่า";+"OLD_QUALITY_PICKER_DESC" = "ใช้ตัวเลือกคุณภาพแบบเก่าเพื่อลิสต์คุณภาพวิดีโอได้เร็วขึ้น";+"EXTRA_SPEED" = "เพิ่มตัวเลือกความเร็ววิดีโอ";+"EXTRA_SPEED_DESC" = "เพิ่มตัวเลือกความเร็ววิดีโอถึง 10x";+"FORCE_MINIPLAYER" = "บังคับใช้เครื่องเล่นขนาดเล็ก";+"FORCE_MINIPLAYER_DESC" = "อนุญาตให้เล่นวิดีโอทุกประเภทในเครื่องเล่นขนาดเล็ก รวมถึงวิดีโอสำหรับเด็ก";+"FORCE_SEEKBAR" = "แสดงแถบสถานะการเล่นตลอดเวลา";+"FORCE_SEEKBAR_DESC" = "ทำให้แถบความคืบหน้าแสดงขึ้นตลอดเวลาในขณะที่เล่นวิดีโอแบบเต็มหน้าจอ";+"TAP_TO_SEEK" = "แตะเพื่อกรอ";+"TAP_TO_SEEK_DESC" = "กรอไปยังส่วนต่างๆของวิดีโออย่างรวดเร็วโดยแตะที่แถบคืบหน้า";+"DISABLES_ZOOM" = "ปิดใช้งานการซูมวิดีโอ";+"DISABLES_ZOOM_DESC" = "ปิดใช้งานการซูมวิดีโอแบบอิสระ";+"USES_24_HOURS_TIME" = "รูปแบบเวลา 24 ชั่วโมง";+"USES_24_HOURS_TIME_DESC" = "แสดงเวลาจบวิดีโอแบบ 24 ชั่วโมง";+"PAUSE_TWO_FINGERS" = "หยุดวิดีโอโดยใช้ 2 นิ้ว";+"PAUSE_TWO_FINGERS_DESC" = "หยุด/เล่น วิดีโอโดยใช้ 2 นิ้วแตะหน้าจอ";+"SKIP_BACKWARD" = "ย้อนกลับ";+"SKIP_BACKWARD_DESC" = "เปลี่ยนปุ่มเล่นเพลงก่อนหน้าในศูนย์ควบคุมให้เป็นปุ่มข้ามย้อนกลับตามจำนวนวินาทีที่กำหนด";+"SKIP_FORWARD" = "ไปข้างหน้า";+"SKIP_FORWARD_DESC" = "เปลี่ยนปุ่มเล่นเพลงถัดไปในศูนย์ควบคุมให้เป็นปุ่มข้ามไปข้างหน้าตามจำนวนวินาทีที่กำหนด";+"REWIND_SECONDS" = "จำนวนวินาทีที่ย้อนกลับ";+"FORWARD_SECONDS" = "จำนวนวินาทีที่ไปข้างหน้า";+"HIDE_COMMENTS_SECTION" = "ซ่อนกล่องคอมเมนต์";+"HIDE_COMMENTS_SECTION_DESC" = "ซ่อนกล่องคอมเมนต์ทั้งหมด";+"HIDE_COMMENTS_PREVIEW" = "ซ่อนตัวอย่างคอมเมนต์";+"HIDE_COMMENTS_PREVIEW_DESC" = "ซ่อนตัวอย่างคอมเมนต์ยอดนิยม แต่ยังคงสามารถกดเปิดดูคอมเมนต์ทั้งหมดได้";+"LOCK_SPEED" = "ล็อคความเร็ว";+"LOCK_SPEED_DESC" = "ล็อคตามความเร็วที่เลือกไว้โดยการเลื่อนลง";+"SEEK_ON_OVERLAY" = "กรอวิดีโอบนโอเวอร์เลย์";+"SEEK_ON_OVERLAY_DESC" = "อนุญาตให้ควบคุมการกรอวิดีโอเดินหน้า-ถอยหลัง โดยการปัดไปทางซ้ายและขวาบนโอเวอร์เลย์วิดีโอ";+"DRC_AUDIO_OPTIONS" = "เปิด/ปิดระดับเสียงคงที่อัตโนมัติ";+"DRC_AUDIO_OPTIONS_DESC" = "ตั้งค่าเลือกเปิดหรือปิดระบบระดับเสียงคงที่โดยอัตโนมัติ";+"REMOVE_VIDEO_LIKE_BUTTON" = "ลบปุ่มถูกใจ";+"REMOVE_VIDEO_LIKE_BUTTON_DESC" = "ลบปุ่มถูกใจที่อยู่ใต้วิดีโอและในโอเวอร์เลย์เต็มจอ";+"REMOVE_VIDEO_DISLIKE_BUTTON" = "ลบปุ่มไม่ชอบ";+"REMOVE_VIDEO_DISLIKE_BUTTON_DESC" = "ลบปุ่มไม่ชอบที่อยู่ใต้วิดีโอและในโอเวอร์เลย์เต็มจอ";+"REMOVE_VIDEO_SHARE_BUTTON" = "ลบปุ่มแชร์";+"REMOVE_VIDEO_SHARE_BUTTON_DESC" = "ลบปุ่มแชร์ที่อยู่ใต้วิดีโอและในโอเวอร์เลย์เต็มจอ";+"REMOVE_VIDEO_SAVE_BUTTON" = "ลบปุ่มบันทึก";+"REMOVE_VIDEO_SAVE_BUTTON_DESC" = "ลบปุ่มบันทึกลงในเพลย์ลิสต์ที่อยู่ใต้วิดีโอและในโอเวอร์เลย์เต็มจอ";+"REMOVE_VIDEO_DOWNLOAD_BUTTON" = "ลบปุ่มดาวน์โหลด";+"REMOVE_VIDEO_DOWNLOAD_BUTTON_DESC" = "ลบปุ่มดาวน์โหลดที่อยู่ใต้วิดีโอและในโอเวอร์เลย์เต็มจอ";+"REMOVE_VIDEO_CLIP_BUTTON" = "ลบปุ่มคลิป";+"REMOVE_VIDEO_CLIP_BUTTON_DESC" = "ลบปุ่มสร้างคลิปที่อยู่ใต้วิดีโอและในโอเวอร์เลย์เต็มจอ";+"REMOVE_VIDEO_REMIX_BUTTON" = "ลบปุ่มรีมิกซ์";+"REMOVE_VIDEO_REMIX_BUTTON_DESC" = "ลบปุ่มรีมิกซ์ที่อยู่ใต้วิดีโอและในโอเวอร์เลย์เต็มจอ";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON" = "ลบปุ่มแชทสด";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON_DESC" = "ลบปุ่มแชทสดที่อยู่ใต้วิดีโอและในโอเวอร์เลย์เต็มจอ";++"SHORTS" = "Shorts";+"HIDE_SHORTS_TOPBAR" = "ซ่อนแถบด้านบน";+"HIDE_SHORTS_TOPBAR_DESC" = "ซ่อนแถบด้านบนทั้งหมดในเครื่องเล่นวิดีโอ";+"HIDE_SHORTS_SUBBAR" = "ซ่อนแถบย่อย";+"HIDE_SHORTS_SUBBAR_DESC" = "ซ่อนแถบประเภท Shorts ในเครื่องเล่นวิดีโอ";+"SHORTS_ONLY" = "โหมด Shorts เท่านั้น";+"SHORTS_ONLY_DESC" = "จำกัดหน้าฟีดให้แสดงเฉพาะ Shorts เท่านั้น คุณสามารถปิดใช้งานโหมด Shorts เท่านั้นได้โดยการกดค้างด้วยสองนิ้วในเครื่องเล่น Shorts";+"SHORTS_ONLY_DISABLED" = "ปิดใช้งานโหมด Shorts เท่านั้นแล้ว";+"SHORTS_ACTION" = "การกระทำของ Shorts เมื่อจบวิดีโอ";+"LOOP" = "ลูป";+"SKIP_TO_NEXT_SHORTS" = "ข้ามไปยังถัดไป";+"PAUSE_SHORTS" = "หยุด";+"REMOVE_LIVE_SHORTS" = "ลบวิดีโอสด";+"REMOVE_LIVE_SHORTS_DESC" = "นำวิดีโอสดออกจากฟีด";+"HIDE_SHORTS_PRODUCT" = "ซ่อนสินค้า";+"HIDE_SHORTS_PRODUCT_DESC" = "ซ่อนสินค้าและลิงค์สินค้าในโอเวอร์เลย์ Shorts";+"HIDE_SHORTS_RECBAR" = "ซ่อนแถบแนะนำ";+"HIDE_SHORTS_RECBAR_DESC" = "ซ่อนแถบแนะนำในโอเวอร์เลย์ Shorts";+"HIDE_SHORTS_DISCLOSURE" = "ซ่อน 'ได้รับค่าคอมมิชชัน'";+"HIDE_SHORTS_DISCLOSURE_DESC" = "ซ่อนกล่องข้อความ 'ได้รับค่าคอมมิชชัน' ใน Shorts";+"REMOVE_SHORTS_LIKE_BUTTON" = "ลบปุ่มถูกใจ";+"REMOVE_SHORTS_LIKE_BUTTON_DESC" = "ลบปุ่มถูกใจออกจากวิดีโอ Shorts";+"REMOVE_SHORTS_COMMENT_BUTTON" = "ลบปุ่มความคิดเห็น";+"REMOVE_SHORTS_COMMENT_BUTTON_DESC" = "ลบปุ่มความคิดเห็นออกจากวิดีโอ Shorts";+"REMOVE_SHORTS_SHARE_BUTTON" = "ลบปุ่มแชร์";+"REMOVE_SHORTS_SHARE_BUTTON_DESC" = "ลบปุ่มแชร์ออกจากวิดีโอ Shorts";+"REMOVE_SHORTS_REMIX_BUTTON" = "ลบปุ่มรีมิกซ์";+"REMOVE_SHORTS_REMIX_BUTTON_DESC" = "ลบปุ่มรีมิกซ์ออกจากวิดีโอ Shorts";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON" = "ลบปุ่มข้อมูลเสียง";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON_DESC" = "ลบปุ่มข้อมูลเสียง/เพลงออกจากวิดีโอ Shorts";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON" = "ลบปุ่มการติดตาม";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON_DESC" = "ลบปุ่มการติดตามในแถบด้านบนเมื่อหยุดวิดีโอ Shorts ชั่วคราว";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON" = "ลบปุ่มไลฟ์สด";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON_DESC" = "ลบปุ่มไลฟ์สดในแถบด้านบนเมื่อหยุดวิดีโอ Shorts ชั่วคราว";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON" = "ลบปุ่ม Lens";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON_DESC" = "ลบปุ่ม Lens ในแถบด้านบนเมื่อหยุดวิดีโอ Shorts ชั่วคราว";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON" = "ลบปุ่มเทรนด์";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON_DESC" = "ลบปุ่มเทรนด์ในแถบด้านบนเมื่อหยุดวิดีโอ Shorts ชั่วคราว";+"ENABLES_SHORTS_QUALITY" = "เปิดใช้งานตัวเลือกคุณภาพ Shorts";+"ENABLES_SHORTS_QUALITY_DESC" = "สามารถเลือกคุณภาพ Shorts ได้";+"SHOW_SHORTS_SEEKBAR" = "แสดงแถบเลื่อนเสมอ";+"SHOW_SHORTS_SEEKBAR_DESC" = "แสดงแถบความคืบหน้าเสมอ";+"REMOVE_POSTS_SHORTS" = "ลบโพสต์";+"REMOVE_POSTS_SHORTS_DESC" = "นำโพสต์ออกจากฟีด";+"SHORTS_FULLSCREEN" = "ซูมเพื่อดูแบบเต็มหน้าจอ";+"SHORTS_FULLSCREEN_DESC" = "ซูมเข้า-ออกเพื่อรับชม Shorts แบบเต็มหน้าจอ";++"TABBAR" = "แท็บนำทาง";+"DEFAULT_TAB" = "แท็บเริ่มต้น";+"FORSTED_TAB_BAR" = "แท็บโปร่งใส";+"ENABLED" = "เปิดใช้งาน";+"HOME_TAB" = "หน้าแรก";+"SHORTS_TAB" = "Shorts";+"CREATE_TAB" = "สร้าง";+"SUBSCRIPTIONS_TAB" = "การติดตาม";+"LIBRARY_TAB" = "คลัง (คุณ)";+"HIDE_TAB_INDI" = "ซ่อนตัวบอกสถานะ";+"HIDE_TAB_INDI_DESC" = "ซ่อนตัวบอกสถานะในแท็บต่างๆ";+"HIDE_TAB_LABELS" = "ซ่อนชื่อแท็บ";+"HIDE_TAB_LABELS_DESC" = "ซ่อนชื่อแท็บในแท็บต่างๆ";+"HISTORY_TAB" = "ประวัติการเข้าชม";+"GAMING_TAB" = "เกม";+"SPORTS_TAB" = "กีฬา";+"NOTI_TAB" = "การแจ้งเตือน";+"NEWS_TAB" = "ข่าวสาร";+"MUSIC_TAB" = "เพลง";+"WATCH_LATER_TAB" = "ดูภายหลัง";+"PLAYLIST_TAB" = "เพลย์ลิสต์";+"LIKE_TAB" = "วิดีโอที่ชอบ";+"LIVE_TAB" = "สด";+"POST_TAB" = "โพสต์";+"VIDEO_TAB" = "วิดีโอของคุณ";+"MOVIE_TAB" = "ภาพยนตร์";+"COURSE_TAB" = "หลักสูตร";+"MINIGAME_TAB" = "เล่นเกม";+"FASHION_TAB" = "แฟชั่นและความงาม";+"LEARNING_TAB" = "การเรียนรู้";+"MANAGE_TABS" = "จัดการแท็บ";+"MANAGE_TABS_DESC" = "จัดเรียงและเปิด/ปิดใช้งานแท็บ";+"TAB_REORDER_HINT" = "ลากเพื่อจัดเรียงใหม่ เปิด/ปิดเพื่อแสดง/ซ่อน\\nนอกจากนี้ การตั้งค่าแท็บยังสามารถเข้าถึงได้โดยการแตะแท็บแรกค้างไว้";+"TAB_LIMIT" = "จำกัดแท็บ";+"TAB_LIMIT_DESC" = "สามารถมีแท็บได้สูงสุด 6 แท็บ";+"ZERO_TAB_DESC" = "ต้องเปิดใช้งานอย่างน้อย 1 แท็บ";++"MISCELLANEOUS" = "อื่นๆ";+"BACKGROUND_PLAYBACK" = "เล่นภายในเบื้องหลัง";+"BACKGROUND_PLAYBACK_DESC" = "เปิดใช้งานการเล่นวิดีโอภายในเบื้องหลัง";+"DISABLES_SHORTS_PIP" = "ปิด PiP ของ Shorts";+"DISABLES_SHORTS_PIP_DESC" = "พยายามปิด PiP ของ Shorts อาจไม่สามารถปิดได้ 100%";+"DISABLE_HINTS" = "ปิดคำแนะนำ";+"DISABLE_HINTS_DESC" = "ปิดคำแนะนำการใช้งานต่างๆ";+"BLOCK_UPGRADE_DIALOGS" = "บล็อกกล่องแจ้งเตือนอัปเดต";+"BLOCK_UPGRADE_DIALOGS_DESC" = "บล็อกกล่องข้อความแจ้งเตือนให้อัปเดตแอป";+"ARE_YOU_THERE_DIALOG" = "ซ่อนกล่องแจ้งเตือน 'คุณยังอยู่ไหม'";+"ARE_YOU_THERE_DIALOG_DESC" = "ซ่อนกล่องแจ้งเตือน 'คุณยังอยู่ไหม' เมื่อคุณปล่อยวิดีโอเล่นทิ้งไว้นานเกินไป";+"FIXES_SLOW_MINIPLAYER" = "แก้ไขมินิเพลเยอร์ช้า";+"FIXES_SLOW_MINIPLAYER_DESC" = "แก้ไขมินิเพลเยอร์ตอบสนองช้า สามารถใช้ได้เฉพาะกับ YouTube เวอร์ชั่นเก่า";+"DISABLES_NEW_MINIPLAYER" = "ปิดใช้งานมินิเพลเยอร์ใหม่";+"DISABLES_NEW_MINIPLAYER_DESC" = "ใช้มินิเพลเยอร์แบบเก่า สามารถใช้ได้เฉพาะกับ YouTube เวอร์ชั่นเก่า";+"DISABLES_SNACK_BAR" = "ปิดใข้งาน Snack bar";+"DISABLES_SNACK_BAR_DESC" = "ปิดใข้งาน Snack bar เมื่อแตะปุ่มหรือทำอะไรในแอป";+"HIDE_STARTUP_ANIMATIONS" = "ซ่อนแอนิเมชัน";+"HIDE_STARTUP_ANIMATIONS_DESC" = "ซ่อนแอนิเมชันตอนเปิดแอป";+"HIDE_LIKE_DISLIKE_VOTES" = "ซ่อนโหวดชอบ/ไม่ชอบ";+"HIDE_LIKE_DISLIKE_VOTES_DESC" = "ซ่อนกล่องโหวดชอบ/ไม่ชอบ";+"FLYOUT_MENU" = "เมนูป๊อปอัป";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION" = "ลบตัวเลือก 'เล่นต่อจากวิดีโอนี้'";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION_DESC" = "ลบตัวเลือก 'เล่นต่อจากวิดีโอนี้' ออกจากเมนูป๊อปอัป";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION" = "ลบตัวเลือก 'เล่นเป็นรายการสุดท้ายในคิว'";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION_DESC" = "ลบตัวเลือก 'เล่นเป็นรายการสุดท้ายในคิว' ออกจากเมนูป๊อปอัป";+"REMOVE_DOWNLOAD_OPTION" = "ลบตัวเลือก 'ดาวน์โหลดวิดีโอ'";+"REMOVE_DOWNLOAD_OPTION_DESC" = "ลบตัวเลือก 'ดาวน์โหลดวิดีโอ' ออกจากเมนูป๊อปอัป";+"REMOVE_WATCH_LATER_OPTION" = "ลบตัวเลือก 'บันทึกไปยังดูภายหลัง'";+"REMOVE_WATCH_LATER_OPTION_DESC" = "ลบตัวเลือก 'บันทึกไปยังดูภายหลัง' ออกจากเมนูป๊อปอัป";+"REMOVE_SAVE_OPTION" = "ลบตัวเลือก 'บันทึกไปยังเพลย์ลิสต์'";+"REMOVE_SAVE_OPTION_DESC" = "ลบตัวเลือก 'บันทึกไปยังเพลย์ลิสต์' ออกจากเมนูป๊อปอัป";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION" = "ลบตัวเลือก 'ลบจากเพลย์ลิสต์'";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION_DESC" = "ลบตัวเลือก 'ลบจากเพลย์ลิสต์' ออกจากเมนูป๊อปอัป";+"REMOVE_SHARE_OPTION" = "ลบตัวเลือก 'แชร์'";+"REMOVE_SHARE_OPTION_DESC" = "ลบตัวเลือก 'แชร์' ออกจากเมนูป๊อปอัป";+"REMOVE_NOT_INTERESTED_OPTION" = "ลบตัวเลือก 'ไม่สนใจ'";+"REMOVE_NOT_INTERESTED_OPTION_DESC" = "ลบตัวเลือก 'ไม่สนใจ' ออกจากเมนูป๊อปอัป";+"REMOVE_DONT_RECOMMEND_OPTION" = "ลบตัวเลือก 'ไม่ต้องแนะนำช่อง'";+"REMOVE_DONT_RECOMMEND_OPTION_DESC" = "ลบตัวเลือก 'ไม่ต้องแนะนำช่อง' ออกจากเมนูป๊อปอัป";+"REMOVE_INFO_OPTION" = "ลบตัวเลือก 'เพราะเหตุใดฉันจึงเห็นฟีเจอร์นี้'";+"REMOVE_INFO_OPTION_DESC" = "ลบตัวเลือก 'เพราะเหตุใดฉันจึงเห็นฟีเจอร์นี้' ออกจากเมนูป๊อปอัป";+"REMOVE_FILTER_OPTION" = "ลบตัวเลือก 'ตัวกรองการค้นหา'";+"REMOVE_FILTER_OPTION_DESC" = "ลบตัวเลือก 'ตัวกรองการค้นหา' ออกจากเมนูป๊อปอัป";+"REMOVE_REPORT_OPTION" = "ลบตัวเลือก 'รายงาน'";+"REMOVE_REPORT_OPTION_DESC" = "ลบตัวเลือก 'รายงาน' ออกจากเมนูป๊อปอัป";+"REMOVE_YOUTUBE_MUSIC_OPTION" = "ลบตัวเลือก 'ฟังเพลงด้วย YouTube Music'";+"REMOVE_YOUTUBE_MUSIC_OPTION_DESC" = "ลบตัวเลือก 'ฟังเพลงด้วย YouTube Music' ออกจากเมนูป๊อปอัป";+"REMOVE_FEED_BACK_OPTION" = "ลบตัวเลือก 'ส่งคอมเมนต์'";+"REMOVE_FEED_BACK_OPTION_DESC" = "ลบตัวเลือก 'ส่งคอมเมนต์' ออกจากเมนูป๊อปอัป";+"REMOVE_CAST_OPTION" = "ลบตัวเลือก 'รับชมบนทีวี'";+"REMOVE_CAST_OPTION_DESC" = "ลบตัวเลือก 'แคสต์' ออกจากเมนูป๊อปอัป";+"REMOVE_SHUFFLE_OPTION" = "ลบตัวเลือก 'สุ่ม'";+"REMOVE_SHUFFLE_OPTION_DESC" = "ลบตัวเลือก 'สุ่ม' ออกจากเมนูป๊อปอัป";+"REMOVE_UN_SUB_OPTION" = "ลบตัวเลือก 'ยกเลิกการสมัคร'";+"REMOVE_UN_SUB_OPTION_DESC" = "ลบตัวเลือก 'ยกเลิกการสมัคร' ออกจากเมนูป๊อปอัป";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION" = "ลบตัวเลือก 'ซ่อนวิดีโอจากเพลย์ลิสต์'";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION_DESC" = "ลบตัวเลือก 'ซ่อนวิดีโอจากเพลย์ลิสต์' ออกจากเมนูป๊อปอัป";+"REMOVE_HELP_OPTION" = "ลบตัวเลือก 'ความช่วยเหลือและคอมเมนต์'";+"REMOVE_HELP_OPTION_DESC" = "ลบตัวเลือก 'ความช่วยเหลือและคอมเมนต์' ออกจากเมนูป๊อปอัป";+"REMOVE_NOTIFY_OPTION" = "ลบตัวเลือก 'แจ้งเตือนให้ฉันทราบ'";+"REMOVE_NOTIFY_OPTION_DESC" = "ลบตัวเลือก 'แจ้งเตือนให้ฉันทราบ' ออกจากเมนูป๊อปอัป";+"REMOVE_CLEARSCREEN_OPTION" = "ลบตัวเลือก 'ล้างหน้าจอ'";+"REMOVE_CLEARSCREEN_OPTION_DESC" = "ลบตัวเลือก 'ล้างหน้าจอ' ออกจากเมนูป๊อปอัป";+"HIDE_COMMU_GUIDE" = "นำหลักเกณฑ์ชุมชนออก";+"HIDE_COMMU_GUIDE_DESC" = "นำหลักเกณฑ์ชุมชนที่ปักหมุดไว้ออกจากคอมเมนต์";+"HIDE_ENGAGEMENT_SUBBAR" = "ซ่อนส่วนหัวความคิดเห็น";+"HIDE_ENGAGEMENT_SUBBAR_DESC" = "ซ่อนแถบจัดเรียงความคิดเห็น (ยอดนิยม, ล่าสุด) ด้านบนของคอมเมนต์";+"DISABLES_RTL" = "ปิดใช้งานเลย์เอาต์ RTL";+"DISABLES_RTL_DESC" = "บังคับให้แสดงผลจากซ้ายไปขวา (LTR) และปิดการจัดหน้าแบบขวาไปซ้าย (RTL)";+"DEVICE_UI" = "รูปแบบอุปกรณ์";+"OPEN_LINK" = "เปิดลิงก์";+"FLOATING_KEYBOARD" = "แป้นพิมพ์แบบลอย";+"FLOATING_KEYBOARD_DESC" = "บังคับเปิดใช้งานแป้นพิมพ์แบบลอย มีประโยชน์สำหรับ iPhone ที่ใช้การปลอมแปลงสไตล์ iPad\\nหมายเหตุ: ทำงานเฉพาะเมื่อเลือกสไตล์ iPad เท่านั้น";+"AUTO_OPEN_LINK" = "ตรวจจับคลิปบอร์ดอัตโนมัติ";+"AUTO_OPEN_LINK_DESC" = "ตรวจสอบคลิปบอร์ดหาลิงก์ที่เกี่ยวข้องกับ YouTube ทุกครั้งที่เปิดแอป\\nเพื่อให้ทำงานได้อย่างถูกต้อง ให้ไปที่การตั้งค่า iOS → YouTube → วางจากแอปอื่น แล้วเลือก 'อนุญาต'";++"SB_DESCRIPTION" = "ข้ามช่วงสปอนเซอร์โดยอัตโนมัติด้วยข้อมูลจากชุมชน";+"SB_ENABLE" = "เปิดใช้งาน SponsorBlock";+"SB_ENABLE_DESC" = "เปิดส่วนขยาย SponsorBlock เพื่อข้ามส่วนที่เป็นโฆษณาหรือสปอนเซอร์";+"SB_SHOW_BUTTON" = "แสดงปุ่มบนหน้าจอ";+"SB_SHOW_BUTTON_DESC" = "แสดงปุ่มเปิด-ปิด SponsorBlock บนหน้าเครื่องเล่นวิดีโอ";+"SB_SHOW_NOTIFICATIONS" = "แสดงการแจ้งเตือน";+"SB_SHOW_NOTIFICATIONS_DESC" = "แสดงการแจ้งเตือนเมื่อมีการข้ามช่วงวิดีโอ (การแจ้งเตือนสำหรับหมวดหมู่ที่ตั้งค่าแบบกดข้ามเองจะแสดงเสมอ)";+"SB_HAPTIC_FEEDBACK" = "ตอบสนองด้วยการสั่น";+"SB_HAPTIC_FEEDBACK_DESC" = "สั่นเมื่อมีการข้ามช่วงวิดีโอ";+"SB_SEGMENTS_IN_PLAYER" = "แสดงช่วงวิดีโอบนเครื่องเล่นวิดีโอ";+"SB_SEGMENTS_IN_PLAYER_DESC" = "แสดงแถบสีระบุช่วงต่างๆ บนแถบความคืบหน้าของเครื่องเล่นวิดีโอหลัก";+"SB_SEGMENTS_IN_FEED" = "แสดงช่วงวิดีโอในฟีด";+"SB_SEGMENTS_IN_FEED_DESC" = "แสดงแถบสีระบุช่วงต่างๆ บนแถบความคืบหน้าของวิดีโอในหน้าฟีด";+"SB_SEGMENTS_IN_MINIPLAYER" = "แสดงช่วงวิดีโอในเครื่องเล่นขนาดเล็ก";+"SB_SEGMENTS_IN_MINIPLAYER_DESC" = "แสดงแถบสีระบุช่วงต่างๆ บนแถบความคืบหน้าของเครื่องเล่นขนาดเล็ก";+"SB_SHOW_DURATION" = "แสดงเวลาวิดีโอแบบไม่รวมช่วงสปอนเซอร์";+"SB_SHOW_DURATION_DESC" = "แสดงเวลาความยาวทั้งหมดของวิดีโอโดยหักช่วงที่ข้ามได้ออก";+"SB_CATEGORIES_HEADER" = "หมวดหมู่ช่วงวิดีโอ";+"SB_SEGMENT_COLOR" = "สีประจำช่วง";++"SB_ACTION_DISABLE" = "ปิดการใช้งาน";+"SB_ACTION_AUTO_SKIP" = "ข้ามอัตโนมัติ";+"SB_ACTION_ASK" = "ถามก่อนข้าม";+"SB_ACTION_DISPLAY" = "แสดงบนแถบเวลาเท่านั้น";+"SB_ACTION_SKIP_TO" = "ข้ามไปยังช่วงนี้";++"SB_CAT_sponsor" = "สปอนเซอร์";+"SB_CAT_sponsor_DESC" = "การโฆษณาสินค้าหรือบริการที่มีค่าตอบแทน ซึ่งไม่เกี่ยวข้องกับตัวผู้สร้างโดยตรง";+"SB_CAT_intro" = "อินโทร/บทนำ";+"SB_CAT_intro_DESC" = "ช่วงพักหรือแอนิเมชันเปิดตัวที่มักพบบ่อยในช่วงต้นวิดีโอ";+"SB_CAT_outro" = "ท้ายคลิป/เครดิต";+"SB_CAT_outro_DESC" = "เครดิต หรือส่วนปิดท้ายที่อยู่ช่วงท้ายของวิดีโอ";+"SB_CAT_interaction" = "การปฏิสัมพันธ์";+"SB_CAT_interaction_DESC" = "การเตือนให้กดไลก์ กดติดตาม หรือติดตามบนโซเชียลมีเดียต่างๆ";+"SB_CAT_selfpromo" = "โปรโมทตัวเอง";+"SB_CAT_selfpromo_DESC" = "การโปรโมทสินค้า สินค้าที่ระลึก หรือเนื้อหาอื่นๆ ของผู้สร้างเองโดยไม่มีค่าจ้าง";+"SB_CAT_music_offtopic" = "ส่วนที่ไม่ใช่เพลง";+"SB_CAT_music_offtopic_DESC" = "ส่วนที่ไม่มีเพลงในมิวสิกวิดีโอ (เช่น การพูดคุย หรือบทสนทนาเปิดเรื่อง)";+"SB_CAT_preview" = "ตัวอย่างตอนต่อไป/สรุป";+"SB_CAT_preview_DESC" = "การสรุปเนื้อหาเดิมหรือตัวอย่างจากวิดีโออื่นหรือตอนก่อนหน้า";+"SB_CAT_hook" = "ฮุก/คำทักทาย";+"SB_CAT_hook_DESC" = "คลิปเกริ่นนำนำร่องสำหรับวิดีโอถัดไป คำทักทาย และคำกล่าวลา";+"SB_CAT_poi_highlight" = "ไฮไลท์";+"SB_CAT_poi_highlight_DESC" = "ช่วงสำคัญหรือจุดที่เป็นไฮไลท์ของวิดีโอ ใช้คำสั่ง 'ข้ามไปยัง' เพื่อดูส่วนนี้ทันที";+"SB_CAT_filler" = "เนื้อหาน้ำ/ส่วนเติม";+"SB_CAT_filler_DESC" = "เนื้อหาที่ออกนอกเรื่อง มุกตลก หรือส่วนเติมที่ไม่ได้เกี่ยวข้องกับหัวข้อหลัก";++"SB_SKIPPED" = "ข้ามช่วง %@ แล้ว";+"SB_DETECTED" = "ตรวจพบช่วง %@\\nคุณต้องการข้ามช่วงนี้หรือไม่?";+"SB_SKIP_NOW" = "ข้าม";+"SB_UNSKIP" = "ยกเลิกการข้าม";+"SB_JUMPED_TO_HIGHLIGHT" = "ข้ามไปยังไฮไลท์แล้ว";+"SB_JUMP_TO_HIGHLIGHT" = "พบช่วงไฮไลท์ ต้องการข้ามไปดูเลยหรือไม่?";+"SB_SEGMENT_COLOR_SUFFIX" = "สีประจำช่วง";+"SB_SECTION_MAIN" = "ตั้งค่าหลัก";+"SB_SKIP_ALERT_DURATION" = "ระยะเวลาแสดงการแจ้งเตือนเมื่อข้าม";+"SB_UNSKIP_ALERT_DURATION" = "ระยะเวลาแสดงการแจ้งเตือนเมื่อยกเลิกการข้าม";+"SB_MIN_DURATION_SLIDER" = "ความยาวขั้นต่ำของช่วงวิดีโอที่จะให้ข้าม";\ No newline at end of filediff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/tr.lproj/Localizable.strings b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/tr.lproj/Localizable.stringsnew file mode 100644index 0000000..14c3472--- /dev/null+++ b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/tr.lproj/Localizable.strings@@ -0,0 +1,578 @@+"SETTINGS" = "Ayarlar";+"INTERFACE" = "Arayüz";++"SEARCH" = "Ara";+"SEARCH_DESC" = "YouMod ayarlarında ara.";++"URL_COPIED" = "Video bağlantısı kopyalandı";+"COPY_URL" = "Video bağlantısını kopyala";+"COPY_URL_TIMESTAMP" = "Zaman damgalı video bağlantısını kopyala";+"URL_TIMESTAMP_COPIED" = "Zaman damgalı video bağlantısı kopyalandı";+"CANCEL" = "İptal";+"ERROR" = "Hata";+"ERROR_VIDEOID" = "Video kimliği (ID) alınamadı";+"ERROR_ADS" = "Reklam oynatılırken video bağlantısı kopyalanamaz";++"LOOP_DISABLED" = "Döngü devre dışı";+"LOOP_ENABLED" = "Döngü etkin";++"NEW_ISSUES" = "Sorun bildirin veya yeni özellik isteyin";+"NEW_ISSUES_DESC" = "Hata mı buldunuz veya yeni özellikler mi istiyorsunuz? Buraya dokunun.";+"SOURCE_CODES" = "Kaynak kodları";+"SOURCE_CODES_DESC" = "Kodlara göz atın!";++"EXTRA" = "Ekstra";+"FIX_PLAYBACK_ISSUES" = "Oynatma sorunlarını düzelt (Geçici)";+"FIX_PLAYBACK_ISSUES_DESC" = "Bazı kullanıcılar için video oynatma sorunlarını düzeltmeyi dener. Bunu açmak, oynatıcının video oynatılamadığında veya hata verdiğinde kendini otomatik olarak yeniden yüklemesini sağlar.";++"PERFER_HEADER" = "YouMod tercihleri";+"PERFER" = "Tercihler";+"IMPORT" = "Ayarları içe aktar";+"IMPORT_DESC" = "Tercihlerinizi bir .plist dosyasından yükleyin.";+"IMPORT_DONE" = "Başarılı";+"YES" = "Evet";+"APPLY_DESC" = "Uygulamanın yeniden başlatılması gerekiyor. Uygulamayı şimdi yeniden başlatmak istiyor musunuz?";+"EXPORT" = "Ayarları dışa aktar";+"EXPORT_DESC" = "Tercihlerinizi bir .plist dosyasına aktarın.";+"RESTORE" = "Ayarları sıfırla";+"RESTORE_DESC" = "Sıfır kurulumdaki gibi varsayılan ayarları yükler.";+"WARNING" = "Uyarı";+"RESETDEFAULT" = "Bu işlem tüm ayarları varsayılana sıfırlayacaktır. Devam etmek istiyor musunuz?";+"ERROR_INVALID_FILE" = "Geçersiz dosya";+"ERROR_NO_KEYS_IMPORT" = "İçe aktarılacak kullanılabilir anahtar yok";+"ERROR_NO_KEYS_EXPORT" = "Dışa aktarılacak kullanılabilir anahtar yok";+"OVERRIDE" = "Bu işlem mevcut ayarların üzerine yazacaktır. Devam etmek istiyor musunuz?";+"DISABLED" = "Devre dışı";++"CACHE" = "Önbellek yönetimi";+"CLEARCACHE" = "Önbelleği temizle";+"DONE" = "Tamamlandı";+"AUTO_CLEARCACHE" = "Otomatik önbellek temizleme";+"AUTO_CLEARCACHE_DESC" = "Başlangıçta uygulama önbelleğini otomatik olarak temizler.";++"DOWNLOADING" = "İndiriliyor";+"DOWNLOAD_MANAGER" = "İndirme yöneticisi";+"DOWNLOAD_MANAGER_DESC" = "YouTube'un video indiricisini YouMod indiricisi ile değiştirir. Videoları, sesleri, altyazıları ve küçük resimleri indirme imkanı sunar.";+"POST_DOWNLOAD_ACTION" = "İndirme sonrası işlem";+"POST_ACTION_SAVE_PHOTOS" = "Fotoğraflar'a kaydet";+"POST_ACTION_SHARE" = "Paylaş";+"POST_ACTION_ASK" = "Sor";+"ADD_SHORTS_DOWNLOAD" = "Shorts'a indirme butonu ekle";+"ADD_SHORTS_DOWNLOAD_DESC" = "Shorts video katmanına bir indirme butonu ekler.";+"DOWNLOAD_SHORTS" = "Shorts İndir";+"COPY_VID_INFO" = "Video bilgilerini kopyala";+"COPY_TITLE" = "Başlığı kopyala";+"COPY_DESCRIPTION" = "Açıklamayı kopyala";+"COPY_ALL_VID_INFO" = "Tümünü kopyala";+"COPIED_TITLE" = "Video başlığı kopyalandı";+"COPIED_DESCRIPTION" = "Video açıklaması kopyalandı";+"COPY_AUTHOR" = "Kanal adını kopyala";+"COPIED_AUTHOR" = "Kanal adı kopyalandı";+"SAVE_THUMBNAIL" = "Küçük resmi kaydet";+"DOWNLOAD_CAPTIONS" = "Altyazıları indir";+"DOWNLOAD_AUDIO" = "Sesi indir";+"DOWNLOAD_VIDEO" = "Videoyu indir";+"OPEN_VID_BEFORE" = "İndirme yöneticisini kullanmadan önce bir video açın";+"NO_CAPTIONS_URL" = "Geçerli bir altyazı bağlantısı bulunamadı";+"NO_AUDIO_URL" = "Ses bağlantısı bulunamadı";+"NO_STREAM_URL" = "Yayın bağlantısı bulunamadı";+"CAPTIONS_FAILED" = "Altyazılar indirilemedi";+"NO_CAPTIONS" = "Bu video için altyazı mevcut değil";+"NO_AUDIO_STREAM_FOUND" = "Ses akışı bulunamadı";+"NO_VID_AUDIO_STREAM_FOUND" = "Video/Ses akışı bulunamadı";+"COPIED_VID_INFO" = "Tüm video bilgileri kopyalandı";+"SAVED_TO_PHOTOS" = "Fotoğraflar'a kaydedildi";+"SAVE_FAILED" = "Kaydetme başarısız";+"PHOTO_ACCESS_DENINED" = "Fotoğraflar erişimi reddedildi";+"THUMBNAIL_FAILED" = "Küçük resim alınamadı";+"DOWNLOADING_THUMBNAIL" = "Küçük resim indiriliyor...";+"DOWNLOADING_AUDIO" = "Ses indiriliyor...";+"DOWNLOADING_VIDEO" = "Video indiriliyor...";+"DOWNLOADING_CAPTIONS" = "Altyazılar indiriliyor...";+"NO_THUMBNAIL_FOUND" = "Küçük resim bulunamadı";+"DOWNLOAD_FAILED" = "İndirme başarısız";+"AUDIO_SAVED" = "Ses kaydedildi";+"DOWNLOAD_COMPLETED" = "İndirme tamamlandı";+"CANNOT_SAVE_TO_PHOTOS" = "Fotoğraflar'a kaydedilemiyor";+"FINA_VIDEO" = "Video tamamlanıyor...";+"MERGING_VID_FALLBACK" = "Video alternatif yöntemle birleştiriliyor...";+"MERGING_VID" = "Video birleştiriliyor...";+"CONVERTING" = "Dönüştürülüyor:";+"ALREADY_DOWNLOADING" = "Zaten indiriliyor";+"DOWNLOAD_CANCELLED" = "İndirme iptal edildi";+"TRIMMING_AUDIO" = "Ses kırpılıyor...";+"SHOW_THUMBNAIL" = "Küçük resmi göster";+"COPY_THUMBNAIL" = "Küçük resmi kopyala";+"THUMBNAIL_OPTIONS" = "Küçük resmi indir";+"COPY" = "Kopyala";+"COPIED_TO_CLIPBOARD" = "Pano'ya kopyalandı";+"CONNECTING_TO_SERVER" = "Sunucuya bağlanılıyor...";+"DOWNLOADING_TO_SERVER" = "Sunucuya indiriliyor...";+"COPY_COMMENT_TEXT" = "Yorum metnini kopyala";+"SAVE_COMMENT_IMAGE" = "Yorumu görsel olarak kaydet";+"COPY_COMMENT_IMAGE" = "Yorumu görsel olarak kopyala";+"COPY_POST_TEXT" = "Gönderi metnini kopyala";+"SAVE_POST_IMAGE" = "Gönderiyi görsel olarak kaydet";+"COPY_POST_IMAGE" = "Gönderiyi görsel olarak kopyala";+"DOWNLOAD_SERVER" = "İndirme sunucusu";+"CHOOSE_DOWNLOAD_SERVER" = "İndirme sunucusunu seçin";+"DOWNLOAD_COMMENT" = "Yorum bilgilerini kaydet";+"DOWNLOAD_COMMENT_DESC" = "Üç nokta butonuna uzun basarak yorum metnini kopyalamaya ve yorumu görsel olarak kaydetmeye izin verir.";+"DOWNLOAD_POST" = "Gönderi bilgilerini kaydet";+"DOWNLOAD_POST_DESC" = "Uzun basarak gönderi metnini kopyalamaya ve gönderiyi görsel olarak kaydetmeye izin verir.";+"TRANSLATE_COMMENT" = "Yorumu çevir";+"TRANSLATE_POST" = "Gönderiyi çevir";+"SERVER_EUROPRE1" = "Avrupa";+"SERVER_ASIA1" = "Tayland - Asya";+"SHOW_OPTIONS" = "Seçenekleri göster";+"ENGLISH" = "İngilizce";+"TRANSLATION" = "Çeviri";+"LANGUAGE" = "Dil";+"TRANSLATING" = "Çevriliyor...";+"SELECT_LANG" = "Dil seçin";+"TRANSLATE_FAILED" = "Çeviri başarısız oldu, lütfen tekrar deneyin.";+"SAVE_CURRENT_IMAGE" = "Mevcut görseli kaydet";+"COPY_CURRENT_IMAGE" = "Mevcut görseli kopyala";+"DOWNLOAD_METHOD" = "İndirme yöntemi";+"DOWNLOAD_METHOD_DESC" = "Videoların nasıl indirileceği. Cihaz içi yöntemi en son YouTube sürümlerinde çalışır.";+"METHOD_DIRECT" = "Doğrudan";+"METHOD_SERVER" = "Sunucu";+"METHOD_ONDEVICE" = "Cihaz içi (SABR)";++"APPEARANCE" = "Görünüm";+"OLED_THEME" = "OLED karanlık mod";+"OLED_THEME_DESC" = "Uygulamanın karanlık teması için saf siyah (OLED) renk kullanır.";+"OLED_KEYBOARD" = "OLED klavye";+"OLED_KEYBOARD_DESC" = "Karanlık temada klavyenin saf siyah (OLED) renk kullanmasını sağlar.";++"NAVBAR" = "Gezinme çubuğu";+"STICKY_NAVBAR" = "Sabit Gezinme çubuğu";+"STICKY_NAVBAR_DESC" = "Gezinme çubuğunu sabitleyerek aşağı kaydırırken görünür kalmasını sağlar.";+"NAVIGATION_ICON" = "Gezinme simgesi";+"NAVIGATION_ICON_DESC" = "Gezinme çubuğundaki YouTube logosunu değiştirin.";+"PREMIUM" = "Premium";+"REMOVE_YTLOGO" = "Logoyu kaldır";+"YOUTUBE" = "YouTube";+"HIDE_NOTIFICATION_BUTTON" = "Bildirim butonunu gizle";+"HIDE_NOTIFICATION_BUTTON_DESC" = "Gezinme çubuğundaki bildirim butonunu gizler.";+"HIDE_SEARCH_BUTTON" = "Arama butonunu gizle";+"HIDE_SEARCH_BUTTON_DESC" = "Gezinme çubuğundaki arama butonunu gizler.";+"HIDE_VOICE_SEARCH_BUTTON" = "Sesli arama butonunu gizle";+"HIDE_VOICE_SEARCH_BUTTON_DESC" = "Gezinme çubuğundaki sesli arama butonunu gizler.";+"HIDE_CAST_BUTTON_NAVBAR" = "Yayınla butonunu gizle";+"HIDE_CAST_BUTTON_NAVBAR_DESC" = "Gezinme çubuğundaki yayınla butonunu gizler.";++"FEED" = "Akış";+"HIDE_SUBBAR" = "Alt çubuğu gizle";+"HIDE_SUBBAR_DESC" = "Akışın üst kısmındaki alt çubuğu gizler.";+"HIDE_HORI_SHELF" = "Yatay akışları kaldır";+"HIDE_HORI_SHELF_DESC" = "Oynatılabilirler hariç tüm yatay akışları (Haberler, İzlemeye Devam Et, Gönderi koleksiyonu vb.) akıştan kaldırır.";+"HIDE_MUSIC_PLAYLISTS" = "Müzik çalma listesi oluşturucuyu gizle";+"HIDE_MUSIC_PLAYLISTS_DESC" = "Akıştaki müzik çalma listesi oluşturucuyu gizler.";+"HIDE_FEED_POST" = "Gönderileri gizle";+"HIDE_FEED_POST_DESC" = "Akıştaki gönderileri gizler.";+"HIDE_SURVEYS" = "Anketleri gizle";+"HIDE_SURVEYS_DESC" = "YouTube'un bazen gösterdiği video anketlerini gizler.";+"HIDE_SHORTS_SHELF" = "Shorts rafını gizle";+"HIDE_SHORTS_SHELF_DESC" = "Abonelikler sekmesi de dahil olmak üzere akıştaki Shorts rafını gizler.";+"KEEP_SHORTS_SUBSCRIPT" = "Aboneliklerde Shorts'u koru";+"KEEP_SHORTS_SUBSCRIPT_DESC" = "Shorts'un Abonelikler sekmesinden kaldırılmasını engeller.";+"HIDE_SEARCH_HISTORY" = "Arama geçmişini gizle";+"HIDE_SEARCH_HISTORY_DESC" = "Arama çubuğunu kullanırken önceki arama geçmişini ve önerileri gizler.\\nNOT: Arama geçmişinize diğer YouTube istemcilerinizden erişilmeye devam edilebilir.";+"REMOVE_CHANNEL_COMMUNITY_BUTTON" = "Topluluk butonunu kaldır";+"REMOVE_CHANNEL_COMMUNITY_BUTTON_DESC" = "Kanal üst bilgilerindeki topluluk butonunu kaldırır.";+"REMOVE_CHANNEL_SPONSOR_BUTTON" = "Katıl butonunu kaldır";+"REMOVE_CHANNEL_SPONSOR_BUTTON_DESC" = "Akışlar, kanal üst bilgileri ve Shorts genelindeki sponsor / katıl butonunu kaldırır.";+"HIDE_PLAYABLES" = "Oynatılabilirleri kaldır";+"HIDE_PLAYABLES_DESC" = "Akıştaki oynatılabilirleri (mini oyunları) kaldırır.";+"HIDE_RELATED_VIDEOS" = "İlgili videoları gizle";+"HIDE_RELATED_VIDEOS_DESC" = "Oynatıcının altındaki ilgili videoları gizler. (Katman içinde değil)";++"PLAYER" = "Oynatıcı";+"PLAYBACK_SPEED" = "Oynatma hızı";+"CONTROL_CENTER" = "Denetim Merkezi";+"PLAYER_ACTIONS" = "Oynatıcı eylemleri";+"GESTURE_HEADER" = "Hareketler";+"QUALITY_WIFI" = "Wi-Fi'da oynatma kalitesi";+"QUALITY_WIFI_DESC" = "Wi-Fi üzerinden yayın yaparken seçilen kaliteyi otomatik olarak uygular.";+"QUALITY_CELLULAR" = "Hücresel veride oynatma kalitesi";+"QUALITY_CELLULAR_DESC" = "Mobil veri üzerinden yayın yaparken seçilen kaliteyi otomatik olarak uygular.";+"QUALITY_LOW_POWER" = "Düşük güç modunda oynatma kalitesi";+"QUALITY_LOW_POWER_DESC" = "Cihazınızda Düşük Güç Modu etkinleştirildiğinde seçilen kaliteyi otomatik olarak uygular.";+"DEFAULT" = "Varsayılan";+"BEST" = "En iyi";+"AUDIO_TRACK" = "Tercih edilen ses parçası";+"ORIGINAL" = "Orijinal";+"SELECT_MANUALLY" = "Manuel seç";+"AUDIO_TRACK_SELECT" = "Seçilen ses parçası";+"AUDIO_TRACK_SELECT_DESC" = "Mevcutsa, oynatma için kullanılacak tercih edilen ses parçası dilini belirtir.";+"NO_AUTO_DUBBED" = "Orijinal ses parçasını kullan";+"NO_AUTO_DUBBED_DESC" = "Tercih edilen dil parçası otomatik seslendirilmişse veya bulunamazsa orijinal ses parçasını kullanır.";+"CAPTION_TRACK" = "Tercih edilen altyazı";+"CAPTION_TRACK_SELECT" = "Seçilen altyazı";+"CAPTION_TRACK_SELECT_DESC" = "Mevcutsa, görüntülenecek tercih edilen altyazı dilini belirtir.";+"DISABLES_CAPTION_TRACK" = "Altyazıları otomatik devre dışı bırak";+"DISABLES_CAPTION_TRACK_DESC" = "Tercih edilen dil otomatik oluşturulmuşsa veya bulunamazsa altyazıları otomatik olarak devre dışı bırakır.";+"DEFAULT_SPEED" = "Varsayılan oynatma hızı";+"DEFAULT_SPEED_DESC" = "Varsayılan oynatma hızını geçersiz kılar.";+"QUALITY_BUTTON" = "Kalite kontrolleri";+"SPEED_BUTTON" = "Hız kontrolleri";+"MUTE_BUTTON" = "Sessiz";+"SHARE_BUTTON" = "Paylaş";+"LOOP_BUTTON" = "Döngü";+"CAPTION_BUTTON" = "Altyazılar";+"DOWNLOAD_BUTTON" = "İndir";+"SPONSORBLOCK_BUTTON" = "SponsorBlock";+"MANAGE_OVERLAY_BUTTONS" = "Katman butonlarını yönet";+"MANAGE_OVERLAY_BUTTONS_DESC" = "Katman butonlarını yeniden sıralayın ve açıp kapatın";+"OVERLAY_BUTTON_REORDER_HINT" = "Katman butonlarını yeniden sıralamak için sürükleyin. Göstermek/gizlemek için anahtarı kullanın.";+"HOLD_TO_SPEED" = "Hızlandırmak için basılı tut";+"HOLD_TO_SPEED_DESC" = "Özel basılı tutarak hızlandırma oranını kullanır.";+"HIDE_AUTOPLAY" = "Otomatik oynatma anahtarını gizle";+"HIDE_AUTOPLAY_DESC" = "Video katmanındaki otomatik oynatma anahtarını gizler.";+"HIDE_CAPTIONS_BUTTON" = "Altyazı butonunu gizle";+"HIDE_CAPTIONS_BUTTON_DESC" = "Video katmanındaki altyazı butonunu gizler.";+"HIDE_CAST_BUTTON_PLAYER" = "Yayınla butonunu gizle";+"HIDE_CAST_BUTTON_PLAYER_DESC" = "Video katmanındaki yayınla butonunu gizler.";+"HIDE_NEXT_AND_PREV_BUTTON" = "Önceki ve sonraki butonları gizle";+"HIDE_NEXT_AND_PREV_BUTTON_DESC" = "Video katmanındaki önceki ve sonraki butonlarını gizler.";+"REPLACE_PREVNEXT_BUTTONS" = "Önceki/Sonraki butonlarını değiştir";+"REPLACE_PREVNEXT_BUTTONS_DESC" = "Oynatıcıdaki Önceki ve Sonraki video butonlarını Geri Sar ve Hızlı İleri Sar butonlarıyla değiştirir.";+"REMOVE_DARK_OVERLAY" = "Karanlık katmanı kaldır";+"REMOVE_DARK_OVERLAY_DESC" = "Video katmanındaki karartılmış arka planı kaldırır.";+"HIDE_END_SCREEN" = "Bitiş ekranı kartlarını gizle";+"HIDE_END_SCREEN_DESC" = "Video bitmeden önce gösterilen bitiş ekranı kartlarını gizler.";+"REMOVE_AMBIANT" = "Işık efektini kaldır";+"REMOVE_AMBIANT_DESC" = "Video oynatıcının arkasındaki parlayan ortam ışığı efektlerini kaldırır.";+"HIDE_SUGGESTED_VIDEO" = "Önerilen videoları gizle";+"HIDE_SUGGESTED_VIDEO_DESC" = "Video bittiğinde görünen önerilen videolar ızgarasını gizler.";+"HIDE_PAID_OVERLAY" = "'Ücretli tanıtım içerir' yazısını gizle";+"HIDE_PAID_OVERLAY_DESC" = "Video katmanındaki 'Ücretli tanıtım içerir' uyarısını gizler.";+"HIDE_WATERMARK" = "Filigranı gizle";+"HIDE_WATERMARK_DESC" = "Video katmanının altındaki kanal filigranını gizler.";+"PAUSE_ON_OVERLAY" = "Katman açıldığında duraklat";+"PAUSE_ON_OVERLAY_DESC" = "Katman görünürse oynatmayı duraklatır.";+"DISABLES_SNAP_TO_CHAPTER" = "Bölümlere yapışmayı devre dışı bırak";+"DISABLES_SNAP_TO_CHAPTER_DESC" = "İlerleme çubuğunun video bölümlerine takılmasını/yapışmasını engeller.";+"DISABLES_ENGAGE_PANEL" = "Tam ekranda etkileşim panelini devre dışı bırak";+"DISABLES_ENGAGE_PANEL_DESC" = "Tam ekranda etkileşim panelinin gösterilmesini engeller.";+"GESTURES" = "Hareket kontrollerini etkinleştir";+"GESTURES_DESC" = "Parlaklığı, ses düzeyini veya oynatma hızını ayarlamak için video ekranının sol/sağ kenarlarında yukarı veya aşağı kaydırın.";+"GESTURE_AREA" = "Hareket etkinleştirme alanı";+"GESTURE_AREA_DESC" = "Hareketlerin etkin olduğu kenar alanını ayarlayın. (%50 olarak ayarlanması, ortada ölü bölge kalmayacak şekilde ekranı ikiye böler.)";+"LEFT_SIDE_GESTURE" = "Sol taraf kaydırma hareketi";+"RIGHT_SIDE_GESTURE" = "Sağ taraf kaydırma hareketi";+"GESTURE_BRIGHTNESS" = "Parlaklık";+"GESTURE_VOLUME" = "Ses Düzeyi";+"GESTURE_SPEED" = "Oynatma hızı";+"GESTURE_NONE" = "Hiçbiri";+"GESTURE_HUD" = "Hareket göstergesini göster";+"GESTURE_HUD_DESC" = "Parlaklığı, sesi veya oynatma hızını ayarlarken ekranda mevcut yüzdeyi (%) görüntüler.";+"GESTURE_HUD_SIZE" = "Hareket göstergesi boyutu";+"GESTURE_HUD_SIZE_DESC" = "Hareket göstergesinin metin ve simge boyutunu ayarlayın.";+"SMALL" = "Küçük (-1)";+"NORMAL" = "Normal (Varsayılan)";+"LARGE" = "Büyük (+1)";+"EXTRALARGE" = "Çok Büyük (+2)";+"MAX" = "Maksimum (+3)";+"GESTURE_HUD_POSITION" = "Hareket göstergesi konumu";+"GESTURE_HUD_POSITION_DESC" = "Hareket göstergesinin dikey konumunu ayarlayın (Üst, Orta, Alt).";+"TOP" = "Üst";+"MIDDLE" = "Orta";+"BOTTOM" = "Alt";+"DISABLES_DOUBLE_TAP" = "Çift dokunmayı devre dışı bırak";+"DISABLES_DOUBLE_TAP_DESC" = "Video katmanında sarmak için çift dokunmayı devre dışı bırakır.";+"DISABLES_LONG_HOLD" = "Uzun basmayı devre dışı bırak";+"DISABLES_LONG_HOLD_DESC" = "Video katmanında videoyu hızlandırmak için uzun basmayı devre dışı bırakır.";+"AUTO_EXIT_FULLSCREEN" = "Tam ekrandan otomatik çık";+"AUTO_EXIT_FULLSCREEN_DESC" = "Video bittikten sonra tam ekran modundan otomatik olarak çıkar.";+"AUTO_FEED_MUTE" = "Akış videolarını otomatik sessize al";+"AUTO_FEED_MUTE_DESC" = "Akışta oynatılan videoları otomatik olarak sessize alır.";+"DISABLES_SHOW_REMAINING" = "Kalan süreyi devre dışı bırak";+"DISABLES_SHOW_REMAINING_DESC" = "Zaman damgasına dokunulduğunda videoda ne kadar süre kaldığını gösteren özelliği devre dışı bırakır.";+"ALWAYS_SHOW_REMAINING" = "Her zaman kalan süreyi göster";+"ALWAYS_SHOW_REMAINING_DESC" = "Oynatıcı katmanında kalan sürenin varsayılan olarak her zaman gösterilmesini sağlar.";+"COPY_TIMESTAMP_ON_PAUSE" = "Zaman damgalı bağlantıları kopyala";+"COPY_TIMESTAMP_ON_PAUSE_DESC" = "Duraklat butonuna basarak zaman damgalı bağlantının panoya kopyalanmasını sağlar.";+"SHOW_REMAINING_EXTRA" = "Ek kalan süreyi göster";+"SHOW_REMAINING_EXTRA_DESC" = "Video katmanındaki etikete tahmini bitiş saatini ekler.";+"HIDE_FULLSCREEN_ACTIONS" = "Tam ekran eylemlerini gizle";+"HIDE_FULLSCREEN_ACTIONS_DESC" = "Video tam ekran modundayken hızlı eylem butonlarını (Beğen, Beğenme, Daha fazla video vb.) gizler.";+"HIDE_FULL_VID_TITLE" = "Tam ekran video başlığını gizle";+"HIDE_FULL_VID_TITLE_DESC" = "Tam ekran modunda sol üstte görüntülenen video başlığını gizler.";+"STOP_AUTOPLAY_VIDEO" = "Otomatik oynatmayı devre dışı bırak";+"STOP_AUTOPLAY_VIDEO_DESC" = "Video açıldığında otomatik olarak oynatılmasını engeller.";+"HIDE_CONTENT_WARNING" = "İçerik uyarısını atla";+"HIDE_CONTENT_WARNING_DESC" = "Bazı videolardaki hassas içerik uyarısını otomatik olarak atlar.";+"AUTO_FULLSCREEN" = "Otomatik tam ekran";+"AUTO_FULLSCREEN_DESC" = "Video oynatılmaya başladığında otomatik olarak tam ekran moduna geçer.";+"PORTRAIT_FULLSCREEN" = "Dikey tam ekran modu";+"PORTRAIT_FULLSCREEN_DESC" = "Dikey tam ekran modu desteğini etkinleştirir.";+"OLD_QUALITY_PICKER" = "Eski kalite seçiciyi kullan";+"OLD_QUALITY_PICKER_DESC" = "Video kalitesi seçim menüsünü klasik sürüme döndürür (tüm çözünürlükleri hemen listeler).";+"EXTRA_SPEED" = "Ekstra hız seçenekleri";+"EXTRA_SPEED_DESC" = "10 kata kadar daha fazla video oynatma hızı seçeneği ekler.";+"FORCE_MINIPLAYER" = "Mini oynatıcıyı zorla";+"FORCE_MINIPLAYER_DESC" = "Çocuklara özel videolar da dahil tüm videoların oynatıcı kapatıldığında mini oynatıcıda çalınmasına izin verir.";+"FORCE_SEEKBAR" = "İlerleme çubuğunu her zaman göster";+"FORCE_SEEKBAR_DESC" = "Tam ekran modundayken ilerleme çubuğunun her zaman görünür kalmasını sağlar.";+"TAP_TO_SEEK" = "Dokunarak sar";+"TAP_TO_SEEK_DESC" = "İlerleme çubuğuna dokunarak herhangi bir noktaya hızlıca atlayın.";+"DISABLES_ZOOM" = "Serbest yakınlaştırma hareketini devre dışı bırak";+"DISABLES_ZOOM_DESC" = "Yeni serbest yakınlaştırma hareketlerini devre dışı bırakır.";+"USES_24_HOURS_TIME" = "24 saat biçimi";+"USES_24_HOURS_TIME_DESC" = "Bitiş saatini 24 saatlik biçimde gösterir.";+"PAUSE_TWO_FINGERS" = "İki parmakla duraklat";+"PAUSE_TWO_FINGERS_DESC" = "Ekrana iki parmakla dokunarak oynatmayı duraklatır/sürdürür.";+"SKIP_BACKWARD" = "Geri sar";+"SKIP_BACKWARD_DESC" = "Denetim Merkezi'ndeki önceki parça butonunu belirlenen saniye kadar geri sarma butonuyla değiştirir.";+"SKIP_FORWARD" = "İleri sar";+"SKIP_FORWARD_DESC" = "Denetim Merkezi'ndeki sonraki parça butonunu belirlenen saniye kadar ileri sarma butonuyla değiştirir.";+"REWIND_SECONDS" = "Geri sarma saniyesi";+"FORWARD_SECONDS" = "İleri sarma saniyesi";+"HIDE_COMMENTS_SECTION" = "Yorumlar bölümünü gizle";+"HIDE_COMMENTS_SECTION_DESC" = "Yorumlar bölümünü tamamen kaldırır.";+"HIDE_COMMENTS_PREVIEW" = "Önizleme yorumlarını gizle";+"HIDE_COMMENTS_PREVIEW_DESC" = "En üstteki yorum için önizleme kutusunu kaldırır, ancak tüm bölümün genişletilebilir olmasını sağlar.";+"LOCK_SPEED" = "Hızı kilitle";+"LOCK_SPEED_DESC" = "Aşağı kaydırarak ayarlanan hızı kilitler.";+"SEEK_ON_OVERLAY" = "Katman üzerinde sarma";+"SEEK_ON_OVERLAY_DESC" = "Video katmanında sola ve sağa kaydırarak oynatmayı ileri/geri sarmaya izin verir.";+"DRC_AUDIO_OPTIONS" = "Otomatik Kararlı Ses Düzeyi";+"DRC_AUDIO_OPTIONS_DESC" = "Kararlı Ses Düzeyi özelliğinin etkinleştirilip etkinleştirilmeyeceğini otomatik olarak seçer.";+"REMOVE_VIDEO_LIKE_BUTTON" = "Beğen butonunu kaldır";+"REMOVE_VIDEO_LIKE_BUTTON_DESC" = "Video oynatıcının altındaki ve tam ekran katmanındaki beğen butonunu kaldırır.";+"REMOVE_VIDEO_DISLIKE_BUTTON" = "Beğenme butonunu kaldır";+"REMOVE_VIDEO_DISLIKE_BUTTON_DESC" = "Video oynatıcının altındaki ve tam ekran katmanındaki beğenme butonunu kaldırır.";+"REMOVE_VIDEO_SHARE_BUTTON" = "Paylaş butonunu kaldır";+"REMOVE_VIDEO_SHARE_BUTTON_DESC" = "Video oynatıcının altındaki ve tam ekran katmanındaki paylaş butonunu kaldırır.";+"REMOVE_VIDEO_SAVE_BUTTON" = "Kaydet butonunu kaldır";+"REMOVE_VIDEO_SAVE_BUTTON_DESC" = "Video oynatıcının altındaki ve tam ekran katmanındaki oynatma listesine kaydet butonunu kaldırır.";+"REMOVE_VIDEO_DOWNLOAD_BUTTON" = "İndir butonunu kaldır";+"REMOVE_VIDEO_DOWNLOAD_BUTTON_DESC" = "Video oynatıcının altındaki ve tam ekran katmanındaki indir butonunu kaldırır.";+"REMOVE_VIDEO_CLIP_BUTTON" = "Klip butonunu kaldır";+"REMOVE_VIDEO_CLIP_BUTTON_DESC" = "Video oynatıcının altındaki ve tam ekran katmanındaki klip butonunu kaldırır.";+"REMOVE_VIDEO_REMIX_BUTTON" = "Remiks butonunu kaldır";+"REMOVE_VIDEO_REMIX_BUTTON_DESC" = "Video oynatıcının altındaki ve tam ekran katmanındaki remiks butonunu kaldırır.";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON" = "Canlı sohbet butonunu kaldır";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON_DESC" = "Video oynatıcının altındaki ve tam ekran katmanındaki canlı sohbet butonunu kaldırır.";++"SHORTS" = "Shorts";+"HIDE_SHORTS_TOPBAR" = "Üst çubuğu gizle";+"HIDE_SHORTS_TOPBAR_DESC" = "Oynatıcıdaki tüm üst çubuk görünümünü gizler.";+"HIDE_SHORTS_SUBBAR" = "Alt çubuğu gizle";+"HIDE_SHORTS_SUBBAR_DESC" = "Oynatıcıdaki Shorts tür çubuğunu gizler.";+"SHORTS_ONLY" = "Yalnızca Shorts modu";+"SHORTS_ONLY_DESC" = "YouTube işlevselliğini yalnızca Shorts izleme ile sınırlar. Shorts oynatıcısında iki parmakla uzun basarak bu modu devre dışı bırakabilirsiniz.";+"SHORTS_ONLY_DISABLED" = "Yalnızca Shorts modu kapatıldı";+"SHORTS_ACTION" = "Video bittikten sonraki Shorts eylemi";+"LOOP" = "Döngü";+"SKIP_TO_NEXT_SHORTS" = "Sonrakine geç";+"PAUSE_SHORTS" = "Durdur";+"REMOVE_LIVE_SHORTS" = "Canlı videoları kaldır";+"REMOVE_LIVE_SHORTS_DESC" = "Canlı videoları akıştan kaldırır.";+"HIDE_SHORTS_PRODUCT" = "Ürünleri gizle";+"HIDE_SHORTS_PRODUCT_DESC" = "Shorts katmanındaki etiketlenmiş ürünleri ve alışveriş bağlantılarını gizler.";+"HIDE_SHORTS_RECBAR" = "Öneri çubuğunu gizle";+"HIDE_SHORTS_RECBAR_DESC" = "Shorts oynatıcıdaki önerilen eylem çubuğunu gizler (ör. Bu sesi dene, Alışveriş, Yorumu önizle).";+"HIDE_SHORTS_DISCLOSURE" = "'Komisyon kazanır' uyarısını gizle";+"HIDE_SHORTS_DISCLOSURE_DESC" = "Shorts'taki 'Komisyon kazanır' açıklama katmanını gizler.";+"REMOVE_SHORTS_LIKE_BUTTON" = "Beğen butonunu kaldır";+"REMOVE_SHORTS_LIKE_BUTTON_DESC" = "Beğen butonunu Shorts katmanından kaldırır.";+"REMOVE_SHORTS_COMMENT_BUTTON" = "Yorum butonunu kaldır";+"REMOVE_SHORTS_COMMENT_BUTTON_DESC" = "Yorum butonunu Shorts katmanından kaldırır.";+"REMOVE_SHORTS_SHARE_BUTTON" = "Paylaş butonunu kaldır";+"REMOVE_SHORTS_SHARE_BUTTON_DESC" = "Paylaş butonunu Shorts katmanından kaldırır.";+"REMOVE_SHORTS_REMIX_BUTTON" = "Remiks butonunu kaldır";+"REMOVE_SHORTS_REMIX_BUTTON_DESC" = "Remiks butonunu Shorts katmanından kaldırır.";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON" = "Ses bilgisi butonunu kaldır";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON_DESC" = "Ses bilgisi butonunu Shorts katmanından kaldırır.";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON" = "Abonelikler butonunu kaldır";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON_DESC" = "Shorts duraklatma başlığından abonelikler butonunu kaldırır.";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON" = "Canlı butonunu kaldır";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON_DESC" = "Shorts duraklatma başlığından canlı butonunu kaldırır.";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON" = "Lens butonunu kaldır";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON_DESC" = "Shorts duraklatma başlığından lens butonunu kaldırır.";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON" = "Trendler butonunu kaldır";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON_DESC" = "Shorts duraklatma başlığından trendler butonunu kaldırır.";+"ENABLES_SHORTS_QUALITY" = "Shorts kalite seçiciyi etkinleştir";+"ENABLES_SHORTS_QUALITY_DESC" = "Shorts'ta video kalitesi seçim menüsünü zorla etkinleştirir.";+"SHOW_SHORTS_SEEKBAR" = "İlerleme çubuğunu her zaman göster";+"SHOW_SHORTS_SEEKBAR_DESC" = "İlerleme çubuğunun Shorts oynatıcısının altında her zaman görünür olmasını sağlar.";+"REMOVE_POSTS_SHORTS" = "Gönderileri kaldır";+"REMOVE_POSTS_SHORTS_DESC" = "Gönderileri akıştan kaldırır.";+"SHORTS_FULLSCREEN" = "Sıkıştırarak Tam Ekran Yap";+"SHORTS_FULLSCREEN_DESC" = "İçe ve dışa çimdikleme hareketleriyle katmanın görünürlüğünü yöneterek Shorts videolarını tam ekran modunda görüntüler.";++"TABBAR" = "Sekme çubuğu";+"DEFAULT_TAB" = "Varsayılan başlangıç sekmesi";+"FORSTED_TAB_BAR" = "Yarı saydam sekme çubuğu";+"ENABLED" = "Etkin";+"HOME_TAB" = "Ana Sayfa";+"SHORTS_TAB" = "Shorts";+"CREATE_TAB" = "Oluştur";+"SUBSCRIPTIONS_TAB" = "Abonelikler";+"LIBRARY_TAB" = "Kitaplık (Siz)";+"HIDE_TAB_INDI" = "Sekme göstergelerini gizle";+"HIDE_TAB_INDI_DESC" = "Sekme çubuğundaki tüm sekme göstergelerini gizler.";+"HIDE_TAB_LABELS" = "Sekme etiketlerini gizle";+"HIDE_TAB_LABELS_DESC" = "Sekme çubuğundaki tüm sekme etiketlerini gizler.";+"HISTORY_TAB" = "Geçmiş";+"GAMING_TAB" = "Oyun";+"SPORTS_TAB" = "Spor";+"NOTI_TAB" = "Bildirimler";+"NEWS_TAB" = "Haberler";+"MUSIC_TAB" = "Müzik";+"WATCH_LATER_TAB" = "Daha sonra izle";+"PLAYLIST_TAB" = "Oynatma listeleri";+"LIKE_TAB" = "Beğenilen videolar";+"LIVE_TAB" = "Canlı";+"POST_TAB" = "Gönderiler";+"VIDEO_TAB" = "Videolarınız";+"MOVIE_TAB" = "Filmler";+"COURSE_TAB" = "Kurslar";+"MINIGAME_TAB" = "Oynatılabilirler";+"FASHION_TAB" = "Moda ve Güzellik";+"LEARNING_TAB" = "Öğrenme";+"MANAGE_TABS" = "Sekmeleri yönet";+"MANAGE_TABS_DESC" = "Sekmeleri yeniden sıralayın ve açıp kapatın";+"TAB_REORDER_HINT" = "Yeniden sıralamak için sürükleyin. Göstermek/gizlemek için anahtarı kullanın.\\nSekme ayarlarına sekme çubuğundaki ilk sekmeye uzun basarak da erişilebilir.";+"TAB_LIMIT" = "Sekme sınırı";+"TAB_LIMIT_DESC" = "En fazla 6 sekmeye izin verilir.";+"ZERO_TAB_DESC" = "En az 1 sekmenin etkin olması gerekir.";++"MISCELLANEOUS" = "Çeşitli";+"BACKGROUND_PLAYBACK" = "Arka planda oynatma";+"BACKGROUND_PLAYBACK_DESC" = "Videolar için arka planda oynatmayı etkinleştirir.";+"DISABLES_SHORTS_PIP" = "Shorts PiP'i devre dışı bırak";+"DISABLES_SHORTS_PIP_DESC" = "Shorts PiP (Resim içinde Resim) modunu devre dışı bırakmayı dener, tamamen engellemeyebilir.";+"DISABLE_HINTS" = "İpuçlarını devre dışı bırak";+"DISABLE_HINTS_DESC" = "Eğitim ipuçlarını ve etkileşimli pencereleri devre dışı bırakır.";+"BLOCK_UPGRADE_DIALOGS" = "Güncelleme pencerelerini engelle";+"BLOCK_UPGRADE_DIALOGS_DESC" = "YouTube'un uygulamayı güncellemenizi isteyen pencerelerini engeller.";+"ARE_YOU_THERE_DIALOG" = "'Orada mısınız?' penceresini gizle";+"ARE_YOU_THERE_DIALOG_DESC" = "Uygulamada uzun süre işlem yapmadığınızda çıkan pencereyi gizler.";+"FIXES_SLOW_MINIPLAYER" = "Yavaş mini oynatıcıyı düzelt";+"FIXES_SLOW_MINIPLAYER_DESC" = "Videoyu büyütürken mini oynatıcıda yaşanan yavaşlamayı düzeltir, yalnızca eski YouTube sürümlerinde çalışır.";+"DISABLES_NEW_MINIPLAYER" = "Yeni mini oynatıcıyı devre dışı bırak";+"DISABLES_NEW_MINIPLAYER_DESC" = "Yeni stil yerine eski stil mini oynatıcıyı kullanır, yalnızca eski YouTube sürümlerinde çalışır.";+"DISABLES_SNACK_BAR" = "Açılır bildirim çubuğunu devre dışı bırak";+"DISABLES_SNACK_BAR_DESC" = "Bazı butonlara basıldığında veya işlem yapıldığında çıkan alt bildirim çubuğunu devre dışı bırakır.";+"HIDE_STARTUP_ANIMATIONS" = "YouTube başlangıç animasyonlarını gizle";+"HIDE_STARTUP_ANIMATIONS_DESC" = "Uygulama açılırken YouTube'un başlangıç animasyonlarını gizler.";+"HIDE_LIKE_DISLIKE_VOTES" = "Beğenme/Beğenmeme bildirimlerini gizle";+"HIDE_LIKE_DISLIKE_VOTES_DESC" = "Videoları beğendiğinizde/beğenmediğinizde çıkan bildirim mesajlarını gizler.";+"FLYOUT_MENU" = "Açılır menü";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION" = "'Sırada ilk olarak oynat' seçeneğini kaldır";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION_DESC" = "Açılır menüden 'Sırada ilk olarak oynat' seçeneğini kaldırır.";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION" = "'Sırada son olarak oynat' seçeneğini kaldır";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION_DESC" = "Açılır menüden 'Sırada son olarak oynat' seçeneğini kaldırır.";+"REMOVE_DOWNLOAD_OPTION" = "'Videoyu indir' seçeneğini kaldır";+"REMOVE_DOWNLOAD_OPTION_DESC" = "Açılır menüden 'Videoyu indir' seçeneğini kaldırır.";+"REMOVE_WATCH_LATER_OPTION" = "'Daha sonra izle'ye kaydet' seçeneğini kaldır";+"REMOVE_WATCH_LATER_OPTION_DESC" = "Açılır menüden 'Daha Sonra İzle'ye kaydet' seçeneğini kaldırır.";+"REMOVE_SAVE_OPTION" = "'Oynatma listesine kaydet' seçeneğini kaldır";+"REMOVE_SAVE_OPTION_DESC" = "Açılır menüden 'Oynatma listesine kaydet' seçeneğini kaldırır.";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION" = "'Oynatma listesinden çıkar' seçeneğini kaldır";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION_DESC" = "Açılır menüden 'Oynatma listesinden çıkar' seçeneğini kaldırır.";+"REMOVE_SHARE_OPTION" = "'Paylaş' seçeneğini kaldır";+"REMOVE_SHARE_OPTION_DESC" = "Açılır menüden 'Paylaş' seçeneğini kaldırır.";+"REMOVE_NOT_INTERESTED_OPTION" = "'İlgilenmiyorum' seçeneğini kaldır";+"REMOVE_NOT_INTERESTED_OPTION_DESC" = "Açılır menüden 'İlgilenmiyorum' seçeneğini kaldırır.";+"REMOVE_DONT_RECOMMEND_OPTION" = "'Kanalı önerme' seçeneğini kaldır";+"REMOVE_DONT_RECOMMEND_OPTION_DESC" = "Açılır menüden 'Kanalı önerme' seçeneğini kaldırır.";+"REMOVE_INFO_OPTION" = "'Bunu neden görüyorsunuz?' seçeneğini kaldır";+"REMOVE_INFO_OPTION_DESC" = "Açılır menüden 'Bunu neden görüyorsunuz?' seçeneğini kaldırır.";+"REMOVE_FILTER_OPTION" = "'Arama filtreleri' seçeneğini kaldır";+"REMOVE_FILTER_OPTION_DESC" = "Açılır menüden 'Arama filtreleri' seçeneğini kaldırır.";+"REMOVE_REPORT_OPTION" = "'Bildir' seçeneğini kaldır";+"REMOVE_REPORT_OPTION_DESC" = "Açılır menüden 'Bildir' seçeneğini kaldırır.";+"REMOVE_YOUTUBE_MUSIC_OPTION" = "'YouTube Music ile dinle' seçeneğini kaldır";+"REMOVE_YOUTUBE_MUSIC_OPTION_DESC" = "Açılır menüden 'YouTube Music ile dinle' seçeneğini kaldırır.";+"REMOVE_FEED_BACK_OPTION" = "'Geri bildirim gönder' seçeneğini kaldır";+"REMOVE_FEED_BACK_OPTION_DESC" = "Açılır menüden 'Geri bildirim gönder' seçeneğini kaldırır.";+"REMOVE_CAST_OPTION" = "'TV'de izle' seçeneğini kaldır";+"REMOVE_CAST_OPTION_DESC" = "Açılır menüden 'TV'de izle' seçeneğini kaldırır.";+"REMOVE_SHUFFLE_OPTION" = "'Karıştır' seçeneğini kaldır";+"REMOVE_SHUFFLE_OPTION_DESC" = "Açılır menüden 'Karıştır' seçeneğini kaldırır.";+"REMOVE_UN_SUB_OPTION" = "'Abonelikten çık' seçeneğini kaldır";+"REMOVE_UN_SUB_OPTION_DESC" = "Açılır menüden 'Abonelikten çık' seçeneğini kaldırır.";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION" = "'Videoyu oynatma listesinden gizle' seçeneğini kaldır";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION_DESC" = "Açılır menüden 'Videoyu oynatma listesinden gizle' seçeneğini kaldırır.";+"REMOVE_HELP_OPTION" = "'Yardım ve geri bildirim' seçeneğini kaldır";+"REMOVE_HELP_OPTION_DESC" = "Açılır menüden 'Yardım ve geri bildirim' seçeneğini kaldırır.";+"REMOVE_NOTIFY_OPTION" = "'Bana bildir' seçeneğini kaldır";+"REMOVE_NOTIFY_OPTION_DESC" = "Açılır menüden 'Bana bildir' seçeneğini kaldırır.";+"REMOVE_CLEARSCREEN_OPTION" = "'Ekranı temizle' seçeneğini kaldır";+"REMOVE_CLEARSCREEN_OPTION_DESC" = "Açılır menüden 'Ekranı temizle' seçeneğini kaldırır.";+"HIDE_COMMU_GUIDE" = "Topluluk kurallarını gizle";+"HIDE_COMMU_GUIDE_DESC" = "Topluluk kuralları üst bilgisini gizler.";+"HIDE_ENGAGEMENT_SUBBAR" = "Yorumlar üst bilgisini gizle";+"HIDE_ENGAGEMENT_SUBBAR_DESC" = "Yorum sıralama üst bilgisini (En popüler, En yeni) asla görünmeyecek şekilde gizler.";+"DISABLES_RTL" = "RTL biçimlendirmesini devre dışı bırak";+"DISABLES_RTL_DESC" = "Sağdan sola (RTL) yazılan dillerdeki metinleri zorla soldan sağa (LTR) biçimde görüntüler.";+"DEVICE_UI" = "Arayüz stili";+"OPEN_LINK" = "Bağlantıyı aç";+"FLOATING_KEYBOARD" = "Yüzen klavye";+"FLOATING_KEYBOARD_DESC" = "Yüzen klavyeyi zorla etkinleştirir. iPad stili taklidi yapılan iPhone'lar için kullanışlıdır.\\nNot: YALNIZCA iPad stili seçildiğinde çalışır.";+"AUTO_OPEN_LINK" = "Panoyu otomatik kontrol et";+"AUTO_OPEN_LINK_DESC" = "Uygulama her açıldığında panoda YouTube ile ilgili bağlantı olup olmadığını kontrol eder.\\nDüzgün çalışması için iOS Ayarları → YouTube → Diğer Uygulamalardan Yapıştır bölümüne gidip 'Izin Ver'i seçin.";++"SB_DESCRIPTION" = "Topluluk tarafından gönderilen verileri kullanarak sponsorlu bölümleri otomatik olarak atlayın.";+"SB_ENABLE" = "SponsorBlock'u Etkinleştir";+"SB_ENABLE_DESC" = "Sponsorlu bölümleri atlamak için SponsorBlock eklentisini etkinleştirin.";+"SB_SHOW_BUTTON" = "Katman butonunu göster";+"SB_SHOW_BUTTON_DESC" = "Oynatıcı katmanında bir SponsorBlock açma/kapama butonu görüntüler.";+"SB_SHOW_NOTIFICATIONS" = "Bildirimleri göster";+"SB_SHOW_NOTIFICATIONS_DESC" = "Bölümler atlandığında bildirim görüntüler. Manuel atlama kategorileri için bildirimler her zaman gösterilir.";+"SB_HAPTIC_FEEDBACK" = "Titreşimli geri bildirim";+"SB_HAPTIC_FEEDBACK_DESC" = "Bir bölüm atlandığında dokunsal (titreşimli) geri bildirim sağlar.";+"SB_SEGMENTS_IN_PLAYER" = "Oynatıcıdaki bölümler";+"SB_SEGMENTS_IN_PLAYER_DESC" = "Ana video oynatıcının ilerleme çubuğunda renkli bölümleri görüntüler.";+"SB_SEGMENTS_IN_FEED" = "Akıştaki bölümler";+"SB_SEGMENTS_IN_FEED_DESC" = "Akıştaki oynatıcıların ilerleme çubuğunda renkli bölümleri görüntüler.";+"SB_SEGMENTS_IN_MINIPLAYER" = "Mini oynatıcıdaki bölümler";+"SB_SEGMENTS_IN_MINIPLAYER_DESC" = "Mini oynatıcının ilerleme çubuğunda renkli bölümleri görüntüler.";+"SB_SHOW_DURATION" = "Bölümler hariç süreyi göster";+"SB_SHOW_DURATION_DESC" = "Atlanabilir bölümler hariç toplam video süresini görüntüler.";+"SB_CATEGORIES_HEADER" = "Bölüm kategorileri";+"SB_SEGMENT_COLOR" = "Bölüm rengi";++"SB_ACTION_DISABLE" = "Devre dışı";+"SB_ACTION_AUTO_SKIP" = "Otomatik atla";+"SB_ACTION_ASK" = "Atlamadan önce sor";+"SB_ACTION_DISPLAY" = "Yalnızca ilerleme çubuğunda göster";+"SB_ACTION_SKIP_TO" = "Bölüme atla";++"SB_CAT_sponsor" = "Sponsor";+"SB_CAT_sponsor_DESC" = "İçerik üreticisiyle doğrudan ilgili olmayan bir ürün veya hizmet için yapılan ücretli tanıtım.";+"SB_CAT_intro" = "Giriş / İntro";+"SB_CAT_intro_DESC" = "Genellikle videonun başında görünen ara veya giriş animasyonu.";+"SB_CAT_outro" = "Bitiş Ekranları / Outro";+"SB_CAT_outro_DESC" = "Videonun sonundaki bitiş kartları, jenerik veya bitiş sekansları.";+"SB_CAT_interaction" = "Etkileşim Hatırlatması";+"SB_CAT_interaction_DESC" = "Beğenme, abone olma veya sosyal medyada takip etme hatırlatıcıları.";+"SB_CAT_selfpromo" = "Kendi Tanıtımı";+"SB_CAT_selfpromo_DESC" = "İçerik üreticisinin kendi ürünlerinin, ürün satışlarının veya diğer içeriklerinin ücretsiz tanıtımı.";+"SB_CAT_music_offtopic" = "Müzik Dışı Bölüm";+"SB_CAT_music_offtopic_DESC" = "Müzik videolarındaki müzik dışı bölümler (ör. konuşma, girişler).";+"SB_CAT_preview" = "Önizleme";+"SB_CAT_preview_DESC" = "Başka bir videodan veya önceki bölümden özet veya önizleme.";+"SB_CAT_hook" = "Kanca / Karşılama";+"SB_CAT_hook_DESC" = "Gelecek video için seslendirilen fragmanlar, selamlamalar ve vedalaşmalar.";+"SB_CAT_poi_highlight" = "Önemli An";+"SB_CAT_poi_highlight_DESC" = "Videonun kilit anı veya en önemli noktası. Doğrudan oraya atlamak için 'Şuraya atla' seçeneğini kullanın.";+"SB_CAT_filler" = "Boş / Konu Dışı";+"SB_CAT_filler_DESC" = "Ana konuyla doğrudan ilgili olmayan ikincil içerikler, şakalar veya dolgu maddeleri.";++"SB_SKIPPED" = "%@ bölümü atlandı";+"SB_DETECTED" = "%@ bölümü tespit edildi.\\nBölümü atlamak ister misiniz?";+"SB_SKIP_NOW" = "Atla";+"SB_UNSKIP" = "Geri al";+"SB_JUMPED_TO_HIGHLIGHT" = "Önemli ana atlandı";+"SB_JUMP_TO_HIGHLIGHT" = "Önemli an mevcut. O noktaya atlansın mı?";+"SB_SEGMENT_COLOR_SUFFIX" = "Bölüm rengi";+"SB_SECTION_MAIN" = "Ana";+"SB_SKIP_ALERT_DURATION" = "Atlama uyarısı süresi";+"SB_UNSKIP_ALERT_DURATION" = "Atlamayı geri alma uyarısı süresi";+"SB_MIN_DURATION_SLIDER" = "Atlanacak minimum bölüm süresi";diff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/vi.lproj/Localizable.strings b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/vi.lproj/Localizable.stringsnew file mode 100644index 0000000..a4eab7b--- /dev/null+++ b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/vi.lproj/Localizable.strings@@ -0,0 +1,578 @@+"SETTINGS" = "Cài đặt";+"INTERFACE" = "Giao diện";++"SEARCH" = "Tìm kiếm";+"SEARCH_DESC" = "Tìm kiếm trong cài đặt YouMod.";++"URL_COPIED" = "Đã sao chép liên kết video";+"COPY_URL" = "Sao chép liên kết video";+"COPY_URL_TIMESTAMP" = "Sao chép liên kết video kèm dấu thời gian";+"URL_TIMESTAMP_COPIED" = "Đã sao chép liên kết video kèm dấu thời gian";+"CANCEL" = "Hủy";+"ERROR" = "Lỗi";+"ERROR_VIDEOID" = "Không thể lấy ID video";+"ERROR_ADS" = "Không thể sao chép liên kết video khi đang phát quảng cáo";++"LOOP_DISABLED" = "Đã tắt phát lặp";+"LOOP_ENABLED" = "Đã bật phát lặp";++"NEW_ISSUES" = "Báo lỗi hoặc đề xuất tính năng mới";+"NEW_ISSUES_DESC" = "Phát hiện lỗi hoặc muốn đề xuất tính năng mới? Nhấn vào đây.";+"SOURCE_CODES" = "Mã nguồn";+"SOURCE_CODES_DESC" = "Mời bạn xem qua mã nguồn!";++"EXTRA" = "Thêm";+"FIX_PLAYBACK_ISSUES" = "Khắc phục lỗi phát video (tạm thời)";+"FIX_PLAYBACK_ISSUES_DESC" = "Thử khắc phục lỗi phát video đối với một số người dùng. Khi bật, trình phát sẽ tự động tải lại mỗi khi gặp lỗi hoặc không phát được video.";++"PERFER_HEADER" = "Tùy chọn YouMod";+"PERFER" = "Tùy chọn";+"IMPORT" = "Nhập cài đặt";+"IMPORT_DESC" = "Tải tùy chọn của bạn từ tệp .plist.";+"IMPORT_DONE" = "Thành công";+"YES" = "Có";+"APPLY_DESC" = "Cần khởi động lại ứng dụng. Bạn có muốn khởi động lại ngay bây giờ không?";+"EXPORT" = "Xuất cài đặt";+"EXPORT_DESC" = "Xuất tùy chọn của bạn ra tệp .plist.";+"RESTORE" = "Khôi phục cài đặt";+"RESTORE_DESC" = "Tải cài đặt mặc định như khi cài đặt mới.";+"WARNING" = "Cảnh báo";+"RESETDEFAULT" = "Thao tác này sẽ đặt lại toàn bộ cài đặt về mặc định. Bạn có muốn tiếp tục không?";+"ERROR_INVALID_FILE" = "Tệp không hợp lệ";+"ERROR_NO_KEYS_IMPORT" = "Không có khóa nào để nhập";+"ERROR_NO_KEYS_EXPORT" = "Không có khóa nào để xuất";+"OVERRIDE" = "Thao tác này sẽ ghi đè lên cài đặt hiện tại. Bạn có muốn tiếp tục không?";+"DISABLED" = "Đã tắt";++"CACHE" = "Quản lý bộ nhớ đệm";+"CLEARCACHE" = "Xóa bộ nhớ đệm";+"DONE" = "Xong";+"AUTO_CLEARCACHE" = "Tự động xóa bộ nhớ đệm";+"AUTO_CLEARCACHE_DESC" = "Tự động xóa bộ nhớ đệm của ứng dụng khi khởi động.";++"DOWNLOADING" = "Đang tải xuống";+"DOWNLOAD_MANAGER" = "Trình quản lý tải xuống";+"DOWNLOAD_MANAGER_DESC" = "Thay trình tải video của YouTube bằng trình tải của YouMod. Cho phép tải video, âm thanh, phụ đề và hình thu nhỏ.";+"POST_DOWNLOAD_ACTION" = "Hành động sau khi tải xuống";+"POST_ACTION_SAVE_PHOTOS" = "Lưu vào Ảnh";+"POST_ACTION_SHARE" = "Chia sẻ";+"POST_ACTION_ASK" = "Hỏi";+"ADD_SHORTS_DOWNLOAD" = "Thêm nút tải xuống vào Shorts";+"ADD_SHORTS_DOWNLOAD_DESC" = "Thêm nút tải xuống vào lớp phủ video Shorts.";+"DOWNLOAD_SHORTS" = "Tải Shorts";+"COPY_VID_INFO" = "Sao chép thông tin video";+"COPY_TITLE" = "Sao chép tiêu đề";+"COPY_DESCRIPTION" = "Sao chép mô tả";+"COPY_ALL_VID_INFO" = "Sao chép tất cả";+"COPIED_TITLE" = "Đã sao chép tiêu đề video";+"COPIED_DESCRIPTION" = "Đã sao chép mô tả video";+"COPY_AUTHOR" = "Sao chép tác giả";+"COPIED_AUTHOR" = "Đã sao chép tác giả video";+"SAVE_THUMBNAIL" = "Lưu hình thu nhỏ";+"DOWNLOAD_CAPTIONS" = "Tải phụ đề";+"DOWNLOAD_AUDIO" = "Tải âm thanh";+"DOWNLOAD_VIDEO" = "Tải video";+"OPEN_VID_BEFORE" = "Hãy mở một video trước khi dùng trình quản lý tải xuống";+"NO_CAPTIONS_URL" = "Không tìm thấy URL phụ đề hợp lệ";+"NO_AUDIO_URL" = "Không tìm thấy URL âm thanh";+"NO_STREAM_URL" = "Không tìm thấy URL luồng phát";+"CAPTIONS_FAILED" = "Tải phụ đề không thành công";+"NO_CAPTIONS" = "Không có phụ đề cho video này";+"NO_AUDIO_STREAM_FOUND" = "Không tìm thấy luồng âm thanh";+"NO_VID_AUDIO_STREAM_FOUND" = "Không tìm thấy luồng video/âm thanh";+"COPIED_VID_INFO" = "Đã sao chép toàn bộ thông tin video";+"SAVED_TO_PHOTOS" = "Đã lưu vào Ảnh";+"SAVE_FAILED" = "Lưu không thành công";+"PHOTO_ACCESS_DENINED" = "Đã từ chối quyền truy cập Ảnh";+"THUMBNAIL_FAILED" = "Hình thu nhỏ không thành công";+"DOWNLOADING_THUMBNAIL" = "Đang tải hình thu nhỏ...";+"DOWNLOADING_AUDIO" = "Đang tải âm thanh...";+"DOWNLOADING_VIDEO" = "Đang tải video...";+"DOWNLOADING_CAPTIONS" = "Đang tải phụ đề...";+"NO_THUMBNAIL_FOUND" = "Không tìm thấy hình thu nhỏ";+"DOWNLOAD_FAILED" = "Tải xuống không thành công";+"AUDIO_SAVED" = "Đã lưu âm thanh";+"DOWNLOAD_COMPLETED" = "Đã tải xuống xong";+"CANNOT_SAVE_TO_PHOTOS" = "Không thể lưu vào Ảnh";+"FINA_VIDEO" = "Đang hoàn tất video...";+"MERGING_VID_FALLBACK" = "Đang ghép video (chế độ dự phòng)...";+"MERGING_VID" = "Đang ghép video...";+"CONVERTING" = "Đang chuyển đổi sang";+"ALREADY_DOWNLOADING" = "Đang tải xuống rồi";+"DOWNLOAD_CANCELLED" = "Đã hủy tải xuống";+"TRIMMING_AUDIO" = "Đang cắt âm thanh...";+"SHOW_THUMBNAIL" = "Hiện hình thu nhỏ";+"COPY_THUMBNAIL" = "Sao chép hình thu nhỏ";+"THUMBNAIL_OPTIONS" = "Tải hình thu nhỏ";+"COPY" = "Sao chép";+"COPIED_TO_CLIPBOARD" = "Đã sao chép vào bảng tạm";+"CONNECTING_TO_SERVER" = "Đang kết nối tới máy chủ...";+"DOWNLOADING_TO_SERVER" = "Đang tải xuống máy chủ...";+"COPY_COMMENT_TEXT" = "Sao chép nội dung bình luận";+"SAVE_COMMENT_IMAGE" = "Lưu bình luận dưới dạng hình ảnh";+"COPY_COMMENT_IMAGE" = "Sao chép bình luận dưới dạng hình ảnh";+"COPY_POST_TEXT" = "Sao chép nội dung bài đăng";+"SAVE_POST_IMAGE" = "Lưu bài đăng dưới dạng hình ảnh";+"COPY_POST_IMAGE" = "Sao chép bài đăng dưới dạng hình ảnh";+"DOWNLOAD_SERVER" = "Máy chủ tải xuống";+"CHOOSE_DOWNLOAD_SERVER" = "Chọn máy chủ tải xuống";+"DOWNLOAD_COMMENT" = "Lưu thông tin bình luận";+"DOWNLOAD_COMMENT_DESC" = "Cho phép sao chép nội dung bình luận và lưu bình luận dưới dạng hình ảnh bằng cách nhấn giữ lâu vào nút ba dấu chấm.";+"DOWNLOAD_POST" = "Lưu thông tin bài đăng";+"DOWNLOAD_POST_DESC" = "Cho phép sao chép nội dung bài đăng và lưu bài đăng dưới dạng hình ảnh bằng cách nhấn giữ lâu.";+"TRANSLATE_COMMENT" = "Dịch bình luận";+"TRANSLATE_POST" = "Dịch bài đăng";+"SERVER_EUROPRE1" = "Châu Âu";+"SERVER_ASIA1" = "Thái Lan - Châu Á";+"SHOW_OPTIONS" = "Hiện tùy chọn";+"ENGLISH" = "Tiếng Anh";+"TRANSLATION" = "Dịch thuật";+"LANGUAGE" = "Ngôn ngữ";+"TRANSLATING" = "Đang dịch...";+"SELECT_LANG" = "Chọn ngôn ngữ";+"TRANSLATE_FAILED" = "Dịch không thành công, vui lòng thử lại.";+"SAVE_CURRENT_IMAGE" = "Lưu hình ảnh hiện tại";+"COPY_CURRENT_IMAGE" = "Sao chép hình ảnh hiện tại";+"DOWNLOAD_METHOD" = "Phương thức tải xuống";+"DOWNLOAD_METHOD_DESC" = "Cách video được tải xuống. Chế độ 'Trên thiết bị' hoạt động trên các phiên bản YouTube mới nhất.";+"METHOD_DIRECT" = "Trực tiếp";+"METHOD_SERVER" = "Máy chủ";+"METHOD_ONDEVICE" = "Trên thiết bị (SABR)";++"APPEARANCE" = "Hiển thị";+"OLED_THEME" = "Chế độ tối OLED";+"OLED_THEME_DESC" = "Dùng màu đen tuyệt đối (OLED) cho giao diện tối của ứng dụng.";+"OLED_KEYBOARD" = "Bàn phím OLED";+"OLED_KEYBOARD_DESC" = "Bàn phím dùng màu đen tuyệt đối (OLED) trong giao diện tối.";++"NAVBAR" = "Thanh điều hướng";+"STICKY_NAVBAR" = "Ghim thanh điều hướng";+"STICKY_NAVBAR_DESC" = "Ghim thanh điều hướng để luôn hiển thị khi cuộn xuống.";+"NAVIGATION_ICON" = "Biểu tượng điều hướng";+"NAVIGATION_ICON_DESC" = "Thay đổi logo YouTube trên thanh điều hướng.";+"PREMIUM" = "Premium";+"REMOVE_YTLOGO" = "Xóa logo";+"YOUTUBE" = "YouTube";+"HIDE_NOTIFICATION_BUTTON" = "Ẩn nút thông báo";+"HIDE_NOTIFICATION_BUTTON_DESC" = "Ẩn nút thông báo trên thanh điều hướng.";+"HIDE_SEARCH_BUTTON" = "Ẩn nút tìm kiếm";+"HIDE_SEARCH_BUTTON_DESC" = "Ẩn nút tìm kiếm trên thanh điều hướng.";+"HIDE_VOICE_SEARCH_BUTTON" = "Ẩn nút tìm kiếm bằng giọng nói";+"HIDE_VOICE_SEARCH_BUTTON_DESC" = "Ẩn nút tìm kiếm bằng giọng nói trên thanh điều hướng.";+"HIDE_CAST_BUTTON_NAVBAR" = "Ẩn nút truyền phát";+"HIDE_CAST_BUTTON_NAVBAR_DESC" = "Ẩn nút truyền phát trên thanh điều hướng.";++"FEED" = "Bảng tin";+"HIDE_SUBBAR" = "Ẩn thanh bộ lọc";+"HIDE_SUBBAR_DESC" = "Ẩn thanh bộ lọc ở đầu bảng tin.";+"HIDE_HORI_SHELF" = "Xóa các hàng cuộn ngang";+"HIDE_HORI_SHELF_DESC" = "Xóa tất cả các hàng cuộn ngang (Tin tức, Tiếp tục xem, Bộ sưu tập bài đăng, v.v.) khỏi bảng tin, trừ Playables.";+"HIDE_MUSIC_PLAYLISTS" = "Ẩn trình tạo danh sách phát nhạc";+"HIDE_MUSIC_PLAYLISTS_DESC" = "Ẩn trình tạo danh sách phát nhạc (chọn 3 bài hát) trong bảng tin.";+"HIDE_FEED_POST" = "Ẩn bài đăng";+"HIDE_FEED_POST_DESC" = "Ẩn các bài đăng trong bảng tin.";+"HIDE_SURVEYS" = "Ẩn khảo sát";+"HIDE_SURVEYS_DESC" = "Ẩn các khảo sát mà YouTube đôi khi hiển thị.";+"HIDE_SHORTS_SHELF" = "Ẩn hàng Shorts";+"HIDE_SHORTS_SHELF_DESC" = "Ẩn hàng Shorts trong bảng tin, kể cả trong tab Kênh đăng ký.";+"KEEP_SHORTS_SUBSCRIPT" = "Giữ Shorts trong Kênh đăng ký";+"KEEP_SHORTS_SUBSCRIPT_DESC" = "Không xóa Shorts khỏi tab Kênh đăng ký.";+"HIDE_SEARCH_HISTORY" = "Ẩn lịch sử tìm kiếm";+"HIDE_SEARCH_HISTORY_DESC" = "Ẩn lịch sử tìm kiếm trước đó và gợi ý khi dùng thanh tìm kiếm.\\nLƯU Ý: Lịch sử tìm kiếm vẫn có thể xem được trong các ứng dụng YouTube khác của bạn.";+"REMOVE_CHANNEL_COMMUNITY_BUTTON" = "Xóa nút cộng đồng";+"REMOVE_CHANNEL_COMMUNITY_BUTTON_DESC" = "Xóa nút bài đăng cộng đồng trên phần đầu trang kênh.";+"REMOVE_CHANNEL_SPONSOR_BUTTON" = "Xóa nút tham gia / tài trợ";+"REMOVE_CHANNEL_SPONSOR_BUTTON_DESC" = "Xóa nút tham gia hội viên/tài trợ kênh trên trang chủ, trang kênh và Shorts.";+"HIDE_PLAYABLES" = "Xóa Playables";+"HIDE_PLAYABLES_DESC" = "Xóa Playables (trò chơi nhỏ) khỏi bảng tin.";+"HIDE_RELATED_VIDEOS" = "Ẩn video liên quan";+"HIDE_RELATED_VIDEOS_DESC" = "Ẩn video liên quan bên dưới trình phát. (Không áp dụng cho lớp phủ toàn màn hình)";++"PLAYER" = "Trình phát";+"PLAYBACK_SPEED" = "Tốc độ phát";+"CONTROL_CENTER" = "Trung tâm điều khiển";+"PLAYER_ACTIONS" = "Hành động trên trình phát";+"GESTURE_HEADER" = "Cử chỉ";+"QUALITY_WIFI" = "Chất lượng phát qua Wi-Fi";+"QUALITY_WIFI_DESC" = "Tự động áp dụng chất lượng đã chọn khi phát qua Wi-Fi.";+"QUALITY_CELLULAR" = "Chất lượng phát qua dữ liệu di động";+"QUALITY_CELLULAR_DESC" = "Tự động áp dụng chất lượng đã chọn khi phát qua dữ liệu di động.";+"QUALITY_LOW_POWER" = "Chất lượng phát ở chế độ tiết kiệm pin";+"QUALITY_LOW_POWER_DESC" = "Tự động áp dụng chất lượng đã chọn khi bật chế độ tiết kiệm pin trên thiết bị.";+"DEFAULT" = "Mặc định";+"BEST" = "Tốt nhất";+"AUDIO_TRACK" = "Rãnh âm thanh ưu tiên";+"ORIGINAL" = "Gốc";+"SELECT_MANUALLY" = "Chọn thủ công";+"AUDIO_TRACK_SELECT" = "Rãnh âm thanh đã chọn";+"AUDIO_TRACK_SELECT_DESC" = "Chỉ định ngôn ngữ rãnh âm thanh ưu tiên dùng khi phát, nếu có.";+"NO_AUTO_DUBBED" = "Dùng rãnh âm thanh gốc";+"NO_AUTO_DUBBED_DESC" = "Dùng rãnh âm thanh gốc nếu rãnh ngôn ngữ ưu tiên được lồng tiếng tự động hoặc không tìm thấy.";+"CAPTION_TRACK" = "Phụ đề ưu tiên";+"CAPTION_TRACK_SELECT" = "Phụ đề đã chọn";+"CAPTION_TRACK_SELECT_DESC" = "Chỉ định ngôn ngữ phụ đề ưu tiên hiển thị, nếu có.";+"DISABLES_CAPTION_TRACK" = "Tự động tắt phụ đề";+"DISABLES_CAPTION_TRACK_DESC" = "Tự động tắt phụ đề nếu ngôn ngữ ưu tiên là phụ đề tự tạo hoặc không tìm thấy.";+"DEFAULT_SPEED" = "Tốc độ phát mặc định";+"DEFAULT_SPEED_DESC" = "Ghi đè tốc độ phát mặc định.";+"QUALITY_BUTTON" = "Nút điều khiển chất lượng";+"SPEED_BUTTON" = "Nút điều khiển tốc độ";+"MUTE_BUTTON" = "Tắt tiếng";+"SHARE_BUTTON" = "Chia sẻ";+"LOOP_BUTTON" = "Phát lặp";+"CAPTION_BUTTON" = "Phụ đề";+"DOWNLOAD_BUTTON" = "Tải xuống";+"SPONSORBLOCK_BUTTON" = "SponsorBlock";+"MANAGE_OVERLAY_BUTTONS" = "Quản lý nút trên lớp phủ";+"MANAGE_OVERLAY_BUTTONS_DESC" = "Sắp xếp lại và bật/tắt các nút trên lớp phủ";+"OVERLAY_BUTTON_REORDER_HINT" = "Kéo để sắp xếp lại các nút trên lớp phủ. Bật/tắt để hiện/ẩn.";+"HOLD_TO_SPEED" = "Giữ để tăng tốc";+"HOLD_TO_SPEED_DESC" = "Dùng tốc độ phát tùy chỉnh khi giữ để tăng tốc.";+"HIDE_AUTOPLAY" = "Ẩn nút chuyển tự động phát";+"HIDE_AUTOPLAY_DESC" = "Ẩn nút chuyển tự động phát trong lớp phủ video.";+"HIDE_CAPTIONS_BUTTON" = "Ẩn nút phụ đề";+"HIDE_CAPTIONS_BUTTON_DESC" = "Ẩn nút phụ đề trong lớp phủ video.";+"HIDE_CAST_BUTTON_PLAYER" = "Ẩn nút truyền phát";+"HIDE_CAST_BUTTON_PLAYER_DESC" = "Ẩn nút truyền phát trong lớp phủ video.";+"HIDE_NEXT_AND_PREV_BUTTON" = "Ẩn nút video trước và sau";+"HIDE_NEXT_AND_PREV_BUTTON_DESC" = "Ẩn nút video trước và video sau trong lớp phủ video.";+"REPLACE_PREVNEXT_BUTTONS" = "Thay nút Trước/Sau";+"REPLACE_PREVNEXT_BUTTONS_DESC" = "Thay nút video trước và video sau trên trình phát bằng nút tua lại và tua nhanh.";+"REMOVE_DARK_OVERLAY" = "Xóa lớp phủ tối";+"REMOVE_DARK_OVERLAY_DESC" = "Xóa lớp phủ tối màu khỏi video.";+"HIDE_END_SCREEN" = "Ẩn thẻ màn hình kết thúc";+"HIDE_END_SCREEN_DESC" = "Ẩn các thẻ màn hình kết thúc hiển thị trước khi video kết thúc.";+"REMOVE_AMBIANT" = "Xóa ánh sáng môi trường";+"REMOVE_AMBIANT_DESC" = "Xóa hiệu ứng ánh sáng môi trường phát sáng phía sau trình phát video.";+"HIDE_SUGGESTED_VIDEO" = "Ẩn video đề xuất";+"HIDE_SUGGESTED_VIDEO_DESC" = "Ẩn lưới video đề xuất xuất hiện khi video phát xong.";+"HIDE_PAID_OVERLAY" = "Ẩn 'Có chứa quảng cáo trả phí'";+"HIDE_PAID_OVERLAY_DESC" = "Ẩn dòng 'Có chứa quảng cáo trả phí' trong lớp phủ video.";+"HIDE_WATERMARK" = "Ẩn hình mờ";+"HIDE_WATERMARK_DESC" = "Ẩn hình mờ của kênh ở dưới cùng lớp phủ video.";+"PAUSE_ON_OVERLAY" = "Tạm dừng khi hiện lớp phủ";+"PAUSE_ON_OVERLAY_DESC" = "Tạm dừng phát khi lớp phủ xuất hiện.";+"DISABLES_SNAP_TO_CHAPTER" = "Tắt bám theo chương";+"DISABLES_SNAP_TO_CHAPTER_DESC" = "Ngăn thanh tua tự bám vào các mốc chương.";+"DISABLES_ENGAGE_PANEL" = "Tắt bảng tương tác toàn màn hình";+"DISABLES_ENGAGE_PANEL_DESC" = "Ngăn bảng tương tác hiển thị ở chế độ toàn màn hình.";+"GESTURES" = "Bật điều khiển bằng cử chỉ";+"GESTURES_DESC" = "Vuốt lên hoặc vuốt xuống ở mép trái/phải màn hình video để điều chỉnh độ sáng, âm lượng hoặc tốc độ phát.";+"GESTURE_AREA" = "Vùng kích hoạt cử chỉ";+"GESTURE_AREA_DESC" = "Điều chỉnh vùng ở mép màn hình nơi cử chỉ có hiệu lực. (Đặt 50% sẽ chia đôi màn hình, không còn vùng chết ở giữa.)";+"LEFT_SIDE_GESTURE" = "Cử chỉ vuốt bên trái";+"RIGHT_SIDE_GESTURE" = "Cử chỉ vuốt bên phải";+"GESTURE_BRIGHTNESS" = "Độ sáng";+"GESTURE_VOLUME" = "Âm lượng";+"GESTURE_SPEED" = "Tốc độ phát";+"GESTURE_NONE" = "Không";+"GESTURE_HUD" = "Hiện HUD cử chỉ";+"GESTURE_HUD_DESC" = "Hiển thị phần trăm (%) hiện tại trên màn hình khi điều chỉnh độ sáng, âm lượng hoặc tốc độ phát.";+"GESTURE_HUD_SIZE" = "Kích thước HUD cử chỉ";+"GESTURE_HUD_SIZE_DESC" = "Điều chỉnh kích thước chữ và biểu tượng của HUD cử chỉ.";+"SMALL" = "Nhỏ (-1)";+"NORMAL" = "Bình thường (mặc định)";+"LARGE" = "Lớn (+1)";+"EXTRALARGE" = "Rất lớn (+2)";+"MAX" = "Tối đa (+3)";+"GESTURE_HUD_POSITION" = "Vị trí HUD cử chỉ";+"GESTURE_HUD_POSITION_DESC" = "Đặt vị trí dọc của HUD cử chỉ (trên cùng, giữa, dưới cùng).";+"TOP" = "Trên cùng";+"MIDDLE" = "Giữa";+"BOTTOM" = "Dưới cùng";+"DISABLES_DOUBLE_TAP" = "Tắt chạm hai lần";+"DISABLES_DOUBLE_TAP_DESC" = "Tắt tính năng chạm hai lần để tua trong lớp phủ video.";+"DISABLES_LONG_HOLD" = "Tắt nhấn giữ lâu";+"DISABLES_LONG_HOLD_DESC" = "Tắt tính năng nhấn giữ lâu để tăng tốc video trong lớp phủ video.";+"AUTO_EXIT_FULLSCREEN" = "Tự động thoát toàn màn hình";+"AUTO_EXIT_FULLSCREEN_DESC" = "Tự động thoát chế độ toàn màn hình sau khi video kết thúc.";+"AUTO_FEED_MUTE" = "Tự động tắt tiếng video trong bảng tin";+"AUTO_FEED_MUTE_DESC" = "Tự động tắt tiếng các video đang phát trong bảng tin.";+"DISABLES_SHOW_REMAINING" = "Tắt hiển thị thời gian còn lại";+"DISABLES_SHOW_REMAINING_DESC" = "Tắt tính năng hiển thị thời gian còn lại của video khi chạm vào dấu thời gian.";+"ALWAYS_SHOW_REMAINING" = "Luôn hiển thị thời gian còn lại";+"ALWAYS_SHOW_REMAINING_DESC" = "Luôn hiển thị thời gian còn lại theo mặc định trong lớp phủ trình phát.";+"COPY_TIMESTAMP_ON_PAUSE" = "Sao chép liên kết kèm dấu thời gian";+"COPY_TIMESTAMP_ON_PAUSE_DESC" = "Cho phép sao chép liên kết kèm dấu thời gian vào bảng tạm bằng cách nhấn nút tạm dừng.";+"SHOW_REMAINING_EXTRA" = "Hiện thêm giờ kết thúc";+"SHOW_REMAINING_EXTRA_DESC" = "Thêm giờ dự kiến kết thúc vào nhãn trong lớp phủ video.";+"HIDE_FULLSCREEN_ACTIONS" = "Ẩn nút hành động toàn màn hình";+"HIDE_FULLSCREEN_ACTIONS_DESC" = "Ẩn các nút hành động nhanh (Thích, Không thích, Video khác, v.v.) khi video ở chế độ toàn màn hình.";+"HIDE_FULL_VID_TITLE" = "Ẩn tiêu đề video toàn màn hình";+"HIDE_FULL_VID_TITLE_DESC" = "Ẩn tiêu đề video hiển thị ở góc trên bên trái ở chế độ toàn màn hình.";+"STOP_AUTOPLAY_VIDEO" = "Tắt tự động phát";+"STOP_AUTOPLAY_VIDEO_DESC" = "Ngăn video tự động phát khi mở video.";+"HIDE_CONTENT_WARNING" = "Bỏ qua cảnh báo nội dung";+"HIDE_CONTENT_WARNING_DESC" = "Tự động bỏ qua cảnh báo nội dung nhạy cảm trong một số video.";+"AUTO_FULLSCREEN" = "Tự động toàn màn hình";+"AUTO_FULLSCREEN_DESC" = "Tự động vào chế độ toàn màn hình khi bắt đầu phát video.";+"PORTRAIT_FULLSCREEN" = "Chế độ toàn màn hình dọc";+"PORTRAIT_FULLSCREEN_DESC" = "Bật hỗ trợ chế độ toàn màn hình theo chiều dọc.";+"OLD_QUALITY_PICKER" = "Dùng menu chọn chất lượng cũ";+"OLD_QUALITY_PICKER_DESC" = "Đưa menu chọn chất lượng video về phiên bản cổ điển (hiển thị ngay toàn bộ danh sách độ phân giải).";+"EXTRA_SPEED" = "Thêm lựa chọn tốc độ";+"EXTRA_SPEED_DESC" = "Thêm nhiều lựa chọn tốc độ phát video, tối đa đến 10x.";+"FORCE_MINIPLAYER" = "Ép dùng trình phát thu nhỏ";+"FORCE_MINIPLAYER_DESC" = "Cho phép mọi video, kể cả video dành cho trẻ em, phát trong trình phát thu nhỏ khi thu gọn trình phát.";+"FORCE_SEEKBAR" = "Luôn hiển thị thanh tiến trình";+"FORCE_SEEKBAR_DESC" = "Giữ thanh tiến trình (seekbar) luôn hiển thị ở chế độ toàn màn hình.";+"TAP_TO_SEEK" = "Chạm để tua";+"TAP_TO_SEEK_DESC" = "Nhảy nhanh đến bất kỳ vị trí nào bằng cách chạm vào thanh tiến trình.";+"DISABLES_ZOOM" = "Tắt cử chỉ thu phóng tự do";+"DISABLES_ZOOM_DESC" = "Tắt các cử chỉ thu phóng tự do mới.";+"USES_24_HOURS_TIME" = "Định dạng 24 giờ";+"USES_24_HOURS_TIME_DESC" = "Hiển thị giờ kết thúc theo định dạng 24 giờ.";+"PAUSE_TWO_FINGERS" = "Tạm dừng bằng hai ngón tay";+"PAUSE_TWO_FINGERS_DESC" = "Tạm dừng/tiếp tục phát bằng cách chạm vào màn hình bằng hai ngón tay.";+"SKIP_BACKWARD" = "Tua lùi";+"SKIP_BACKWARD_DESC" = "Thay nút bài trước trong Trung tâm điều khiển bằng nút tua lùi theo số giây đã đặt.";+"SKIP_FORWARD" = "Tua tới";+"SKIP_FORWARD_DESC" = "Thay nút bài sau trong Trung tâm điều khiển bằng nút tua tới theo số giây đã đặt.";+"REWIND_SECONDS" = "Số giây tua lùi";+"FORWARD_SECONDS" = "Số giây tua tới";+"HIDE_COMMENTS_SECTION" = "Ẩn phần bình luận";+"HIDE_COMMENTS_SECTION_DESC" = "Xóa hoàn toàn toàn bộ phần bình luận.";+"HIDE_COMMENTS_PREVIEW" = "Ẩn xem trước bình luận";+"HIDE_COMMENTS_PREVIEW_DESC" = "Xóa hộp xem trước bình luận nổi bật nhưng vẫn giữ khả năng mở rộng toàn bộ phần bình luận.";+"LOCK_SPEED" = "Khóa tốc độ";+"LOCK_SPEED_DESC" = "Khóa ở tốc độ đã chỉnh bằng cách vuốt xuống.";+"SEEK_ON_OVERLAY" = "Tua trên lớp phủ";+"SEEK_ON_OVERLAY_DESC" = "Cho phép tua video bằng cách vuốt trái và phải trên lớp phủ video.";+"DRC_AUDIO_OPTIONS" = "Âm lượng ổn định tự động";+"DRC_AUDIO_OPTIONS_DESC" = "Tự động chọn bật hay tắt Âm lượng ổn định.";+"REMOVE_VIDEO_LIKE_BUTTON" = "Xóa nút thích";+"REMOVE_VIDEO_LIKE_BUTTON_DESC" = "Xóa nút thích bên dưới trình phát video và trong lớp phủ toàn màn hình.";+"REMOVE_VIDEO_DISLIKE_BUTTON" = "Xóa nút không thích";+"REMOVE_VIDEO_DISLIKE_BUTTON_DESC" = "Xóa nút không thích bên dưới trình phát video và trong lớp phủ toàn màn hình.";+"REMOVE_VIDEO_SHARE_BUTTON" = "Xóa nút chia sẻ";+"REMOVE_VIDEO_SHARE_BUTTON_DESC" = "Xóa nút chia sẻ bên dưới trình phát video và trong lớp phủ toàn màn hình.";+"REMOVE_VIDEO_SAVE_BUTTON" = "Xóa nút lưu";+"REMOVE_VIDEO_SAVE_BUTTON_DESC" = "Xóa nút lưu vào danh sách phát bên dưới trình phát video và trong lớp phủ toàn màn hình.";+"REMOVE_VIDEO_DOWNLOAD_BUTTON" = "Xóa nút tải xuống";+"REMOVE_VIDEO_DOWNLOAD_BUTTON_DESC" = "Xóa nút tải xuống bên dưới trình phát video và trong lớp phủ toàn màn hình.";+"REMOVE_VIDEO_CLIP_BUTTON" = "Xóa nút tạo đoạn video";+"REMOVE_VIDEO_CLIP_BUTTON_DESC" = "Xóa nút tạo đoạn video bên dưới trình phát video và trong lớp phủ toàn màn hình.";+"REMOVE_VIDEO_REMIX_BUTTON" = "Xóa nút phối lại";+"REMOVE_VIDEO_REMIX_BUTTON_DESC" = "Xóa nút phối lại bên dưới trình phát video và trong lớp phủ toàn màn hình.";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON" = "Xóa nút trò chuyện trực tiếp";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON_DESC" = "Xóa nút trò chuyện trực tiếp bên dưới trình phát video và trong lớp phủ toàn màn hình.";++"SHORTS" = "Shorts";+"HIDE_SHORTS_TOPBAR" = "Ẩn thanh trên cùng";+"HIDE_SHORTS_TOPBAR_DESC" = "Ẩn toàn bộ thanh trên cùng trong trình phát.";+"HIDE_SHORTS_SUBBAR" = "Ẩn thanh danh mục";+"HIDE_SHORTS_SUBBAR_DESC" = "Ẩn thanh chọn loại Shorts trong trình phát.";+"SHORTS_ONLY" = "Chế độ chỉ Shorts";+"SHORTS_ONLY_DESC" = "Giới hạn chức năng của YouTube chỉ để xem Shorts. Bạn có thể tắt chế độ chỉ Shorts bằng cách nhấn giữ lâu bằng hai ngón tay trong trình phát Shorts.";+"SHORTS_ONLY_DISABLED" = "Đã tắt chế độ chỉ Shorts";+"SHORTS_ACTION" = "Hành động với Shorts sau khi video kết thúc";+"LOOP" = "Phát lặp";+"SKIP_TO_NEXT_SHORTS" = "Chuyển tiếp";+"PAUSE_SHORTS" = "Dừng";+"REMOVE_LIVE_SHORTS" = "Xóa video trực tiếp";+"REMOVE_LIVE_SHORTS_DESC" = "Xóa video trực tiếp khỏi bảng tin.";+"HIDE_SHORTS_PRODUCT" = "Ẩn sản phẩm";+"HIDE_SHORTS_PRODUCT_DESC" = "Ẩn sản phẩm được gắn thẻ và liên kết mua sắm trong lớp phủ Shorts.";+"HIDE_SHORTS_RECBAR" = "Ẩn thanh đề xuất";+"HIDE_SHORTS_RECBAR_DESC" = "Ẩn thanh hành động được đề xuất trong trình phát Shorts (ví dụ: Dùng thử âm thanh này, Mua sắm, Xem trước bình luận).";+"HIDE_SHORTS_DISCLOSURE" = "Ẩn 'Nhận hoa hồng'";+"HIDE_SHORTS_DISCLOSURE_DESC" = "Ẩn thông báo 'Nhận hoa hồng' trong Shorts.";+"REMOVE_SHORTS_LIKE_BUTTON" = "Xóa nút thích";+"REMOVE_SHORTS_LIKE_BUTTON_DESC" = "Xóa nút thích khỏi giao diện Shorts.";+"REMOVE_SHORTS_COMMENT_BUTTON" = "Xóa nút bình luận";+"REMOVE_SHORTS_COMMENT_BUTTON_DESC" = "Xóa nút bình luận khỏi giao diện Shorts.";+"REMOVE_SHORTS_SHARE_BUTTON" = "Xóa nút chia sẻ";+"REMOVE_SHORTS_SHARE_BUTTON_DESC" = "Xóa nút chia sẻ khỏi giao diện Shorts.";+"REMOVE_SHORTS_REMIX_BUTTON" = "Xóa nút phối lại";+"REMOVE_SHORTS_REMIX_BUTTON_DESC" = "Xóa nút phối lại khỏi giao diện Shorts.";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON" = "Xóa nút thông tin âm thanh";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON_DESC" = "Xóa nút thông tin âm thanh khỏi giao diện Shorts.";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON" = "Xóa nút kênh đăng ký";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON_DESC" = "Xóa nút kênh đăng ký trên thanh tiêu đề khi tạm dừng Shorts.";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON" = "Xóa nút trực tiếp";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON_DESC" = "Xóa nút trực tiếp trên thanh tiêu đề khi tạm dừng Shorts.";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON" = "Xóa nút Lens";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON_DESC" = "Xóa nút Lens trên thanh tiêu đề khi tạm dừng Shorts.";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON" = "Xóa nút thịnh hành";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON_DESC" = "Xóa nút thịnh hành trên thanh tiêu đề khi tạm dừng Shorts.";+"ENABLES_SHORTS_QUALITY" = "Bật chọn chất lượng trong Shorts";+"ENABLES_SHORTS_QUALITY_DESC" = "Bật bắt buộc menu chọn chất lượng video trong Shorts.";+"SHOW_SHORTS_SEEKBAR" = "Luôn hiển thị thanh tua";+"SHOW_SHORTS_SEEKBAR_DESC" = "Giữ thanh tiến trình/thanh tua luôn hiển thị ở dưới cùng trình phát Shorts.";+"REMOVE_POSTS_SHORTS" = "Xóa bài đăng";+"REMOVE_POSTS_SHORTS_DESC" = "Xóa bài đăng khỏi bảng tin.";+"SHORTS_FULLSCREEN" = "Chụm để toàn màn hình";+"SHORTS_FULLSCREEN_DESC" = "Điều khiển độ hiển thị của lớp phủ bằng cử chỉ chụm hai ngón và kéo ra, hiển thị Shorts ở chế độ toàn màn hình.";++"TABBAR" = "Thanh tab";+"DEFAULT_TAB" = "Tab mặc định khi mở ứng dụng";+"FORSTED_TAB_BAR" = "Thanh tab bán trong suốt";+"ENABLED" = "Đã bật";+"HOME_TAB" = "Trang chủ";+"SHORTS_TAB" = "Shorts";+"CREATE_TAB" = "Tạo";+"SUBSCRIPTIONS_TAB" = "Kênh đăng ký";+"LIBRARY_TAB" = "Bạn";+"HIDE_TAB_INDI" = "Ẩn chỉ báo tab";+"HIDE_TAB_INDI_DESC" = "Ẩn mọi chỉ báo tab trên thanh tab.";+"HIDE_TAB_LABELS" = "Ẩn nhãn tab";+"HIDE_TAB_LABELS_DESC" = "Ẩn mọi nhãn tab trên thanh tab.";+"HISTORY_TAB" = "Video đã xem";+"GAMING_TAB" = "Trò chơi";+"SPORTS_TAB" = "Thể thao";+"NOTI_TAB" = "Thông báo";+"NEWS_TAB" = "Tin tức";+"MUSIC_TAB" = "Âm nhạc";+"WATCH_LATER_TAB" = "Xem sau";+"PLAYLIST_TAB" = "Danh sách phát";+"LIKE_TAB" = "Video đã thích";+"LIVE_TAB" = "Trực tiếp";+"POST_TAB" = "Bài đăng";+"VIDEO_TAB" = "Video của bạn";+"MOVIE_TAB" = "Phim";+"COURSE_TAB" = "Khóa học";+"MINIGAME_TAB" = "Playables";+"FASHION_TAB" = "Thời trang & Làm đẹp";+"LEARNING_TAB" = "Học tập";+"MANAGE_TABS" = "Quản lý tab";+"MANAGE_TABS_DESC" = "Sắp xếp lại và bật/tắt các tab";+"TAB_REORDER_HINT" = "Kéo để sắp xếp lại. Bật/tắt để hiện/ẩn.\\nCài đặt tab cũng có thể truy cập bằng cách nhấn giữ lâu tab đầu tiên trên thanh tab.";+"TAB_LIMIT" = "Giới hạn số tab";+"TAB_LIMIT_DESC" = "Chỉ cho phép tối đa 6 tab.";+"ZERO_TAB_DESC" = "Phải bật ít nhất 1 tab.";++"MISCELLANEOUS" = "Khác";+"BACKGROUND_PLAYBACK" = "Phát ở nền";+"BACKGROUND_PLAYBACK_DESC" = "Bật phát video ở nền.";+"DISABLES_SHORTS_PIP" = "Tắt PiP cho Shorts";+"DISABLES_SHORTS_PIP_DESC" = "Thử tắt PiP cho Shorts, có thể không tắt được hoàn toàn 100%.";+"DISABLE_HINTS" = "Tắt gợi ý";+"DISABLE_HINTS_DESC" = "Tắt các gợi ý hướng dẫn và cửa sổ pop-up tương tác.";+"BLOCK_UPGRADE_DIALOGS" = "Chặn hộp thoại yêu cầu cập nhật";+"BLOCK_UPGRADE_DIALOGS_DESC" = "Chặn các hộp thoại của YouTube yêu cầu bạn cập nhật ứng dụng.";+"ARE_YOU_THERE_DIALOG" = "Ẩn hộp thoại 'Bạn vẫn đang xem chứ?'";+"ARE_YOU_THERE_DIALOG_DESC" = "Ẩn hộp thoại xuất hiện khi bạn không tương tác với ứng dụng quá lâu.";+"FIXES_SLOW_MINIPLAYER" = "Sửa trình phát thu nhỏ chậm";+"FIXES_SLOW_MINIPLAYER_DESC" = "Khắc phục tình trạng trình phát thu nhỏ mở rộng video chậm; chỉ hiệu quả trên các phiên bản YouTube cũ.";+"DISABLES_NEW_MINIPLAYER" = "Tắt trình phát thu nhỏ mới";+"DISABLES_NEW_MINIPLAYER_DESC" = "Dùng trình phát thu nhỏ kiểu cũ thay vì kiểu mới; chỉ hiệu quả trên các phiên bản YouTube cũ.";+"DISABLES_SNACK_BAR" = "Tắt thanh thông báo nhanh";+"DISABLES_SNACK_BAR_DESC" = "Tắt thanh thông báo nhanh khi nhấn một số nút hoặc thực hiện thao tác nào đó trong ứng dụng.";+"HIDE_STARTUP_ANIMATIONS" = "Ẩn hiệu ứng khởi động của YouTube";+"HIDE_STARTUP_ANIMATIONS_DESC" = "Ẩn hiệu ứng khởi động của YouTube khi mở ứng dụng.";+"HIDE_LIKE_DISLIKE_VOTES" = "Ẩn thông báo thích/không thích";+"HIDE_LIKE_DISLIKE_VOTES_DESC" = "Ẩn các thông báo bật lên khi bạn thích/không thích video.";+"FLYOUT_MENU" = "Menu bật ra";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION" = "Xóa tùy chọn 'Phát tiếp theo trong hàng đợi'";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION_DESC" = "Xóa tùy chọn 'Phát tiếp theo trong hàng đợi' khỏi menu bật ra.";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION" = "Xóa tùy chọn 'Phát cuối trong hàng đợi'";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION_DESC" = "Xóa tùy chọn 'Phát cuối trong hàng đợi' khỏi menu bật ra.";+"REMOVE_DOWNLOAD_OPTION" = "Xóa tùy chọn 'Tải video xuống'";+"REMOVE_DOWNLOAD_OPTION_DESC" = "Xóa tùy chọn 'Tải video xuống' khỏi menu bật ra.";+"REMOVE_WATCH_LATER_OPTION" = "Xóa tùy chọn 'Lưu vào Xem sau'";+"REMOVE_WATCH_LATER_OPTION_DESC" = "Xóa tùy chọn 'Lưu vào Xem sau' khỏi menu bật ra.";+"REMOVE_SAVE_OPTION" = "Xóa tùy chọn 'Lưu vào danh sách phát'";+"REMOVE_SAVE_OPTION_DESC" = "Xóa tùy chọn 'Lưu vào danh sách phát' khỏi menu bật ra.";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION" = "Xóa tùy chọn 'Xóa khỏi danh sách phát'";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION_DESC" = "Xóa tùy chọn 'Xóa khỏi danh sách phát' khỏi menu bật ra.";+"REMOVE_SHARE_OPTION" = "Xóa tùy chọn 'Chia sẻ'";+"REMOVE_SHARE_OPTION_DESC" = "Xóa tùy chọn 'Chia sẻ' khỏi menu bật ra.";+"REMOVE_NOT_INTERESTED_OPTION" = "Xóa tùy chọn 'Không quan tâm'";+"REMOVE_NOT_INTERESTED_OPTION_DESC" = "Xóa tùy chọn 'Không quan tâm' khỏi menu bật ra.";+"REMOVE_DONT_RECOMMEND_OPTION" = "Xóa tùy chọn 'Không đề xuất kênh'";+"REMOVE_DONT_RECOMMEND_OPTION_DESC" = "Xóa tùy chọn 'Không đề xuất kênh' khỏi menu bật ra.";+"REMOVE_INFO_OPTION" = "Xóa tùy chọn 'Tại sao video này xuất hiện?'";+"REMOVE_INFO_OPTION_DESC" = "Xóa tùy chọn 'Tại sao video này xuất hiện?' khỏi menu bật ra.";+"REMOVE_FILTER_OPTION" = "Xóa tùy chọn 'Bộ lọc tìm kiếm'";+"REMOVE_FILTER_OPTION_DESC" = "Xóa tùy chọn 'Bộ lọc tìm kiếm' khỏi menu bật ra.";+"REMOVE_REPORT_OPTION" = "Xóa tùy chọn 'Báo cáo vi phạm'";+"REMOVE_REPORT_OPTION_DESC" = "Xóa tùy chọn 'Báo cáo vi phạm' khỏi menu bật ra.";+"REMOVE_YOUTUBE_MUSIC_OPTION" = "Xóa tùy chọn 'Nghe bằng YouTube Music'";+"REMOVE_YOUTUBE_MUSIC_OPTION_DESC" = "Xóa tùy chọn 'Nghe bằng YouTube Music' khỏi menu bật ra.";+"REMOVE_FEED_BACK_OPTION" = "Xóa tùy chọn 'Gửi phản hồi'";+"REMOVE_FEED_BACK_OPTION_DESC" = "Xóa tùy chọn 'Gửi phản hồi' khỏi menu bật ra.";+"REMOVE_CAST_OPTION" = "Xóa tùy chọn 'Xem trên TV'";+"REMOVE_CAST_OPTION_DESC" = "Xóa tùy chọn 'Xem trên TV' khỏi menu bật ra.";+"REMOVE_SHUFFLE_OPTION" = "Xóa tùy chọn 'Trộn ngẫu nhiên'";+"REMOVE_SHUFFLE_OPTION_DESC" = "Xóa tùy chọn 'Trộn ngẫu nhiên' khỏi menu bật ra.";+"REMOVE_UN_SUB_OPTION" = "Xóa tùy chọn 'Hủy đăng ký'";+"REMOVE_UN_SUB_OPTION_DESC" = "Xóa tùy chọn 'Hủy đăng ký' khỏi menu bật ra.";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION" = "Xóa tùy chọn 'Ẩn video khỏi danh sách phát'";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION_DESC" = "Xóa tùy chọn 'Ẩn video khỏi danh sách phát' khỏi menu bật ra.";+"REMOVE_HELP_OPTION" = "Xóa tùy chọn 'Trợ giúp & phản hồi'";+"REMOVE_HELP_OPTION_DESC" = "Xóa tùy chọn 'Trợ giúp & phản hồi' khỏi menu bật ra.";+"REMOVE_NOTIFY_OPTION" = "Xóa tùy chọn 'Nhắc tôi'";+"REMOVE_NOTIFY_OPTION_DESC" = "Xóa tùy chọn 'Nhắc tôi' khỏi menu bật ra.";+"REMOVE_CLEARSCREEN_OPTION" = "Xóa tùy chọn 'Xóa màn hình'";+"REMOVE_CLEARSCREEN_OPTION_DESC" = "Xóa tùy chọn 'Xóa màn hình' khỏi menu bật ra.";+"HIDE_COMMU_GUIDE" = "Ẩn quy tắc cộng đồng";+"HIDE_COMMU_GUIDE_DESC" = "Ẩn tiêu đề quy tắc cộng đồng.";+"HIDE_ENGAGEMENT_SUBBAR" = "Ẩn đầu trang bình luận";+"HIDE_ENGAGEMENT_SUBBAR_DESC" = "Ẩn thanh sắp xếp bình luận (Hàng đầu, Mới nhất) để nó không bao giờ xuất hiện.";+"DISABLES_RTL" = "Tắt định dạng RTL";+"DISABLES_RTL_DESC" = "Buộc hiển thị văn bản theo định dạng từ trái sang phải (LTR) với các ngôn ngữ vốn được viết từ phải sang trái (RTL).";+"DEVICE_UI" = "Kiểu giao diện";+"OPEN_LINK" = "Mở liên kết";+"FLOATING_KEYBOARD" = "Bàn phím nổi";+"FLOATING_KEYBOARD_DESC" = "Bật bắt buộc bàn phím nổi. Hữu ích cho iPhone giả lập kiểu giao diện iPad.\\nLưu ý: chỉ hoạt động khi chọn kiểu iPad.";+"AUTO_OPEN_LINK" = "Tự kiểm tra bảng tạm";+"AUTO_OPEN_LINK_DESC" = "Kiểm tra bảng tạm tìm liên kết liên quan đến YouTube mỗi lần mở ứng dụng.\\nĐể hoạt động đúng, vào Cài đặt iOS → YouTube → Dán từ ứng dụng khác và chọn 'Cho phép'";++"SB_DESCRIPTION" = "Tự động bỏ qua các đoạn tài trợ bằng dữ liệu do cộng đồng đóng góp.";+"SB_ENABLE" = "Bật SponsorBlock";+"SB_ENABLE_DESC" = "Kích hoạt tiện ích mở rộng SponsorBlock để bỏ qua các đoạn tài trợ.";+"SB_SHOW_BUTTON" = "Hiện nút trên lớp phủ";+"SB_SHOW_BUTTON_DESC" = "Hiển thị nút bật/tắt SponsorBlock trong lớp phủ trình phát.";+"SB_SHOW_NOTIFICATIONS" = "Hiện thông báo";+"SB_SHOW_NOTIFICATIONS_DESC" = "Hiển thị thông báo khi có đoạn được bỏ qua. Thông báo cho các danh mục bỏ qua thủ công luôn được hiển thị.";+"SB_HAPTIC_FEEDBACK" = "Phản hồi rung";+"SB_HAPTIC_FEEDBACK_DESC" = "Rung phản hồi khi một đoạn được bỏ qua.";+"SB_SEGMENTS_IN_PLAYER" = "Đoạn trên trình phát";+"SB_SEGMENTS_IN_PLAYER_DESC" = "Hiển thị các đoạn màu trên thanh tiến trình của trình phát video chính.";+"SB_SEGMENTS_IN_FEED" = "Đoạn trong bảng tin";+"SB_SEGMENTS_IN_FEED_DESC" = "Hiển thị các đoạn màu trên thanh tiến trình của trình phát trong bảng tin.";+"SB_SEGMENTS_IN_MINIPLAYER" = "Đoạn trên trình phát thu nhỏ";+"SB_SEGMENTS_IN_MINIPLAYER_DESC" = "Hiển thị các đoạn màu trên thanh tiến trình của trình phát thu nhỏ.";+"SB_SHOW_DURATION" = "Hiện thời lượng không tính đoạn";+"SB_SHOW_DURATION_DESC" = "Hiển thị tổng thời lượng video không tính các đoạn có thể bỏ qua.";+"SB_CATEGORIES_HEADER" = "Danh mục đoạn";+"SB_SEGMENT_COLOR" = "Màu đoạn";++"SB_ACTION_DISABLE" = "Tắt";+"SB_ACTION_AUTO_SKIP" = "Tự động bỏ qua";+"SB_ACTION_ASK" = "Hỏi trước khi bỏ qua";+"SB_ACTION_DISPLAY" = "Chỉ hiện trên thanh tua";+"SB_ACTION_SKIP_TO" = "Chuyển đến đoạn";++"SB_CAT_sponsor" = "Tài trợ";+"SB_CAT_sponsor_DESC" = "Quảng cáo có trả phí cho sản phẩm hoặc dịch vụ không liên quan trực tiếp đến người sáng tạo.";+"SB_CAT_intro" = "Mở đầu / Intro";+"SB_CAT_intro_DESC" = "Hoạt cảnh mở đầu hoặc đoạn chuyển cảnh thường thấy ở đầu video.";+"SB_CAT_outro" = "Màn hình kết thúc / Outro";+"SB_CAT_outro_DESC" = "Màn hình kết thúc, danh đề hoặc outro ở cuối video.";+"SB_CAT_interaction" = "Kêu gọi tương tác";+"SB_CAT_interaction_DESC" = "Nhắc nhở nhấn thích, đăng ký kênh hoặc theo dõi trên mạng xã hội.";+"SB_CAT_selfpromo" = "Tự quảng bá";+"SB_CAT_selfpromo_DESC" = "Quảng bá không trả phí cho sản phẩm, đồ lưu niệm hoặc nội dung khác của chính tác giả.";+"SB_CAT_music_offtopic" = "Đoạn không có nhạc";+"SB_CAT_music_offtopic_DESC" = "Các đoạn không chứa âm nhạc trong video ca nhạc (ví dụ: hội thoại, mở đầu câu chuyện).";+"SB_CAT_preview" = "Xem trước / Tóm tắt";+"SB_CAT_preview_DESC" = "Tóm tắt hoặc đoạn trích xem trước từ video khác hoặc tập trước.";+"SB_CAT_hook" = "Điểm nhấn mở đầu / Lời chào";+"SB_CAT_hook_DESC" = "Đoạn giới thiệu ngắn về nội dung sắp chiếu trong video hoặc lời chào mở đầu.";+"SB_CAT_poi_highlight" = "Khoảnh khắc nổi bật";+"SB_CAT_poi_highlight_DESC" = "Điểm đáng chú ý hoặc khoảnh khắc nổi bật nhất của video. Sử dụng 'Chuyển đến' để nhảy tới phần này.";+"SB_CAT_filler" = "Nội dung đệm / Ngoài lề";+"SB_CAT_filler_DESC" = "Các cảnh ngoài lề, trò đùa hoặc phần đệm không liên quan trực tiếp đến chủ đề chính của video.";++"SB_SKIPPED" = "Đã bỏ qua đoạn %@";+"SB_DETECTED" = "Phát hiện đoạn %@.\\nBạn có muốn bỏ qua đoạn này không?";+"SB_SKIP_NOW" = "Bỏ qua";+"SB_UNSKIP" = "Hủy bỏ qua";+"SB_JUMPED_TO_HIGHLIGHT" = "Đã chuyển đến khoảnh khắc nổi bật";+"SB_JUMP_TO_HIGHLIGHT" = "Có khoảnh khắc nổi bật. Chuyển đến không?";+"SB_SEGMENT_COLOR_SUFFIX" = "Màu đoạn";+"SB_SECTION_MAIN" = "Chính";+"SB_SKIP_ALERT_DURATION" = "Thời lượng cảnh báo bỏ qua";+"SB_UNSKIP_ALERT_DURATION" = "Thời lượng cảnh báo hủy bỏ qua";+"SB_MIN_DURATION_SLIDER" = "Thời lượng đoạn tối thiểu để bỏ qua";diff --git a/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/zh-CN.lproj/Localizable.strings b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/zh-CN.lproj/Localizable.stringsnew file mode 100644index 0000000..66862bb--- /dev/null+++ b/vendor/YouMod/layout/Library/Application Support/YouMod.bundle/zh-CN.lproj/Localizable.strings@@ -0,0 +1,578 @@+"SETTINGS" = "设置";+"INTERFACE" = "界面";++"SEARCH" = "搜索";+"SEARCH_DESC" = "搜索 YouMod 设置。";++"URL_COPIED" = "已复制视频链接";+"COPY_URL" = "复制视频链接";+"COPY_URL_TIMESTAMP" = "复制带时间戳的视频链接";+"URL_TIMESTAMP_COPIED" = "已复制带时间戳的视频链接";+"CANCEL" = "取消";+"ERROR" = "错误";+"ERROR_VIDEOID" = "无法获取视频 ID";+"ERROR_ADS" = "播放广告时无法复制视频链接";++"LOOP_DISABLED" = "已关闭循环播放";+"LOOP_ENABLED" = "已开启循环播放";++"NEW_ISSUES" = "报告问题或请求新功能";+"NEW_ISSUES_DESC" = "发现 Bug 或想请求新功能?点击此处。";+"SOURCE_CODES" = "源代码";+"SOURCE_CODES_DESC" = "来看看代码吧!";++"EXTRA" = "额外";+"FIX_PLAYBACK_ISSUES" = "修复播放问题(临时)";+"FIX_PLAYBACK_ISSUES_DESC" = "尝试修复部分用户的视频播放问题。开启后,播放器出错或播放失败时会自动重新加载。";++"PERFER_HEADER" = "YouMod 偏好设置";+"PERFER" = "偏好设置";+"IMPORT" = "导入设置";+"IMPORT_DESC" = "从 .plist 文件加载您的偏好设置。";+"IMPORT_DONE" = "成功";+"YES" = "是";+"APPLY_DESC" = "需要重启应用。是否现在重启?";+"EXPORT" = "导出设置";+"EXPORT_DESC" = "将您的偏好设置导出为 .plist 文件。";+"RESTORE" = "恢复设置";+"RESTORE_DESC" = "恢复为全新安装时的默认设置。";+"WARNING" = "警告";+"RESETDEFAULT" = "这将把所有设置恢复为默认值。是否继续?";+"ERROR_INVALID_FILE" = "无效文件";+"ERROR_NO_KEYS_IMPORT" = "没有可导入的键";+"ERROR_NO_KEYS_EXPORT" = "没有可导出的键";+"OVERRIDE" = "这将覆盖当前设置。是否继续?";+"DISABLED" = "已禁用";++"CACHE" = "缓存管理";+"CLEARCACHE" = "清除缓存";+"DONE" = "完成";+"AUTO_CLEARCACHE" = "自动清除缓存";+"AUTO_CLEARCACHE_DESC" = "启动时自动清除应用缓存。";++"DOWNLOADING" = "下载中";+"DOWNLOAD_MANAGER" = "下载管理器";+"DOWNLOAD_MANAGER_DESC" = "用 YouMod 的下载器替换 YouTube 原生下载器。支持下载视频、音频、字幕和缩略图。";+"POST_DOWNLOAD_ACTION" = "下载后操作";+"POST_ACTION_SAVE_PHOTOS" = "保存到相册";+"POST_ACTION_SHARE" = "分享";+"POST_ACTION_ASK" = "询问";+"ADD_SHORTS_DOWNLOAD" = "在 Shorts 中添加下载按钮";+"ADD_SHORTS_DOWNLOAD_DESC" = "在 Shorts 播放界面添加下载按钮。";+"DOWNLOAD_SHORTS" = "下载 Shorts";+"COPY_VID_INFO" = "复制视频信息";+"COPY_TITLE" = "复制标题";+"COPY_DESCRIPTION" = "复制简介";+"COPY_ALL_VID_INFO" = "复制全部";+"COPIED_TITLE" = "已复制视频标题";+"COPIED_DESCRIPTION" = "已复制视频简介";+"COPY_AUTHOR" = "复制作者";+"COPIED_AUTHOR" = "已复制视频作者";+"SAVE_THUMBNAIL" = "保存缩略图";+"DOWNLOAD_CAPTIONS" = "下载字幕";+"DOWNLOAD_AUDIO" = "下载音频";+"DOWNLOAD_VIDEO" = "下载视频";+"OPEN_VID_BEFORE" = "请先打开一个视频再使用下载管理器";+"NO_CAPTIONS_URL" = "未找到有效的字幕链接";+"NO_AUDIO_URL" = "未找到音频链接";+"NO_STREAM_URL" = "未找到流链接";+"CAPTIONS_FAILED" = "字幕下载失败";+"NO_CAPTIONS" = "此视频没有可用字幕";+"NO_AUDIO_STREAM_FOUND" = "未找到音频流";+"NO_VID_AUDIO_STREAM_FOUND" = "未找到视频/音频流";+"COPIED_VID_INFO" = "已复制所有视频信息";+"SAVED_TO_PHOTOS" = "已保存到相册";+"SAVE_FAILED" = "保存失败";+"PHOTO_ACCESS_DENINED" = "相册访问被拒绝";+"THUMBNAIL_FAILED" = "缩略图获取失败";+"DOWNLOADING_THUMBNAIL" = "正在下载缩略图…";+"DOWNLOADING_AUDIO" = "正在下载音频…";+"DOWNLOADING_VIDEO" = "正在下载视频…";+"DOWNLOADING_CAPTIONS" = "正在下载字幕…";+"NO_THUMBNAIL_FOUND" = "未找到缩略图";+"DOWNLOAD_FAILED" = "下载失败";+"AUDIO_SAVED" = "音频已保存";+"DOWNLOAD_COMPLETED" = "下载完成";+"CANNOT_SAVE_TO_PHOTOS" = "无法保存到相册";+"FINA_VIDEO" = "正在完成视频处理…";+"MERGING_VID_FALLBACK" = "正在合并视频(备用方式)…";+"MERGING_VID" = "正在合并视频…";+"CONVERTING" = "正在转换为";+"ALREADY_DOWNLOADING" = "已在下载中";+"DOWNLOAD_CANCELLED" = "下载已取消";+"TRIMMING_AUDIO" = "正在裁剪音频…";+"SHOW_THUMBNAIL" = "显示缩略图";+"COPY_THUMBNAIL" = "复制缩略图";+"THUMBNAIL_OPTIONS" = "下载缩略图";+"COPY" = "复制";+"COPIED_TO_CLIPBOARD" = "已复制到剪贴板";+"CONNECTING_TO_SERVER" = "正在连接服务器…";+"DOWNLOADING_TO_SERVER" = "正在从服务器下载…";+"COPY_COMMENT_TEXT" = "复制评论文字";+"SAVE_COMMENT_IMAGE" = "保存评论图片";+"COPY_COMMENT_IMAGE" = "复制评论图片";+"COPY_POST_TEXT" = "复制帖子文字";+"SAVE_POST_IMAGE" = "保存帖子图片";+"COPY_POST_IMAGE" = "复制帖子图片";+"DOWNLOAD_SERVER" = "下载服务器";+"CHOOSE_DOWNLOAD_SERVER" = "选择下载服务器";+"DOWNLOAD_COMMENT" = "保存评论信息";+"DOWNLOAD_COMMENT_DESC" = "长按三点菜单按钮可复制评论文字或保存评论图片。";+"DOWNLOAD_POST" = "保存帖子信息";+"DOWNLOAD_POST_DESC" = "长按可复制帖子文字或保存帖子图片。";+"TRANSLATE_COMMENT" = "翻译评论";+"TRANSLATE_POST" = "翻译帖子";+"SERVER_EUROPRE1" = "欧洲";+"SERVER_ASIA1" = "泰国 - 亚洲";+"SHOW_OPTIONS" = "显示选项";+"ENGLISH" = "英语";+"TRANSLATION" = "翻译";+"LANGUAGE" = "语言";+"TRANSLATING" = "翻译中…";+"SELECT_LANG" = "选择语言";+"TRANSLATE_FAILED" = "翻译失败,请重试。";+"SAVE_CURRENT_IMAGE" = "保存当前图片";+"COPY_CURRENT_IMAGE" = "复制当前图片";+"DOWNLOAD_METHOD" = "下载方式";+"DOWNLOAD_METHOD_DESC" = "视频的下载方式。设备端下载适用于最新版 YouTube。";+"METHOD_DIRECT" = "直接下载";+"METHOD_SERVER" = "服务器";+"METHOD_ONDEVICE" = "设备端 (SABR)";++"APPEARANCE" = "外观";+"OLED_THEME" = "OLED 深色模式";+"OLED_THEME_DESC" = "在应用深色主题中使用纯黑 (OLED) 颜色。";+"OLED_KEYBOARD" = "OLED 键盘";+"OLED_KEYBOARD_DESC" = "在深色主题下使键盘使用纯黑 (OLED) 颜色。";++"NAVBAR" = "导航栏";+"STICKY_NAVBAR" = "固定导航栏";+"STICKY_NAVBAR_DESC" = "将导航栏固定,使其在向下滚动时保持可见。";+"NAVIGATION_ICON" = "导航图标";+"NAVIGATION_ICON_DESC" = "更改导航栏中的 YouTube 图标。";+"PREMIUM" = "Premium";+"REMOVE_YTLOGO" = "移除图标";+"YOUTUBE" = "YouTube";+"HIDE_NOTIFICATION_BUTTON" = "隐藏通知按钮";+"HIDE_NOTIFICATION_BUTTON_DESC" = "隐藏导航栏中的通知按钮。";+"HIDE_SEARCH_BUTTON" = "隐藏搜索按钮";+"HIDE_SEARCH_BUTTON_DESC" = "隐藏导航栏中的搜索按钮。";+"HIDE_VOICE_SEARCH_BUTTON" = "隐藏语音搜索按钮";+"HIDE_VOICE_SEARCH_BUTTON_DESC" = "隐藏导航栏中的语音搜索按钮。";+"HIDE_CAST_BUTTON_NAVBAR" = "隐藏投屏按钮";+"HIDE_CAST_BUTTON_NAVBAR_DESC" = "隐藏导航栏中的投屏按钮。";++"FEED" = "信息流";+"HIDE_SUBBAR" = "隐藏子栏";+"HIDE_SUBBAR_DESC" = "隐藏信息流顶部的子栏。";+"HIDE_HORI_SHELF" = "移除横向信息流";+"HIDE_HORI_SHELF_DESC" = "从信息流中移除所有横向信息流(新闻、继续观看、帖子合集等),小游戏除外。";+"HIDE_MUSIC_PLAYLISTS" = "隐藏音乐播放列表生成器";+"HIDE_MUSIC_PLAYLISTS_DESC" = "隐藏信息流中的音乐播放列表生成器(三选一精选音乐)。";+"HIDE_FEED_POST" = "隐藏帖子";+"HIDE_FEED_POST_DESC" = "隐藏信息流中的帖子。";+"HIDE_SURVEYS" = "隐藏问卷调查";+"HIDE_SURVEYS_DESC" = "隐藏 YouTube 偶尔显示的视频问卷调查。";+"HIDE_SHORTS_SHELF" = "隐藏 Shorts 栏目";+"HIDE_SHORTS_SHELF_DESC" = "隐藏信息流中的 Shorts 栏目,包括订阅标签页中的。";+"KEEP_SHORTS_SUBSCRIPT" = "在订阅中保留 Shorts";+"KEEP_SHORTS_SUBSCRIPT_DESC" = "防止从订阅标签页中移除 Shorts。";+"HIDE_SEARCH_HISTORY" = "隐藏搜索历史";+"HIDE_SEARCH_HISTORY_DESC" = "使用搜索栏时隐藏之前的搜索历史和建议。\\n注意:您的搜索历史在其他 YouTube 客户端中仍可访问。";+"REMOVE_CHANNEL_COMMUNITY_BUTTON" = "移除社区按钮";+"REMOVE_CHANNEL_COMMUNITY_BUTTON_DESC" = "移除频道主页顶部的社区按钮。";+"REMOVE_CHANNEL_SPONSOR_BUTTON" = "移除加入会员/赞助按钮";+"REMOVE_CHANNEL_SPONSOR_BUTTON_DESC" = "移除动态流、频道主页以及 Shorts 中的加入会员/赞助按钮。";+"HIDE_PLAYABLES" = "移除小游戏";+"HIDE_PLAYABLES_DESC" = "从信息流中移除小游戏。";+"HIDE_RELATED_VIDEOS" = "隐藏相关视频";+"HIDE_RELATED_VIDEOS_DESC" = "隐藏播放器下方的相关视频。(不包括播放界面中的)";++"PLAYER" = "播放器";+"PLAYBACK_SPEED" = "播放速度";+"CONTROL_CENTER" = "控制中心";+"PLAYER_ACTIONS" = "播放器操作";+"GESTURE_HEADER" = "手势";+"QUALITY_WIFI" = "WiFi 画质";+"QUALITY_WIFI_DESC" = "通过 Wi-Fi 播放时自动应用所选画质。";+"QUALITY_CELLULAR" = "蜂窝数据画质";+"QUALITY_CELLULAR_DESC" = "通过移动数据播放时自动应用所选画质。";+"QUALITY_LOW_POWER" = "省电模式画质";+"QUALITY_LOW_POWER_DESC" = "设备开启低电量模式时自动应用所选画质。";+"DEFAULT" = "默认";+"BEST" = "最高";+"AUDIO_TRACK" = "首选音轨";+"ORIGINAL" = "原声";+"SELECT_MANUALLY" = "手动选择";+"AUDIO_TRACK_SELECT" = "已选音轨";+"AUDIO_TRACK_SELECT_DESC" = "指定播放时使用的首选音轨语言(如可用)。";+"NO_AUTO_DUBBED" = "使用原声音轨";+"NO_AUTO_DUBBED_DESC" = "如果首选语言音轨是自动配音或未找到,则使用原声音轨。";+"CAPTION_TRACK" = "首选字幕";+"CAPTION_TRACK_SELECT" = "已选字幕";+"CAPTION_TRACK_SELECT_DESC" = "指定显示的首选字幕语言(如可用)。";+"DISABLES_CAPTION_TRACK" = "自动关闭字幕";+"DISABLES_CAPTION_TRACK_DESC" = "如果首选语言是自动生成或未找到,则自动关闭字幕。";+"DEFAULT_SPEED" = "默认播放倍速";+"DEFAULT_SPEED_DESC" = "覆盖默认播放速度。";+"QUALITY_BUTTON" = "画质控制";+"SPEED_BUTTON" = "速度控制";+"MUTE_BUTTON" = "静音";+"SHARE_BUTTON" = "分享";+"LOOP_BUTTON" = "循环";+"CAPTION_BUTTON" = "字幕";+"DOWNLOAD_BUTTON" = "下载";+"SPONSORBLOCK_BUTTON" = "SponsorBlock";+"MANAGE_OVERLAY_BUTTONS" = "管理播放界面按钮";+"MANAGE_OVERLAY_BUTTONS_DESC" = "重新排列和开关播放界面按钮";+"OVERLAY_BUTTON_REORDER_HINT" = "拖拽以重新排列播放界面按钮。开关以显示/隐藏。";+"HOLD_TO_SPEED" = "长按加速";+"HOLD_TO_SPEED_DESC" = "使用自定义长按加速播放倍速。";+"HIDE_AUTOPLAY" = "隐藏自动播放开关";+"HIDE_AUTOPLAY_DESC" = "隐藏视频播放界面中的自动播放开关。";+"HIDE_CAPTIONS_BUTTON" = "隐藏字幕按钮";+"HIDE_CAPTIONS_BUTTON_DESC" = "隐藏视频播放界面中的字幕按钮。";+"HIDE_CAST_BUTTON_PLAYER" = "隐藏投屏按钮";+"HIDE_CAST_BUTTON_PLAYER_DESC" = "隐藏视频播放界面中的投屏按钮。";+"HIDE_NEXT_AND_PREV_BUTTON" = "隐藏上一个和下一个按钮";+"HIDE_NEXT_AND_PREV_BUTTON_DESC" = "隐藏视频播放界面中的上一个和下一个按钮。";+"REPLACE_PREVNEXT_BUTTONS" = "替换上一个/下一个按钮";+"REPLACE_PREVNEXT_BUTTONS_DESC" = "将播放器中的上一个和下一个视频按钮替换为快退和快进按钮。";+"REMOVE_DARK_OVERLAY" = "移除暗色遮罩";+"REMOVE_DARK_OVERLAY_DESC" = "移除视频播放界面的暗色遮罩。";+"HIDE_END_SCREEN" = "隐藏片尾卡片";+"HIDE_END_SCREEN_DESC" = "隐藏视频结束前显示的片尾卡片。";+"REMOVE_AMBIANT" = "移除氛围光";+"REMOVE_AMBIANT_DESC" = "移除视频播放器后方发光的氛围光效果。";+"HIDE_SUGGESTED_VIDEO" = "隐藏推荐视频";+"HIDE_SUGGESTED_VIDEO_DESC" = "隐藏视频播放完成后显示的推荐视频网格。";+"HIDE_PAID_OVERLAY" = "隐藏“包含付费推广”";+"HIDE_PAID_OVERLAY_DESC" = "隐藏视频播放界面中的“包含付费推广”提示。";+"HIDE_WATERMARK" = "隐藏水印";+"HIDE_WATERMARK_DESC" = "隐藏视频播放界面底部的水印。";+"PAUSE_ON_OVERLAY" = "显示播放界面时暂停";+"PAUSE_ON_OVERLAY_DESC" = "播放界面出现时暂停播放。";+"DISABLES_SNAP_TO_CHAPTER" = "禁用吸附到章节";+"DISABLES_SNAP_TO_CHAPTER_DESC" = "防止进度条吸附到章节标记。";+"DISABLES_ENGAGE_PANEL" = "全屏时禁用互动面板";+"DISABLES_ENGAGE_PANEL_DESC" = "在全屏模式下防止显示互动面板。";+"GESTURES" = "启用手势控制";+"GESTURES_DESC" = "在视频屏幕左/右边缘上下滑动以调节亮度、音量或播放速度。";+"GESTURE_AREA" = "手势激活区域";+"GESTURE_AREA_DESC" = "调整边缘手势激活的区域。(设为 50% 时将屏幕对半分割,中间无死区。)";+"LEFT_SIDE_GESTURE" = "左侧滑动手势";+"RIGHT_SIDE_GESTURE" = "右侧滑动手势";+"GESTURE_BRIGHTNESS" = "亮度";+"GESTURE_VOLUME" = "音量";+"GESTURE_SPEED" = "播放速度";+"GESTURE_NONE" = "无";+"GESTURE_HUD" = "显示手势 HUD";+"GESTURE_HUD_DESC" = "调节亮度、音量或播放速度时在屏幕上显示当前百分比 (%)。";+"GESTURE_HUD_SIZE" = "手势 HUD 大小";+"GESTURE_HUD_SIZE_DESC" = "调整手势 HUD 的文字和图标大小。";+"SMALL" = "小 (-1)";+"NORMAL" = "正常(默认)";+"LARGE" = "大 (+1)";+"EXTRALARGE" = "超大 (+2)";+"MAX" = "最大 (+3)";+"GESTURE_HUD_POSITION" = "手势 HUD 位置";+"GESTURE_HUD_POSITION_DESC" = "设置手势 HUD 的垂直位置(顶部、中间、底部)。";+"TOP" = "顶部";+"MIDDLE" = "中间";+"BOTTOM" = "底部";+"DISABLES_DOUBLE_TAP" = "禁用双击";+"DISABLES_DOUBLE_TAP_DESC" = "禁用视频播放界面中双击快进/快退的功能。";+"DISABLES_LONG_HOLD" = "禁用长按";+"DISABLES_LONG_HOLD_DESC" = "禁用视频播放界面中长按加速播放的功能。";+"AUTO_EXIT_FULLSCREEN" = "自动退出全屏";+"AUTO_EXIT_FULLSCREEN_DESC" = "视频结束后自动退出全屏。";+"AUTO_FEED_MUTE" = "自动静音信息流视频";+"AUTO_FEED_MUTE_DESC" = "自动静音信息流中播放的视频。";+"DISABLES_SHOW_REMAINING" = "禁用剩余时间";+"DISABLES_SHOW_REMAINING_DESC" = "禁用点击时间戳时显示视频剩余时间的功能。";+"ALWAYS_SHOW_REMAINING" = "始终显示剩余时间";+"ALWAYS_SHOW_REMAINING_DESC" = "确保播放界面中始终默认显示剩余时间。";+"COPY_TIMESTAMP_ON_PAUSE" = "复制带时间戳的链接";+"COPY_TIMESTAMP_ON_PAUSE_DESC" = "按下暂停按钮时可复制带时间戳的链接到剪贴板。";+"SHOW_REMAINING_EXTRA" = "显示额外剩余时间";+"SHOW_REMAINING_EXTRA_DESC" = "在视频播放界面标签中添加预计结束时间。";+"HIDE_FULLSCREEN_ACTIONS" = "隐藏全屏快捷操作";+"HIDE_FULLSCREEN_ACTIONS_DESC" = "在全屏模式下隐藏快捷操作按钮(点赞、不喜欢、更多视频等)。";+"HIDE_FULL_VID_TITLE" = "隐藏全屏视频标题";+"HIDE_FULL_VID_TITLE_DESC" = "在全屏模式下隐藏左上角显示的视频标题。";+"STOP_AUTOPLAY_VIDEO" = "禁用自动播放";+"STOP_AUTOPLAY_VIDEO_DESC" = "打开视频时防止视频自动播放。";+"HIDE_CONTENT_WARNING" = "跳过内容警告";+"HIDE_CONTENT_WARNING_DESC" = "自动跳过部分视频中的敏感内容警告提示。";+"AUTO_FULLSCREEN" = "自动全屏";+"AUTO_FULLSCREEN_DESC" = "开始播放视频时自动进入全屏模式。";+"PORTRAIT_FULLSCREEN" = "竖屏全屏模式";+"PORTRAIT_FULLSCREEN_DESC" = "启用竖屏全屏模式支持。";+"OLD_QUALITY_PICKER" = "使用旧版画质选择器";+"OLD_QUALITY_PICKER_DESC" = "将视频画质选择菜单恢复为经典版本(立即列出所有分辨率)。";+"EXTRA_SPEED" = "额外速度选项";+"EXTRA_SPEED_DESC" = "添加更多视频播放速度选项,最高至 10 倍速。";+"FORCE_MINIPLAYER" = "强制迷你播放器";+"FORCE_MINIPLAYER_DESC" = "关闭播放器时,允许所有视频(包括儿童视频)在迷你播放器中播放。";+"FORCE_SEEKBAR" = "始终显示进度条";+"FORCE_SEEKBAR_DESC" = "使进度条在全屏模式下始终可见。";+"TAP_TO_SEEK" = "点击跳转";+"TAP_TO_SEEK_DESC" = "点击进度条快速跳转到任意位置。";+"DISABLES_ZOOM" = "禁用自由缩放手势";+"DISABLES_ZOOM_DESC" = "禁用新的自由缩放手势。";+"USES_24_HOURS_TIME" = "24 小时制";+"USES_24_HOURS_TIME_DESC" = "以 24 小时制显示结束时间。";+"PAUSE_TWO_FINGERS" = "双指暂停";+"PAUSE_TWO_FINGERS_DESC" = "双指点击屏幕暂停/恢复播放。";+"SKIP_BACKWARD" = "快退";+"SKIP_BACKWARD_DESC" = "将控制中心中的上一曲按钮替换为指定秒数的快退按钮。";+"SKIP_FORWARD" = "快进";+"SKIP_FORWARD_DESC" = "将控制中心中的下一曲按钮替换为指定秒数的快进按钮。";+"REWIND_SECONDS" = "快退秒数";+"FORWARD_SECONDS" = "快进秒数";+"HIDE_COMMENTS_SECTION" = "隐藏评论区";+"HIDE_COMMENTS_SECTION_DESC" = "完全移除整个评论区。";+"HIDE_COMMENTS_PREVIEW" = "隐藏评论预览";+"HIDE_COMMENTS_PREVIEW_DESC" = "移除置顶评论的预览框,同时保留完整评论区的可展开功能。";+"LOCK_SPEED" = "锁定速度";+"LOCK_SPEED_DESC" = "向下滑动时锁定已调整的速度。";+"SEEK_ON_OVERLAY" = "播放界面拖动进度";+"SEEK_ON_OVERLAY_DESC" = "在视频播放界面上左右滑动以控制播放进度。";+"DRC_AUDIO_OPTIONS" = "自动稳定音量";+"DRC_AUDIO_OPTIONS_DESC" = "自动选择是否启用稳定音量。";+"REMOVE_VIDEO_LIKE_BUTTON" = "移除点赞按钮";+"REMOVE_VIDEO_LIKE_BUTTON_DESC" = "移除视频播放器下方及全屏播放界面中的点赞按钮。";+"REMOVE_VIDEO_DISLIKE_BUTTON" = "移除不喜欢按钮";+"REMOVE_VIDEO_DISLIKE_BUTTON_DESC" = "移除视频播放器下方及全屏播放界面中的不喜欢按钮。";+"REMOVE_VIDEO_SHARE_BUTTON" = "移除分享按钮";+"REMOVE_VIDEO_SHARE_BUTTON_DESC" = "移除视频播放器下方及全屏播放界面中的分享按钮。";+"REMOVE_VIDEO_SAVE_BUTTON" = "移除保存按钮";+"REMOVE_VIDEO_SAVE_BUTTON_DESC" = "移除视频播放器下方及全屏播放界面中的保存到播放列表按钮。";+"REMOVE_VIDEO_DOWNLOAD_BUTTON" = "移除下载按钮";+"REMOVE_VIDEO_DOWNLOAD_BUTTON_DESC" = "移除视频播放器下方及全屏播放界面中的下载按钮。";+"REMOVE_VIDEO_CLIP_BUTTON" = "移除剪辑按钮";+"REMOVE_VIDEO_CLIP_BUTTON_DESC" = "移除视频播放器下方及全屏播放界面中的剪辑按钮。";+"REMOVE_VIDEO_REMIX_BUTTON" = "移除混剪按钮";+"REMOVE_VIDEO_REMIX_BUTTON_DESC" = "移除视频播放器下方及全屏播放界面中的混剪按钮。";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON" = "移除直播聊天按钮";+"REMOVE_VIDEO_LIVE_CHAT_BUTTON_DESC" = "移除视频播放器下方及全屏播放界面中的直播聊天按钮。";++"SHORTS" = "Shorts";+"HIDE_SHORTS_TOPBAR" = "隐藏顶栏";+"HIDE_SHORTS_TOPBAR_DESC" = "隐藏播放器中的整个顶栏视图。";+"HIDE_SHORTS_SUBBAR" = "隐藏子栏";+"HIDE_SHORTS_SUBBAR_DESC" = "隐藏播放器中的 Shorts 类型栏。";+"SHORTS_ONLY" = "仅 Shorts 模式";+"SHORTS_ONLY_DESC" = "将 YouTube 功能限制为仅观看 Shorts。在 Shorts 播放器中双指长按可关闭仅 Shorts 模式。";+"SHORTS_ONLY_DISABLED" = "仅 Shorts 模式已关闭";+"SHORTS_ACTION" = "视频结束后的 Shorts 操作";+"LOOP" = "循环";+"SKIP_TO_NEXT_SHORTS" = "滑到下一个";+"PAUSE_SHORTS" = "停止";+"REMOVE_LIVE_SHORTS" = "移除直播视频";+"REMOVE_LIVE_SHORTS_DESC" = "从信息流中移除直播视频。";+"HIDE_SHORTS_PRODUCT" = "隐藏商品";+"HIDE_SHORTS_PRODUCT_DESC" = "隐藏 Shorts 播放界面中标记的商品和购物链接。";+"HIDE_SHORTS_RECBAR" = "隐藏推荐栏";+"HIDE_SHORTS_RECBAR_DESC" = "隐藏 Shorts 播放器中的推荐操作栏(例如:试听此音频、购物、预览评论)。";+"HIDE_SHORTS_DISCLOSURE" = "隐藏“赚取佣金”标识";+"HIDE_SHORTS_DISCLOSURE_DESC" = "隐藏 Shorts 中的“赚取佣金”披露标识。";+"REMOVE_SHORTS_LIKE_BUTTON" = "移除点赞按钮";+"REMOVE_SHORTS_LIKE_BUTTON_DESC" = "移除 Shorts 播放界面的点赞按钮。";+"REMOVE_SHORTS_COMMENT_BUTTON" = "移除评论按钮";+"REMOVE_SHORTS_COMMENT_BUTTON_DESC" = "移除 Shorts 播放界面的评论按钮。";+"REMOVE_SHORTS_SHARE_BUTTON" = "移除分享按钮";+"REMOVE_SHORTS_SHARE_BUTTON_DESC" = "移除 Shorts 播放界面的分享按钮。";+"REMOVE_SHORTS_REMIX_BUTTON" = "移除混剪按钮";+"REMOVE_SHORTS_REMIX_BUTTON_DESC" = "移除 Shorts 播放界面的混剪按钮。";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON" = "移除原声/音频按钮";+"REMOVE_SHORTS_SOUNDMETADATA_BUTTON_DESC" = "移除 Shorts 播放界面的原声/音频按钮。";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON" = "移除订阅按钮";+"REMOVE_SHORTS_PAUSED_SUB_BUTTON_DESC" = "移除 Shorts 暂停界面顶部的订阅按钮。";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON" = "移除直播按钮";+"REMOVE_SHORTS_PAUSED_LIVE_BUTTON_DESC" = "移除 Shorts 暂停界面顶部的直播按钮。";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON" = "移除镜头按钮";+"REMOVE_SHORTS_PAUSED_LENS_BUTTON_DESC" = "移除 Shorts 暂停界面顶部的镜头按钮。";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON" = "移除当下流行按钮";+"REMOVE_SHORTS_PAUSED_TRENDS_BUTTON_DESC" = "移除 Shorts 暂停界面顶部的当下流行按钮。";+"ENABLES_SHORTS_QUALITY" = "启用 Shorts 画质选择";+"ENABLES_SHORTS_QUALITY_DESC" = "强制在 Shorts 中启用视频画质选择菜单。";+"SHOW_SHORTS_SEEKBAR" = "始终显示进度条";+"SHOW_SHORTS_SEEKBAR_DESC" = "确保进度条始终显示在 Shorts 播放器底部。";+"REMOVE_POSTS_SHORTS" = "移除帖子";+"REMOVE_POSTS_SHORTS_DESC" = "从信息流中移除帖子。";+"SHORTS_FULLSCREEN" = "捏合全屏";+"SHORTS_FULLSCREEN_DESC" = "通过捏合手势管理播放界面的可见性,以全屏模式显示 Shorts。";++"TABBAR" = "标签栏";+"DEFAULT_TAB" = "默认启动标签";+"FORSTED_TAB_BAR" = "半透明标签栏";+"ENABLED" = "已启用";+"HOME_TAB" = "首页";+"SHORTS_TAB" = "Shorts";+"CREATE_TAB" = "创建";+"SUBSCRIPTIONS_TAB" = "订阅";+"LIBRARY_TAB" = "媒体库 (你)";+"HIDE_TAB_INDI" = "隐藏标签指示器";+"HIDE_TAB_INDI_DESC" = "隐藏标签栏中的所有标签指示器。";+"HIDE_TAB_LABELS" = "隐藏标签文字";+"HIDE_TAB_LABELS_DESC" = "隐藏标签栏中的所有标签文字。";+"HISTORY_TAB" = "历史记录";+"GAMING_TAB" = "游戏";+"SPORTS_TAB" = "体育";+"NOTI_TAB" = "通知";+"NEWS_TAB" = "新闻";+"MUSIC_TAB" = "音乐";+"WATCH_LATER_TAB" = "稍后观看";+"PLAYLIST_TAB" = "播放列表";+"LIKE_TAB" = "已点赞视频";+"LIVE_TAB" = "直播";+"POST_TAB" = "帖子";+"VIDEO_TAB" = "你的视频";+"MOVIE_TAB" = "电影";+"COURSE_TAB" = "课程";+"MINIGAME_TAB" = "小游戏";+"FASHION_TAB" = "时尚与美妆";+"LEARNING_TAB" = "学习";+"MANAGE_TABS" = "管理标签";+"MANAGE_TABS_DESC" = "重新排列和开关标签";+"TAB_REORDER_HINT" = "拖拽以重新排列。开关以显示/隐藏。\\n也可通过长按标签栏中的第一个标签来访问标签设置。";+"TAB_LIMIT" = "标签数量限制";+"TAB_LIMIT_DESC" = "最多仅允许 6 个标签。";+"ZERO_TAB_DESC" = "至少需要启用 1 个标签。";++"MISCELLANEOUS" = "其他";+"BACKGROUND_PLAYBACK" = "后台播放";+"BACKGROUND_PLAYBACK_DESC" = "为视频启用后台播放功能。";+"DISABLES_SHORTS_PIP" = "禁用 Shorts 画中画";+"DISABLES_SHORTS_PIP_DESC" = "尝试禁用 Shorts 画中画,可能无法 100% 禁用。";+"DISABLE_HINTS" = "禁用提示";+"DISABLE_HINTS_DESC" = "禁用教程提示和互动弹窗。";+"BLOCK_UPGRADE_DIALOGS" = "屏蔽升级弹窗";+"BLOCK_UPGRADE_DIALOGS_DESC" = "屏蔽 YouTube 要求升级应用的弹窗。";+"ARE_YOU_THERE_DIALOG" = "隐藏“你还在吗?”弹窗";+"ARE_YOU_THERE_DIALOG_DESC" = "当您在应用中长时间不活动时隐藏弹窗。";+"FIXES_SLOW_MINIPLAYER" = "修复迷你播放器缓慢";+"FIXES_SLOW_MINIPLAYER_DESC" = "修复展开视频时迷你播放器卡顿的问题,仅适用于旧版 YouTube。";+"DISABLES_NEW_MINIPLAYER" = "禁用新版迷你播放器";+"DISABLES_NEW_MINIPLAYER_DESC" = "使用旧版迷你播放器替代新版,仅适用于旧版 YouTube。";+"DISABLES_SNACK_BAR" = "禁用 Snackbar 提示";+"DISABLES_SNACK_BAR_DESC" = "按下某些按钮或在应用中执行操作时禁用 Snackbar 提示。";+"HIDE_STARTUP_ANIMATIONS" = "隐藏 YouTube 启动动画";+"HIDE_STARTUP_ANIMATIONS_DESC" = "打开应用时隐藏 YouTube 的启动动画。";+"HIDE_LIKE_DISLIKE_VOTES" = "隐藏点赞/不喜欢投票数";+"HIDE_LIKE_DISLIKE_VOTES_DESC" = "隐藏点赞或不喜欢视频时弹出的消息。";+"FLYOUT_MENU" = "浮动菜单";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION" = "移除“接下来播放”选项";+"REMOVE_PLAY_IN_NEXT_QUEUE_OPTION_DESC" = "从浮动菜单中移除“接下来播放”选项。";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION" = "移除“最后播放”选项";+"REMOVE_PLAY_IN_LAST_QUEUE_OPTION_DESC" = "从浮动菜单中移除“最后播放”选项。";+"REMOVE_DOWNLOAD_OPTION" = "移除“下载视频”选项";+"REMOVE_DOWNLOAD_OPTION_DESC" = "从浮动菜单中移除“下载视频”选项。";+"REMOVE_WATCH_LATER_OPTION" = "移除“保存到稍后观看”选项";+"REMOVE_WATCH_LATER_OPTION_DESC" = "从浮动菜单中移除“保存到稍后观看”选项。";+"REMOVE_SAVE_OPTION" = "移除“保存到播放列表”选项";+"REMOVE_SAVE_OPTION_DESC" = "从浮动菜单中移除“保存到播放列表”选项。";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION" = "移除“从播放列表移除”选项";+"REMOVE_REMOVE_FROM_PLAYLIST_OPTION_DESC" = "从浮动菜单中移除“从播放列表移除”选项。";+"REMOVE_SHARE_OPTION" = "移除“分享”选项";+"REMOVE_SHARE_OPTION_DESC" = "从浮动菜单中移除“分享”选项。";+"REMOVE_NOT_INTERESTED_OPTION" = "移除“不感兴趣”选项";+"REMOVE_NOT_INTERESTED_OPTION_DESC" = "从浮动菜单中移除“不感兴趣”选项。";+"REMOVE_DONT_RECOMMEND_OPTION" = "移除“不推荐该频道”选项";+"REMOVE_DONT_RECOMMEND_OPTION_DESC" = "从浮动菜单中移除“不推荐该频道”选项。";+"REMOVE_INFO_OPTION" = "移除“为什么推荐这个?”选项";+"REMOVE_INFO_OPTION_DESC" = "从浮动菜单中移除“为什么推荐这个?”选项。";+"REMOVE_FILTER_OPTION" = "移除“搜索筛选”选项";+"REMOVE_FILTER_OPTION_DESC" = "从浮动菜单中移除“搜索筛选”选项。";+"REMOVE_REPORT_OPTION" = "移除“举报”选项";+"REMOVE_REPORT_OPTION_DESC" = "从浮动菜单中移除“举报”选项。";+"REMOVE_YOUTUBE_MUSIC_OPTION" = "移除“使用 YouTube Music 收听”选项";+"REMOVE_YOUTUBE_MUSIC_OPTION_DESC" = "从浮动菜单中移除“使用 YouTube Music 收听”选项。";+"REMOVE_FEED_BACK_OPTION" = "移除“发送反馈”选项";+"REMOVE_FEED_BACK_OPTION_DESC" = "从浮动菜单中移除“发送反馈”选项。";+"REMOVE_CAST_OPTION" = "移除“在电视上观看”选项";+"REMOVE_CAST_OPTION_DESC" = "从浮动菜单中移除“在电视上观看”选项。";+"REMOVE_SHUFFLE_OPTION" = "移除“随机播放”选项";+"REMOVE_SHUFFLE_OPTION_DESC" = "从浮动菜单中移除“随机播放”选项。";+"REMOVE_UN_SUB_OPTION" = "移除“取消订阅”选项";+"REMOVE_UN_SUB_OPTION_DESC" = "从浮动菜单中移除“取消订阅”选项。";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION" = "移除“从播放列表隐藏视频”选项";+"REMOVE_HIDE_FROM_PLAYLIST_OPTION_DESC" = "从浮动菜单中移除“从播放列表隐藏视频”选项。";+"REMOVE_HELP_OPTION" = "移除“帮助与反馈”选项";+"REMOVE_HELP_OPTION_DESC" = "从浮动菜单中移除“帮助与反馈”选项。";+"REMOVE_NOTIFY_OPTION" = "移除“通知我”选项";+"REMOVE_NOTIFY_OPTION_DESC" = "从浮动菜单中移除“通知我”选项。";+"REMOVE_CLEARSCREEN_OPTION" = "移除“清除屏幕”选项";+"REMOVE_CLEARSCREEN_OPTION_DESC" = "从浮动菜单中移除“清除屏幕”选项。";+"HIDE_COMMU_GUIDE" = "隐藏社区规范";+"HIDE_COMMU_GUIDE_DESC" = "隐藏社区规范标题。";+"HIDE_ENGAGEMENT_SUBBAR" = "隐藏评论标题栏";+"HIDE_ENGAGEMENT_SUBBAR_DESC" = "隐藏评论排序标题栏(最热、最新),使其不再出现。";+"DISABLES_RTL" = "禁用 RTL 格式";+"DISABLES_RTL_DESC" = "强制以从左到右 (LTR) 格式显示最初为从右到左 (RTL) 显示的语言文本。";+"DEVICE_UI" = "界面风格";+"OPEN_LINK" = "打开链接";+"FLOATING_KEYBOARD" = "浮动键盘";+"FLOATING_KEYBOARD_DESC" = "强制启用浮动键盘。适用于伪装为 iPad 风格的 iPhone。\\n注意:仅在选择了 iPad 风格时生效。";+"AUTO_OPEN_LINK" = "自动检查剪贴板";+"AUTO_OPEN_LINK_DESC" = "每次打开应用时检查剪贴板中是否有 YouTube 相关链接。\\n为确保正常使用,请前往 iOS 设置 → YouTube → 从其他 App 粘贴,选择“允许”";++"SB_DESCRIPTION" = "使用社区提交的数据自动跳过赞助片段。";+"SB_ENABLE" = "启用 SponsorBlock";+"SB_ENABLE_DESC" = "激活 SponsorBlock 扩展以跳过赞助片段。";+"SB_SHOW_BUTTON" = "显示播放界面按钮";+"SB_SHOW_BUTTON_DESC" = "在播放界面显示 SponsorBlock 开关按钮。";+"SB_SHOW_NOTIFICATIONS" = "显示通知";+"SB_SHOW_NOTIFICATIONS_DESC" = "片段被跳过时显示通知。手动跳过类别的通知始终显示。";+"SB_HAPTIC_FEEDBACK" = "触觉反馈";+"SB_HAPTIC_FEEDBACK_DESC" = "跳过片段时提供触觉反馈。";+"SB_SEGMENTS_IN_PLAYER" = "播放器中的片段";+"SB_SEGMENTS_IN_PLAYER_DESC" = "在主视频播放器的进度条上显示彩色片段。";+"SB_SEGMENTS_IN_FEED" = "信息流中的片段";+"SB_SEGMENTS_IN_FEED_DESC" = "在信息流播放器的进度条上显示彩色片段。";+"SB_SEGMENTS_IN_MINIPLAYER" = "迷你播放器中的片段";+"SB_SEGMENTS_IN_MINIPLAYER_DESC" = "在迷你播放器的进度条上显示彩色片段。";+"SB_SHOW_DURATION" = "显示不含片段的时长";+"SB_SHOW_DURATION_DESC" = "显示不含可跳过片段的总视频时长。";+"SB_CATEGORIES_HEADER" = "片段分类";+"SB_SEGMENT_COLOR" = "片段颜色";++"SB_ACTION_DISABLE" = "禁用";+"SB_ACTION_AUTO_SKIP" = "自动跳过";+"SB_ACTION_ASK" = "跳过前询问";+"SB_ACTION_DISPLAY" = "仅在进度条显示";+"SB_ACTION_SKIP_TO" = "跳至片段";++"SB_CAT_sponsor" = "赞助广告";+"SB_CAT_sponsor_DESC" = "与创作者无直接关联的产品或服务的付费推广内容。";+"SB_CAT_intro" = "片头/转场";+"SB_CAT_intro_DESC" = "通常出现在视频开头的转场或片头动画。";+"SB_CAT_outro" = "片尾/鸣谢";+"SB_CAT_outro_DESC" = "视频末尾的片尾卡片、演职员表或结束画面。";+"SB_CAT_interaction" = "互动提醒";+"SB_CAT_interaction_DESC" = "提醒观众点赞、订阅或关注社交媒体的片段。";+"SB_CAT_selfpromo" = "自我推广";+"SB_CAT_selfpromo_DESC" = "创作者对自己产品、周边或其它内容的无报酬推广。";+"SB_CAT_music_offtopic" = "非音乐片段";+"SB_CAT_music_offtopic_DESC" = "音乐视频中的非音乐部分(如讲话、剧情对话或过场)。";+"SB_CAT_preview" = "精彩预告/前情回顾";+"SB_CAT_preview_DESC" = "回顾之前的内容或本期/下期视频的精彩预告。";+"SB_CAT_hook" = "引言/问候";+"SB_CAT_hook_DESC" = "视频开头的快速内容概括或问候打招呼。";+"SB_CAT_poi_highlight" = "高光时刻";+"SB_CAT_poi_highlight_DESC" = "视频的最精彩或核心片段。可使用“跳至”快速跳转。";+"SB_CAT_filler" = "过渡/无意义填充";+"SB_CAT_filler_DESC" = "与视频主题无关的闲聊、笑话或填充片段。";++"SB_SKIPPED" = "已跳过 %@ 片段";+"SB_DETECTED" = "检测到 %@ 片段。\\n是否跳过该片段?";+"SB_SKIP_NOW" = "跳过";+"SB_UNSKIP" = "取消跳过";+"SB_JUMPED_TO_HIGHLIGHT" = "已跳转至高光时刻";+"SB_JUMP_TO_HIGHLIGHT" = "有可用高光时刻。是否跳转到该位置?";+"SB_SEGMENT_COLOR_SUFFIX" = "片段颜色";+"SB_SECTION_MAIN" = "主要";+"SB_SKIP_ALERT_DURATION" = "跳过提示时长";+"SB_UNSKIP_ALERT_DURATION" = "取消跳过提示时长";+"SB_MIN_DURATION_SLIDER" = "可跳过片段的最小时长";