From aa8a378ec85edfc6b7b5f7ac936861af410b9a7f Mon Sep 17 00:00:00 2001 From: Nikhil Badyal Date: Mon, 17 Oct 2022 23:01:42 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Supports=20Custom=20branding=20now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 9 +++------ src/config.py | 4 ++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 32260cf..1a1f9a1 100644 --- a/main.py +++ b/main.py @@ -33,15 +33,12 @@ def main() -> None: if config.build_og_nd_branding_youtube: logger.info("Rebuilding youtube") all_patches = parser.get_all_patches() - branding_patch = "custom-branding" - if config.build_extended: - branding_patch = "custom-branding-icon-blue" - branding_index = all_patches.index(branding_patch) + branding_index = all_patches.index(config.branding_patch) was_og_build = True if all_patches[branding_index - 1] == "-e" else False - output = "-custom-icon-" if was_og_build else "" + output = "-custom-icon-" if was_og_build else "-original-icon-" app = "youtube" _, version, is_experimental = patcher.get_app_configs(app) - parser.invert_patch(branding_patch) + parser.invert_patch(config.branding_patch) parser.patch_app( app=app, version=version, diff --git a/src/config.py b/src/config.py index f139547..6bac9f2 100644 --- a/src/config.py +++ b/src/config.py @@ -57,3 +57,7 @@ class RevancedConfig: "youtube_music": f"{self.apk_mirror_urls.get('youtube_music')}youtube-music", } self.build_og_nd_branding_youtube = env.bool("BUILD_OG_BRANDING_YOUTUBE", False) + self.branding_patch = env.str( + "BRANDING_PATCH", + "custom-branding-icon-blue" if self.build_extended else "custom-branding", + )