From 50ea7af31977afded2dec79808707ab43ff0fa94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E8=B0=B7=E5=89=91=E4=BB=99?= Date: Tue, 18 Jun 2024 20:11:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E9=AB=98sanbon=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=8F=B0=E7=9B=B4=E6=8E=A5=E8=BF=90=E8=A1=8C=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script.js | 13 ++++++++++--- service-worker.js | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/script.js b/script.js index 6382d083..05932cae 100644 --- a/script.js +++ b/script.js @@ -1382,9 +1382,16 @@ Formation.prototype.getSanbonV2Script = function() const [members,assists,badge] = this.teams[0]; const scriptLines = [`(async ()=>{ "use strict"; - const __NEXT_DATA__ = document.getElementById("__NEXT_DATA__"); - const __NEXT_DATA__JSON = JSON.parse(__NEXT_DATA__.innerHTML); - const buildId = __NEXT_DATA__JSON.buildId; + let buildId; + if (typeof __NEXT_DATA__ !== 'undefined') { + buildId = __NEXT_DATA__?.buildId; + } else { + const Zstr = window.__next_f.find(o=>o?.[1]?.startsWith("0:"))[1]; + const regRes = /"buildId":"([\\w\\-]+)"/ig.exec(Zstr); + buildId = regRes[1]; + } + if (!buildId) throw Error("buildId not found."); + const region = "${region}"; async function fetchFlattened(id) { diff --git a/service-worker.js b/service-worker.js index 7617a9cc..2492fd0f 100644 --- a/service-worker.js +++ b/service-worker.js @@ -29191,7 +29191,7 @@ const cachesMap = new Map([ ], [ "script.js", - "5ccf991a960d65a22dafaecdb56ffdce" + "e404ffcfe61737efab3476ec7da3ceef" ], [ "solo.html",