Skip to content

gaze #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 10, 2025
Merged

gaze #31

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: gaze index error
  • Loading branch information
Hiram-Wong committed Apr 10, 2025
commit 1ff018c6eebd2514c25ddd03f902687738396c18
14 changes: 2 additions & 12 deletions js/gaze.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,7 @@ class Go {
}
_makeFuncWrapper(funcId) {
const self = this;
console.log("正在绑定函数id:", funcId);
return function () {
console.log("执行函数id:", funcId);
console.log("函数参数:", Array.from(arguments));
const event = {
id: funcId,
this: this,
Expand All @@ -248,7 +245,6 @@ class Go {
self._pendingEvent = event;
self._resume();
const result = event.result;
console.log("函数结果:", result);
return result;
};
}
Expand Down Expand Up @@ -319,11 +315,8 @@ const decryptor = (() => {
return bytesToString(result);
};
const decryptStream = async (data, mid, key, url) => {
const indexMa = url.split('/').at(-1);
if (!indexMa) return url;
const index = indexMa[1];
const istr = `${index}+gazes_v-@_info`;
console.log(istr);
if (!url.includes("gazes_v-@_info")) return url;
const istr = url.split("/").at(-1);
const ungzipped = pako.ungzip(data, {
to: "string",
});
Expand Down Expand Up @@ -581,21 +574,18 @@ var rule = {
const resp = await axios.get(`${this.host}/filter`, {
headers: this.headers,
});

// cookie 处理
const headers = resp.headers;
const cookies = headers["set-cookie"];
const cookie = cookies.map((item) => item.split(";")[0]).join("; ");
this.headers.Cookie = cookie;

// 请求头处理
const html = resp.data;
const kv_macth = html.match(/'headers':({[^{}]*})/)[1];
const kv_headers = new Function(`return ${kv_macth}`)();
for (const key in kv_headers) {
this.headers[key] = kv_headers[key];
}

console.warn("headers", this.headers);
},
};