每日签到奶昔超市积分商城奶昔访达
返回列表 发布新帖
查看: 472|回复: 12

[云厂商] 阿里云CDN白嫖到2051年、华为云Versatile白嫖到2034年全自动续费脚本

发表于 2025-12-24 00:12:23 | 查看全部 |阅读模式

登录后免广告,享受更多奶昔会员权益!

您需要 登录 才可以下载或查看,没有账号?注册

×
阿里云CDN能白嫖到2051年
1、进去选择免费版、不要选择基础款或其他,付费0元购买。
2、进入套餐管理页面,设置续费规则,弹出的页面选续费一年,支付0元。
3、每次续费一年,重复执行25次,领满到2050年,结束。
注意:需要把脚本中 const newUrl = ‘https://common-buy.aliyun.com/?o ... 9w1w6r9zpc%E2%80%99
替换为自己的续费购买页面链接
自动薅.txt (6.29 KB, 下载次数: 24)

华为云 Versatile 平台(免费版)每次可续费 1 个月,支付金额 0 元,可以续费到 2034 年(120 次续费)
由于平台产品升级维护中,目前已临时关闭自行订阅通道。需进入官方微信群进行申请开通:https://bbs.huaweicloud.com/foru ... 0683166027-1-1.html
确保账户已开通 Versatile
进入华为云续费管理页面确认有 Versatile 实例。
完整油猴脚本代码
  1. // ==UserScript==
  2. // @name         华为云自动续费助手
  3. // @namespace    http://tampermonkey.net/
  4. // @version      1.0
  5. // @description  自动点击华为云续费管理页面的 "续费"、"去支付" 按钮
  6. // @author       You
  7. // @match        https://account.huaweicloud.com/usercenter/*
  8. // @grant        window.close
  9. // @grant        GM_openInTab
  10. // @run-at       document-idle
  11. // ==/UserScript==

  12. (function () {
  13.     'use strict';

  14.     console.log('[华为云助手] 脚本已启动');

  15.     // 配置项
  16.     const CONFIG = {
  17.         retryInterval: 500, // 重试间隔 (ms)
  18.         maxAttempts: 60,    // 最大重试次数 (30秒)
  19.     };

  20.     /**
  21.      * 等待元素出现
  22.      * @param {string} selector CSS选择器
  23.      * @param {string|null} textContent 包含的文本 (可选)
  24.      * @returns {Promise<Element>}
  25.      */
  26.     function waitForElement(selector, textContent = null) {
  27.         return new Promise((resolve, reject) => {
  28.             let attempts = 0;

  29.             const check = () => {
  30.                 attempts++;
  31.                 const elements = document.querySelectorAll(selector);

  32.                 for (const elem of elements) {
  33.                     // 如果指定了文本,检查文本内容是否包含;否则直接返回第一个匹配项
  34.                     if (!textContent || (elem.textContent && elem.textContent.includes(textContent))) {
  35.                         console.log(`[华为云助手] 找到元素: ${selector} "${textContent || ''}"`);
  36.                         resolve(elem);
  37.                         return;
  38.                     }
  39.                 }

  40.                 if (attempts >= CONFIG.maxAttempts) {
  41.                     console.warn(`[华为云助手] 未找到元素: ${selector} "${textContent || ''}"`);
  42.                     reject(new Error(`未找到元素: ${selector}`));
  43.                 } else {
  44.                     setTimeout(check, CONFIG.retryInterval);
  45.                 }
  46.             };

  47.             check();
  48.         });
  49.     }

  50.     /**
  51.      * 点击元素并记录
  52.      */
  53.     async function clickElement(element, description) {
  54.         console.log(`[华为云助手] 点击: ${description}`);
  55.         element.click();
  56.         await delay(1000);
  57.     }

  58.     function delay(ms) {
  59.         return new Promise(resolve => setTimeout(resolve, ms));
  60.     }

  61.     // --- 页面处理逻辑 ---

  62.     // 1. 续费管理页面 (Renewal Management)
  63.     async function handleRenewalPage() {
  64.         console.log('[华为云助手] 正在执行续费管理页面逻辑...');
  65.         
  66.         try {
  67.             // 方案1: 使用 ID 选择器(更精确)
  68.             let renewBtn = null;
  69.             
  70.             try {
  71.                 // 尝试通过 ID 模式匹配(匹配包含 "_renew" 的 span)
  72.                 renewBtn = await waitForElement('span[id*="_renew"]', '续费');
  73.             } catch (e) {
  74.                 console.log('[华为云助手] 未找到 ID 匹配的续费按钮,尝试备用选择器...');
  75.                 // 方案2: 使用 class 组合选择器
  76.                 renewBtn = await waitForElement('.ti3-action-menu-item.ng-star-inserted', '续费');
  77.             }
  78.             
  79.             if (renewBtn) {
  80.                 await clickElement(renewBtn, '续费按钮');
  81.                 console.log('[华为云助手] ✅ 续费页面操作完成,等待进入购买页...');
  82.             }
  83.         } catch (error) {
  84.             console.error('[华为云助手] ❌ 续费页面执行出错:', error);
  85.         }
  86.     }

  87.     // 2. 购买/确认页面 (Buy Page)
  88.     async function handleBuyPage() {
  89.         console.log('[华为云助手] 正在执行购买/配置页面逻辑...');
  90.         try {
  91.             // 用户验证过的"1个月"按钮选择器
  92.             const durationBtn = await waitForElement('.item-box.ng-star-inserted', '1个月');
  93.             if (durationBtn) {
  94.                 await clickElement(durationBtn, '时长选择(1个月)');
  95.             }

  96.             // 等待价格刷新
  97.             await delay(1500);

  98.             // 用户验证过的"去支付"按钮选择器
  99.             const submitBtn = await waitForElement('#submit_bnt_renew', '去支付');
  100.             if (submitBtn) {
  101.                 await clickElement(submitBtn, '去支付按钮');
  102.                 console.log('[华为云助手] ✅ 购买配置完成,等待进入支付页...');
  103.             }
  104.         } catch (error) {
  105.            console.error('[华为云助手] ❌ 购买/支付页面执行出错:', error);
  106.         }
  107.     }

  108.     // 3. 支付收银台 (Cashier)
  109.     async function handlePaymentPage() {
  110.          console.log('[华为云助手] 正在执行支付页面逻辑...');
  111.          try {
  112.             // 直接查找 #payconfirm 按钮
  113.             const confirmBtn = await waitForElement('#payconfirm', '确认付款');

  114.             if (confirmBtn) {
  115.                 await clickElement(confirmBtn, '确认付款按钮');
  116.                 console.log('[华为云助手] ✅ 支付操作完成');
  117.                
  118.                 // 等待支付处理完成
  119.                 await delay(2000);
  120.                
  121.                 // 查找并点击"返回续费管理"按钮
  122.                 console.log('[华为云助手] 查找"返回续费管理"按钮...');
  123.                 try {
  124.                     const returnBtn = await waitForElement('#toMyRenew', '返回续费管理');
  125.                     if (returnBtn) {
  126.                         await clickElement(returnBtn, '返回续费管理按钮');
  127.                         console.log('[华为云助手] ✅ 已返回续费管理页面');
  128.                         
  129.                         // 等待页面跳转完成
  130.                         await delay(2000);
  131.                         
  132.                         // 刷新页面以更新资源状态
  133.                         console.log('[华为云助手] 刷新页面以更新资源状态...');
  134.                         location.reload();
  135.                     }
  136.                 } catch (e) {
  137.                     console.log('[华为云助手] 未找到返回按钮,可能已自动跳转');
  138.                 }
  139.             }
  140.          } catch (e) {
  141.              console.error('[华为云助手] ❌ 未找到支付收银台按钮:', e);
  142.          }
  143.     }

  144.     // --- 路由控制 ---

  145.     function router() {
  146.         const url = window.location.href;
  147.         const hash = window.location.hash;
  148.         console.log('[华为云助手] 当前 URL:', url);
  149.         console.log('[华为云助手] 当前 Hash:', hash);

  150.         // 检查页面上是否存在关键元素来判断页面类型
  151.         const hasPayConfirmBtn = document.querySelector('#payconfirm');
  152.         const hasRenewalTable = document.querySelector('[id*="renewal_td"]');
  153.         const hasSubmitRenewBtn = document.querySelector('#submit_bnt_renew');

  154.         console.log('[华为云助手] 页面元素检测:', {
  155.             hasPayConfirmBtn: !!hasPayConfirmBtn,
  156.             hasRenewalTable: !!hasRenewalTable,
  157.             hasSubmitRenewBtn: !!hasSubmitRenewBtn
  158.         });

  159.         // 优先级1: 支付页面(通过元素检测)
  160.         if (hasPayConfirmBtn) {
  161.             console.log('[华为云助手] 检测到支付页面(通过 #payconfirm 元素)');
  162.             handlePaymentPage();
  163.         }
  164.         // 优先级2: 购买配置页面(通过元素检测)
  165.         else if (hasSubmitRenewBtn) {
  166.             console.log('[华为云助手] 检测到购买配置页面(通过 #submit_bnt_renew 元素)');
  167.             handleBuyPage();
  168.         }
  169.         // 优先级3: 续费管理页面(通过 URL 或元素检测)
  170.         else if (url.includes('/userindex/renewalManagement') || hash.includes('renewalManagement') || hasRenewalTable) {
  171.             console.log('[华为云助手] 检测到续费管理页面');
  172.             handleRenewalPage();
  173.         }
  174.         // 备用:通过 URL 关键词判断
  175.         else if (url.includes('common-buy') || url.includes('order')) {
  176.             console.log('[华为云助手] 通过 URL 检测到购买页面');
  177.             handleBuyPage();
  178.         }
  179.         else if (url.includes('pay') || url.includes('cashier')) {
  180.             console.log('[华为云助手] 通过 URL 检测到支付页面');
  181.             handlePaymentPage();
  182.         }
  183.         else {
  184.             console.log('[华为云助手] 未匹配到任何已知页面类型');
  185.         }
  186.     }

  187.     // --- 启动 & 监听 ---

  188.     // 1. 立即执行一次
  189.     if (document.readyState === 'loading') {
  190.         document.addEventListener('DOMContentLoaded', router);
  191.     } else {
  192.         router();
  193.     }

  194.     // 2. 监听 URL 变化 (针对单页应用 SPA)
  195.     let lastUrl = location.href;
  196.     new MutationObserver(() => {
  197.         const url = location.href;
  198.         if (url !== lastUrl) {
  199.             lastUrl = url;
  200.             console.log('[华为云助手] URL 变化检测:', url);
  201.             // URL 变化后等待一点时间让 DOM 渲染
  202.             setTimeout(router, 1500);
  203.         }
  204.     }).observe(document, {subtree: true, childList: true});

  205. })();
