From 8131ca8f15fab8c398bbd45e8fc27dda3350b05e Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Tue, 28 May 2024 09:15:48 +0700 Subject: [PATCH] USRBG: support new simplified profile (#2501) Co-authored-by: vee --- src/plugins/usrbg/index.tsx | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/plugins/usrbg/index.tsx b/src/plugins/usrbg/index.tsx index b92839a9..1221cb9c 100644 --- a/src/plugins/usrbg/index.tsx +++ b/src/plugins/usrbg/index.tsx @@ -27,10 +27,10 @@ import style from "./index.css?managed"; const API_URL = "https://usrbg.is-hardly.online/users"; interface UsrbgApiReturn { - endpoint: string - bucket: string - prefix: string - users: Record + endpoint: string; + bucket: string; + prefix: string; + users: Record; } const settings = definePluginSettings({ @@ -73,6 +73,19 @@ export default definePlugin({ } ] }, + { + find: /overrideBannerSrc:\i,profileType:/, + replacement: [ + { + match: /(\i)\.premiumType/, + replace: "$self.premiumHook($1)||$&" + }, + { + match: /(?<=function \i\((\i)\)\{)(?=var.{30,50},overrideBannerSrc:)/, + replace: "$1.overrideBannerSrc=$self.useBannerHook($1);" + } + ] + }, { find: "\"data-selenium-video-tile\":", predicate: () => settings.store.voiceBackground, @@ -123,7 +136,7 @@ export default definePlugin({ return !!this.data?.users[userId]; }, - getImageUrl(userId: string): string|null { + getImageUrl(userId: string): string | null { if (!this.userHasBackground(userId)) return null; // We can assert that data exists because userHasBackground returned true