开篇寄语
伯衡君在上一篇文章介绍了有关cloudflare wrap的相关消息,说过要写一篇如何免费得到cloudflare wrap+的流量,这篇就是,那么要怎么刷呢?于是有了今天的文章。
应用介绍
这是一个github项目,由程序员【yyuueexxiinngg】发布并分享出来,项目地址是https://github.com/yyuueexxiinngg/some-scripts/tree/master/cloudflare,分为js脚本和py脚本,本篇以js脚本来说,比较适合零基础的操作。
操作方法
1.获得AFF ID, 进入 Cloudflare WARP ,点击右上角的「设置」按钮,进入“更多设置”——“诊断” , 客户端配置里面的 ID 即为“AFF ID” 。
2. 下载js脚本,链接是https://github.com/yyuueexxiinngg/some-scripts/blob/master/cloudflare/cloudflare-warp-plus-aff.js,修改YOUR REFERRER ID为获得的AFFID,timestoloop和retrytimes可以任意修改,代码如下:
// Fake register for referrer to get warp plus bandwidth const referrer = "YOUR REFERRER ID"; const timesToLoop = 10; const retryTimes = 5; const https = require("https"); const zlib = require("zlib"); async function init() { for (let i = 0; i < timesToLoop; i++) { if (await run()) { console.log(i + 1, "OK"); } else { console.log(i + 1, "Error"); for (let r = 0; r < retryTimes; r++) { if (await run()) { console.log(i + 1, "Retry #" + (r + 1), "OK"); break; } else { console.log(i + 1, "Retry #" + (r + 1), "Error"); if (r === retryTimes - 1) { return; } } } } } } async function run() { return new Promise(resolve => { const install_id = genString(11); const postData = JSON.stringify({ key: `${genString(43)}=`, install_id: install_id, fcm_token: `${install_id}:APA91b${genString(134)}`, referrer: referrer, warp_enabled: false, tos: new Date().toISOString().replace("Z", "+07:00"), type: "Android", locale: "zh_CN" }); const options = { hostname: "api.cloudflareclient.com", port: 443, path: "/v0a745/reg", method: "POST", headers: { "Content-Type": "application/json", Host: "api.cloudflareclient.com", Connection: "Keep-Alive", "Accept-Encoding": "gzip", "User-Agent": "okhttp/3.12.1", "Content-Length": postData.length } }; const req = https.request(options, res => { const gzip = zlib.createGunzip(); // const buffer = []; res.pipe(gzip); gzip .on("data", function(data) { // buffer.push(data.toString()); }) .on("end", function() { // console.dir(JSON.parse(buffer.join(""))); resolve(true); }) .on("error", function(e) { // console.error(e); resolve(false); }); }); req.on("error", error => { // console.error(error); resolve(false); }); req.write(postData); req.end(); }); } function genString(length) { // https://stackoverflow.com/a/1349426/11860316 let result = ""; const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; const charactersLength = characters.length; for (let i = 0; i < length; i++) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } return result; } init();
3.将上方代码复制粘贴到新建的txt文本中,修改AFF ID和时间后,保存,将.txt修改为.js.
4.下载Node.js程序,下载地址是:https://nodejs.org/en/,建议选择左边的。
5.安装完成后,按下win+R,输入cmd回车,调出命令窗口,如把刚才的脚本命名为wrapplus.js,而我们放在了E盘内,那么请先输入“E:”,然后回车,之后再输入node wrapplus.js回车即可,如果没有调整时间循环次数,那么就是按照10次的循环执行了。如果觉得不够,多执行几次即可。
- 我的微信
- 微信扫一扫加好友
- 我的微信公众号
- 扫描关注公众号