复制代码
收起

在油猴安装好脚本后,打开https://account.huaweicloud.com/ ... x/renewalManagement
脚本会自动执行以下流程:
  1. 点击 “续费” 按钮
  2. 选择 “1个月” 时长
  3. 点击 “去支付”
  4. 点击 “确认付款”(0 元)
  5. 点击 “返回续费管理”
  6. 刷新页面,重复上述流程
复制代码
也可以打开浏览器控制台(F12),查看脚本执行日志:
  1. [华为云助手] 脚本已启动
  2. [华为云助手] 检测到续费管理页面
  3. [华为云助手] 找到元素: span[id*="_renew"] "续费"
  4. [华为云助手] 点击: 续费按钮
  5. ...
复制代码
祝大家白嫖愉快!
爱生活,爱奶昔~
回复

使用道具 举报

发表于 2025-12-24 01:32:32 | 查看全部
不错,谢谢
爱生活,爱奶昔~
发表于 2025-12-24 03:03:03 来自手机 | 查看全部

厉害兄弟
爱生活,爱奶昔~
发表于 2025-12-24 08:03:27 | 查看全部
阿里云cdn免费版给多少资源?
爱生活,爱奶昔~
发表于 2025-12-24 08:08:25 | 查看全部
谢谢分享
爱生活,爱奶昔~
发表于 2025-12-24 09:45:30 | 查看全部
感谢分享,脚本很好用
爱生活,爱奶昔~
发表于 2025-12-25 15:16:41 | 查看全部
感谢分享,收藏了
爱生活,爱奶昔~
发表于 2025-12-25 15:20:10 | 查看全部
esa没备案比edgeone还慢
爱生活,爱奶昔~
发表于 2025-12-25 15:33:57 | 查看全部
谢谢分享
爱生活,爱奶昔~
发表于 2025-12-25 15:39:20 | 查看全部
感谢分享
爱生活,爱奶昔~
发表于 2025-12-26 10:55:13 | 查看全部
都续到千年以后了
爱生活,爱奶昔~
发表于 2025-12-26 15:12:51 | 查看全部
谢谢提供 就是不能下载啊
爱生活,爱奶昔~
发表于 2025-12-26 16:01:19 | 查看全部
不错 ~
爱生活,爱奶昔~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

© 2026 Naixi Networks. 沪ICP备13020230号-1|沪公网安备 31010702007642号手机版小黑屋RSS
返回顶部 关灯 在本版发帖
快速回复 返回顶部 返回列表