登录后免广告,享受更多奶昔会员权益!
您需要 登录 才可以下载或查看,没有账号?注册
×
隔壁看到的,刚刷了600多余额,其实刷多少都无所谓就怕被清零!
使用方法也很简单,先登录exa.ai
然后打开Exa API Dashboard:https://dashboard.exa.ai/billing
兑换码填入EXA50API(用过了也可以填,这个是用来抓请求的),脚本会自动抓取请求
脚本弹出窗口后按你喜好设置值即可,注意每次使用过的值范围不可进行再次使用,不可使用小数等,点击确认后将会自动请求
油猴脚本 - // ==UserScript==
- // @name EXA API 优惠码自动兑换器
- // @namespace http://tampermonkey.net/
- // @version 1.0
- // @description 自动尝试兑换 EXA API 的优惠码
- // @author You
- // @match https://dashboard.exa.ai/*
- // @grant GM_xmlhttpRequest
- // @grant GM_setValue
- // @grant GM_getValue
- // @grant GM_notification
- // ==/UserScript==
- (function () {
- 'use strict';
- // =================== 配置区域 ===================
- const TEAM_ID = "YOUR_TEAM_ID_HERE"; // 请替换为你的 Team ID
- const COOKIE = "YOUR_COOKIE_HERE"; // 请替换为你的完整 Cookie
- const COUPON_PREFIX = "EXA";
- const COUPON_SUFFIX = "API";
- let START_NUMBER = 20;
- const MIN_DELAY = 1000; // 毫秒
- const MAX_DELAY = 5000;
- const MAX_ATTEMPTS = 0; // 0 表示无限循环
- // ================================================
- const BASE_URL = "https://dashboard.exa.ai/api/stripe/redeem-coupons";
- const HEADERS = {
- "accept": "application/json, text/plain, */*",
- "accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
- "cache-control": "no-cache",
- "content-type": "application/json",
- "origin": "https://dashboard.exa.ai",
- "pragma": "no-cache",
- "referer": "https://dashboard.exa.ai/billing",
- "sec-ch-ua": '"Chromium";v="142", "Google Chrome";v="142", "Not_A Brand";v="99"',
- "sec-ch-ua-mobile": "?0",
- "sec-ch-ua-platform": '"macOS"',
- "sec-fetch-dest": "empty",
- "sec-fetch-mode": "cors",
- "sec-fetch-site": "same-origin",
- "user-agent": navigator.userAgent,
- "cookie": COOKIE
- };
- // 工具函数
- function getTimestamp() {
- return new Date().toLocaleString();
- }
- function randomDelay() {
- return Math.floor(Math.random() * (MAX_DELAY - MIN_DELAY + 1)) + MIN_DELAY;
- }
- function log(...args) {
- console.log(`[${getTimestamp()}]`, ...args);
- }
- function redeemCoupon(code) {
- return new Promise((resolve) => {
- GM_xmlhttpRequest({
- method: "POST",
- url: BASE_URL,
- headers: HEADERS,
- data: JSON.stringify({
- couponCode: code,
- description: "EXA API $50 Coupon",
- teamId: TEAM_ID
- }),
- onload: function (response) {
- try {
- const json = JSON.parse(response.responseText);
- resolve({ status: response.status, body: json });
- } catch (e) {
- resolve({ status: response.status, body: response.responseText });
- }
- },
- onerror: function (err) {
- resolve({ status: null, body: err });
- }
- });
- });
- }
- async function start() {
- if (TEAM_ID === "YOUR_TEAM_ID_HERE" || COOKIE === "YOUR_COOKIE_HERE") {
- alert("❌ 错误:请先填写你的 TEAM_ID 和 COOKIE!");
- return;
- }
- let currentNumber = GM_getValue("current_number", START_NUMBER);
- let attempt = GM_getValue("attempt", 0);
- let successCount = GM_getValue("success_count", 0);
- let failCount = GM_getValue("fail_count", 0);
- let successfulCodes = GM_getValue("successful_codes", []);
- log(`🎰 EXA 优惠码自动兑换脚本启动`);
- log(` Team ID: ${TEAM_ID.substring(0, 8)}...${TEAM_ID.slice(-4)}`);
- log(` 起始优惠码: ${COUPON_PREFIX}${currentNumber}${COUPON_SUFFIX}`);
- log(` 模式: 递增轮询 (+1)`);
- log(` 延时范围: ${MIN_DELAY / 1000}s - ${MAX_DELAY / 1000}s`);
- log(` 最大尝试次数: ${MAX_ATTEMPTS === 0 ? '无限' : MAX_ATTEMPTS}`);
- log("提示:按 F12 查看控制台日志,按 Ctrl+Shift+I 打开开发者工具");
- try {
- while (true) {
- attempt += 1;
- if (MAX_ATTEMPTS > 0 && attempt > MAX_ATTEMPTS) {
- log(`已达到最大尝试次数 (${MAX_ATTEMPTS}),退出。`);
- break;
- }
- const couponCode = `${COUPON_PREFIX}${currentNumber}${COUPON_SUFFIX}`;
- log(`第 ${attempt} 次尝试...`);
- log(` 🎫 优惠码: ${couponCode}`);
- const { status, body } = await redeemCoupon(couponCode);
- if (status === null) {
- log(`❌ 请求异常: ${body}`);
- failCount++;
- } else if (status === 200) {
- log(`✅ 成功! 响应:`, body);
- successCount++;
- successfulCodes.push(couponCode);
- GM_notification({
- title: "🎉 EXA 优惠码兑换成功",
- text: `兑换码: ${couponCode}`,
- timeout: 4000
- });
- } else if (status === 401 || status === 403) {
- log(`❌ 认证失败!请检查 Cookie 是否正确或已过期`);
- alert("认证失败,请检查 Cookie 或 Team ID!");
- break;
- } else {
- log(`❌ 失败 (状态码: ${status})`);
- log(`响应:`, body);
- failCount++;
- }
- currentNumber++;
- GM_setValue("current_number", currentNumber);
- GM_setValue("attempt", attempt);
- GM_setValue("success_count", successCount);
- GM_setValue("fail_count", failCount);
- GM_setValue("successful_codes", successfulCodes);
- const delay = randomDelay();
- log(`⏳ 等待 ${delay / 1000}s 后继续...`);
- await new Promise(r => setTimeout(r, delay));
- }
- } catch (e) {
- log("用户中断或发生错误:", e.message);
- }
- log(`📊 统计信息:`);
- log(` 总尝试次数: ${attempt}`);
- log(` 成功次数: ${successCount}`);
- log(` 失败次数: ${failCount}`);
- log(` 最后尝试的编号: ${currentNumber - 1}`);
- if (successfulCodes.length > 0) {
- log(`🎉 成功的优惠码:`);
- successfulCodes.forEach(code => log(` - ${code}`));
- }
- }
- // 在页面加载后运行
- window.addEventListener('load', () => {
- setTimeout(start, 2000); // 等待页面加载完成
- });
- })();
复制代码收起 |