-
Notifications
You must be signed in to change notification settings - Fork 17
发现一个油猴脚本"智谱 GLM Coding 特惠订购抢购助手" #22
-
- 发现一个油猴脚本智谱 GLM Coding 特惠订购抢购助手 (需要科学上网,没有网络条件的可以直接看下面的脚本)
也可以自行去搜索,greasyfork里有不止一个脚本,上面这个更新最及时
基本信息
介绍
用于在前端代码中去除按钮的disabled属性,使其在界面上显示为可点击状态。这仅影响前端表现,不改变后端逻辑。
🚀 智谱 GLM Coding Plan 抢购保姆级攻略【本脚本及攻略已协助200+网友抢购成功,脚本安装量已经破1000+】
一、 抢购前准备(至关重要)
提前候场:务必提前 10分钟 打开购买页面。临近抢购时流量激增,踩点进场极易遇到页面卡顿或无法加载的情况,切记不要刷新浏览器,刷新后有可能打不开。
配置脚本:如果您使用了"篡改猴 (Tampermonkey)"等浏览器脚本扩展来辅助抢购,请务必前往浏览器的扩展详情页,开启"允许运行用户脚本"或"允许访问文件网址"权限。若未开启,脚本将无法正常生效。
锁定目标:提前在页面上切换并选中您想要购买的套餐界面,做好准备。
二、 卡点抢购实战
精准对时:在浏览器新建一个标签页,百度搜索"北京时间"作为精确的时间参考。
支付准备: 提前准备好支付扫码的手机,能不能购买成功最后还是看谁先支付。
提前出手与无视报错:在倒计时至 09:59:58 时,即可开始高频点击特惠订购按钮。如果提示"当前购买人数较多,请稍后重试",这是官方防刷的限流队列爆满,请绝对不要放弃,一定要无视报错继续狂点!
甄别空单与光速支付:一旦成功挤进队列,界面会弹出付款二维码。若扫码查无金额(这说明时间未到,后端未真正生成有效订单),务必关闭空弹窗继续点击,直到出现包含实际付款金额的二维码,立刻扫码付款!完成支付即代表购买成功。
三、 🎁 专属购卡福利
新购立减 5%:如果您觉得这份攻略有帮助,欢迎通过我的邀请链接购买。新用户通过此链接下单,可额外享受 5% 的金额立减优惠!
👉 专属邀请链接:https://www.bigmodel.cn/glm-coding?ic=EVDHUUYDNB
四、 💡 极客小贴士(关于前端解禁与现象推测)
本脚本目前通过修改前端代码解除了按钮的 disabled 状态,但这仅改变了界面表现,能否购买成功仍取决于后端校验。
关于报错与空单的推测:很多朋友反馈,即便解除了前端限制,点击时常会遇到"购买人数较多"的提示,偶发情况会弹出空的二维码。这大概率是因为官方设置了类似排队的接口限流保护,同时辅以严格的后端时间校验:当流量过大时请求可能会被直接拦截;而偶发通过拦截的请求,若未到真正10点放票,下发的往往也是无效的空支付信息。基于这些表现,在正确的时间节点坚持高频点击,依然是目前最朴素有效的策略。
黄金五分钟捡漏法则:千万别以为开局没抢到就没戏了!根据网友实战反馈,因为部分人抢到后未能及时付款,系统会退回名额。一直到 10:05 分 之前都还有成功"捡漏"上车的案例。
脚本内容
// ==UserScript==
// @name 智谱 GLM Coding 特惠订购抢购助手
// @name:en 智谱 GLM Coding 特惠订购抢购助手
// @namespace http://tampermonkey.net/
// @version 6.3.8
// @description 用于在前端代码中去除按钮的disabled属性,使其在界面上显示为可点击状态。这仅影响前端表现,不改变后端逻辑。
// @description:en 用于在前端代码中去除按钮的disabled属性,使其在界面上显示为可点击状态。这仅影响前端表现,不改变后端逻辑。modifying the front-end code to remove the `disabled` attribute from the purchase button
// @author YourName
// @match *://www.bigmodel.cn/*
// @match https://www.bigmodel.cn/glm-coding
// @match https://bigmodel.cn/glm-coding*
// @run-at document-start
// @grant none
// @buy me a coff 邀请链接,邀请码新购,下单立减5%金额 https://www.bigmodel.cn/glm-coding?ic=EVDHUUYDNB
// @license MIT
// ==/UserScript==
(function() {
'use strict';
console.log('[抢购助手2.0] 🚀 网络拦截器已在页面最早期启动...');
// ==========================================
// 战术一:拦截 SSR 页面初始注入数据与内部方法解析
// 通过劫持浏览器的 JSON 解析器,任何带有"售罄"属性的对象强制改为"有货"
// ==========================================
const originalJSONParse = JSON.parse;
JSON.parse = function(text, reviver) {
let result = originalJSONParse(text, reviver);
// 递归遍历所有解析出的对象属性
function deepModify(obj) {
if (!obj || typeof obj !== 'object') return;
// 篡改核心售罄标识
if (obj.isSoldOut === true) obj.isSoldOut = false;
if (obj.soldOut === true) obj.soldOut = false;
// 如果遇到 disabled,且该对象看起来是个商品(包含 price/id 等),则强制启用
if (obj.disabled === true && (obj.price !== undefined || obj.productId || obj.title)) {
obj.disabled = false;
}
// 有些系统会下发库存数量,顺手给它改大
if (obj.stock === 0) obj.stock = 999;
for (let key in obj) {
if (obj[key] && typeof obj[key] === 'object') {
deepModify(obj[key]);
}
}
}
try { deepModify(result); } catch (e) {}
return result;
};
// ==========================================
// 战术二:拦截 Fetch 接口请求
// 针对用户在页面停留时,前端向后端发起的存量/价格二次检查
// ==========================================
const originalFetch = window.fetch;
window.fetch = async function(...args) {
const response = await originalFetch.apply(this, args);
// 我们只处理 JSON 接口
const contentType = response.headers.get('content-type') || '';
if (contentType.includes('application/json')) {
const clone = response.clone();
try {
let text = await clone.text();
// 粗暴地全局替换响应体文字中的售罄状态
if (text.includes('"isSoldOut":true') || text.includes('"disabled":true') || text.includes('"soldOut":true')) {
console.log('[抢购助手] 拦截到 Fetch 售罄数据,正在执行篡改!', args[0]);
text = text.replace(/"isSoldOut":true/g, '"isSoldOut":false')
.replace(/"disabled":true/g, '"disabled":false')
.replace(/"soldOut":true/g, '"soldOut":false')
.replace(/"stock":0/g, '"stock":999');
// 构造并返回一份假的响应给 Vue
return new Response(text, {
status: response.status,
statusText: response.statusText,
headers: response.headers
});
}
} catch (e) {}
}
return response;
};
// ==========================================
// 战术三:拦截老式的 XMLHttpRequest (兜底)
// ==========================================
const originalXHROpen = XMLHttpRequest.prototype.open;
const originalXHRSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.open = function(method, url, ...rest) {
this._reqUrl = url;
return originalXHROpen.call(this, method, url, ...rest);
};
XMLHttpRequest.prototype.send = function(...args) {
this.addEventListener('readystatechange', function() {
if (this.readyState === 4 && this.status === 200) {
const contentType = this.getResponseHeader('content-type') || '';
if (contentType.includes('application/json')) {
try {
let text = this.responseText;
if (text.includes('"isSoldOut":true') || text.includes('"disabled":true') || text.includes('"soldOut":true')) {
console.log('[抢购助手] 拦截到 XHR 售罄数据,正在执行篡改!', this._reqUrl);
text = text.replace(/"isSoldOut":true/g, '"isSoldOut":false')
.replace(/"disabled":true/g, '"disabled":false')
.replace(/"soldOut":true/g, '"soldOut":false');
// 用劫持 getter 的方式修改 this.responseText 给框架层消化
Object.defineProperty(this, 'responseText', { get: function() { return text; } });
Object.defineProperty(this, 'response', { get: function() { return JSON.parse(text); } });
}
} catch (e) {}
}
}
});
originalXHRSend.apply(this, args);
};
})();
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 9 comments 3 replies
-
(瞎说)(吐槽) 老外现在也学会翻墙进国内抢GLM了......更抢不到了,不知道半年后能不能不用抢直接买啊....
Beta Was this translation helpful? Give feedback.
All reactions
-
waiting~~~,glm大陆版确实实惠
Beta Was this translation helpful? Give feedback.
All reactions
-
笑死,根本抢不到,白白做了10分钟验证码,全都是当前购买人数较多,请稍后重试
唯一生成的一个订单还是没有价格的
Beta Was this translation helpful? Give feedback.
All reactions
-
还是没抢到。要么人太多,要么没金额。有什么技巧么?
Beta Was this translation helpful? Give feedback.
All reactions
-
我来还愿了、抢到了!
image
Beta Was this translation helpful? Give feedback.
All reactions
-
怎么抢的,我提前进去页面,到点了之后 一点反应都没有
Beta Was this translation helpful? Give feedback.
All reactions
-
niuB
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.
All reactions
-
失效了
Beta Was this translation helpful? Give feedback.
All reactions
-
已经不能用了,点了半小时的验证码,就算点出来二维码还是空的没法付款
Beta Was this translation helpful? Give feedback.
All reactions
-
前来还愿
QQ20260522-100444
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.