From 3ba3d8206ccedec0a0d667dcc987226841a0c061 Mon Sep 17 00:00:00 2001 From: awakcon1234 <150042917+awakcon1234@users.noreply.github.com> Date: Thu, 30 Jul 2026 10:57:58 +0700 Subject: [PATCH 1/2] fix: update user card proxy list and compatibility with `allorigins` --- counters/User Card by Belikhun/user-card.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/counters/User Card by Belikhun/user-card.js b/counters/User Card by Belikhun/user-card.js index e0d4d613..fee41591 100644 --- a/counters/User Card by Belikhun/user-card.js +++ b/counters/User Card by Belikhun/user-card.js @@ -607,13 +607,18 @@ const UserCardPanel = { }, async tryFetch(url, { - retries = 3, + retries = 4, delay = 1000, timeout = 10000 } = {}) { const proxies = [ - "https://api.codetabs.com/v1/proxy/?quest=", - "https://api.allorigins.win/get?url=" + // codetabs had ceased operations on june 30 2026 (https://github.com/jolav/codetabs) + // "https://api.codetabs.com/v1/proxy/?quest=", + + "https://api.allorigins.win/get?url=", + + // last resort + "https://proxy.belikhun.dev/" ]; for (let attempt = 1; attempt <= retries; attempt++) { @@ -621,6 +626,10 @@ const UserCardPanel = { const proxy = proxies[(attempt - 1) % proxies.length]; const proxiedUrl = proxy + encodeURIComponent(url); const response = await fetch(proxiedUrl, { timeout }).then(res => res.json()); + + if (proxy.includes("allorigins")) + return JSON.parse(response.contents); + return response; } catch (error) { console.warn(`Fetch attempt ${attempt} failed:`, error); From 0c26da6e318be69c32c1ec0b2b11276fb36c2da1 Mon Sep 17 00:00:00 2001 From: awakcon1234 <150042917+awakcon1234@users.noreply.github.com> Date: Thu, 30 Jul 2026 11:02:10 +0700 Subject: [PATCH 2/2] feat: reduce user card's cached data validity to 5 minutes --- counters/User Card by Belikhun/user-card.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/counters/User Card by Belikhun/user-card.js b/counters/User Card by Belikhun/user-card.js index fee41591..0c2b45fd 100644 --- a/counters/User Card by Belikhun/user-card.js +++ b/counters/User Card by Belikhun/user-card.js @@ -560,7 +560,7 @@ const UserCardPanel = { color: g.colour, playmodes: g.playmodes })), - expire: Date.now() + (4 * 60 * 60 * 1000), + expire: Date.now() + (5 * 60 * 1000), }; localStorage.setItem(`user-data-${userId}`, JSON.stringify(data));