1.购买服务器
阿里云:
服务器购买地址
https://t.aliyun.com/U/t92SG6若失效,可用地址
https://www.aliyun.com/activity/wuying/dj?source=5176.29345612&userCode=49hts92d腾讯云:
https://curl.qcloud.com/wJpWmSfU若失效,可用地址
https://cloud.tencent.com/act/cps/redirect?redirect=2446&cps_key=ad201ee2ef3b771157f72ee5464b1fea&from=console华为云
https://activity.huaweicloud.com/cps.html?fromacct=64b5cf7cc11b4840bb4ed2ea0b2f4468&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=2019052.部署教程
3.代码如下
/**变量名 qzmCookie 抓包 x-qzm-token 每天0.6,满10提现,绑定支付宝时会自动提现0.3,秒到,*/const $ = new ENV("趣攒米视频任务", ["qzmCookie"]);const cookieArr = $.qzmCookie.split("&");class QZM {constructor(ck, index) {this.ck = ck.split("#")[0];this.index = ++index;this.oaid = this.randomString(16);this.androidId = this.randomString(16);}randomString(length) {// const table = "0123456789ABCDEF";const table = "0123456789abcdef";const _0x5ddc9a = {length: length};return Array.from(_0x5ddc9a, () => table[Math.floor(Math.random() * table.length)]).join("");}randomStringNum(length) {// const table = "0123456789ABCDEF";const table = "0123456789";const _0x5ddc9a = {length: length};return Array.from(_0x5ddc9a, () => table[Math.floor(Math.random() * table.length)]).join("");}async main() {const info = await this.getUserInfo();if (!info) {return void 0;}try {$.log(`账号[${this.index}]【${this.nickName}】 获取任务列表`)const tasks = await this.taskList()$.log(`账号[${this.index}]【${this.nickName}】 刷新令牌`)await this.access()for (const task of tasks) {const source = task.source;$.log(`账号[${this.index}]【${this.nickName}】 开始任务 ${task.name}`)for (let i = 0; i < 10; i++) {try {$.log(`账号[${this.index}]【${this.nickName}】 假装看广告 ${i+1}`)await this.ecpm();}catch (e) {console.log(e)}await $.wait(10000)}try {$.log(`账号[${this.index}]【${this.nickName}】 领取奖励`)const re = await this.reward(source)if (re){$.log(`账号[${this.index}]【${this.nickName}】 领取奖励成功`)}else {$.log(`账号[${this.index}]【${this.nickName}】 领取奖励失败`)}}catch (e) {console.log(e)}}} catch (e) {console.log(e)}try {$.log(`账号[${this.index}]【${this.nickName}】 兑换金币`)await this.getUserInfo()if (this.point>=1000){await this.trade(this.point)}else {$.log(`账号[${this.index}]【${this.nickName}】 当前金币数量不可兑换`)}}catch (e) {console.log(e)}}async getUserInfo() {const options = {'method': 'GET','url': 'https://api.quzanmi.com/api/user/info/mine','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','Connection': 'keep-alive','Origin': 'http://anh5.quzanmi.com','Pragma': 'no-cache','Referer': 'http://anh5.quzanmi.com/','Sec-Fetch-Dest': 'empty','Sec-Fetch-Mode': 'cors','Sec-Fetch-Site': 'cross-site','User-Agent': 'Mozilla/5.0 (Linux; Android 14; 22081212C Build/UKQ1.230917.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.3 Mobile Safari/537.36 AgentWeb/5.0.8 UCBrowser/11.6.4.950','sec-ch-ua': '"Android WebView";v="125", "Chromium";v="125", "Not.A/Brand";v="24"','sec-ch-ua-mobile': '?1','sec-ch-ua-platform': '"Android"','x-qzm-aid': `|${this.oaid}|${this.androidId}`,'x-qzm-bundle': 'com.zhangwen.quzanmi|Xiaomi|13|1.0.0','x-qzm-device': 'android','x-qzm-time': parseInt((Date.now() / 1000).toString()).toString(),'x-qzm-token': this.ck,}};const res = await $.request(options);if (res.code === 2000) {this.id = res.data.id;this.phone = res.data.phone_number;this.nickName = res.data.nickname;this.realName = res.data.realname;this.score = res.data.score;this.today_income = res.data.today_income;this.banlance = res.data.balance;this.payment_num = res.data.payment_num;this.point = res.data.point;this.total_balance = res.data.total_balance;// console.log( res.data)$.log(`账号[${this.index}]【${this.nickName}】 真名: ${this.realName} 手机号: ${this.phone}`);$.log(`账号[${this.index}]【${this.nickName}】 余额: ${this.banlance} 金币: ${this.point}`);return true;} else {$.log(`获取用户信息失败: ${res.message}`);return false;}}async taskList() {const options = {'method': 'GET','url': 'https://api.quzanmi.com/api/ad/android/list','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','Connection': 'keep-alive','Origin': 'http://anh5.quzanmi.com','Pragma': 'no-cache','Referer': 'http://anh5.quzanmi.com/','Sec-Fetch-Dest': 'empty','Sec-Fetch-Mode': 'cors','Sec-Fetch-Site': 'cross-site','User-Agent': 'Mozilla/5.0 (Linux; Android 14; 22081212C Build/UKQ1.230917.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.3 Mobile Safari/537.36 AgentWeb/5.0.8 UCBrowser/11.6.4.950','sec-ch-ua': '"Android WebView";v="125", "Chromium";v="125", "Not.A/Brand";v="24"','sec-ch-ua-mobile': '?1','sec-ch-ua-platform': '"Android"','x-qzm-aid': `|${this.oaid}|${this.androidId}`,'x-qzm-bundle': 'com.zhangwen.quzanmi|Redmi|14|1.0.1','x-qzm-device': 'android','x-qzm-time': parseInt((Date.now() / 1000).toString()).toString(),'x-qzm-token': this.ck,}};const res = await $.request(options);if (res.code === 2000) {const list = res.data.filter(item => item.source.includes("videoad"));// console.log(list)return list} else {$.log(`账号[${this.index}]【${this.nickName}】 获取任务列表 ${res.msg}`);return false;}}async access() {const options = {'method': 'POST','url': 'https://api.aibianxian.net/igame/api/v1.0/cplApi/access','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','Connection': 'keep-alive','Origin': 'http://anh5.quzanmi.com','Pragma': 'no-cache','Referer': 'http://anh5.quzanmi.com/','Sec-Fetch-Dest': 'empty','Sec-Fetch-Mode': 'cors','Sec-Fetch-Site': 'cross-site','User-Agent': 'Mozilla/5.0 (Linux; Android 14; 22081212C Build/UKQ1.230917.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.3 Mobile Safari/537.36 AgentWeb/5.0.8 UCBrowser/11.6.4.950','sec-ch-ua': '"Android WebView";v="125", "Chromium";v="125", "Not.A/Brand";v="24"','sec-ch-ua-mobile': '?1','sec-ch-ua-platform': '"Android"','x-qzm-aid': `|${this.oaid}|${this.androidId}`,'x-qzm-bundle': 'com.zhangwen.quzanmi|Redmi|14|1.0.1','x-qzm-device': 'android','x-qzm-time': parseInt((Date.now() / 1000).toString()).toString(),'x-qzm-token': this.ck,'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundaryZnyXeBEEvBYSL7mL'},formData: {'app_key': '142793900','device': 'android','device_info': this.oaid,'target_id': this.id}};const res = await $.request(options);// console.log(res)if (res.code == 200) {this.token = res.data.token;// console.log(this.token)return true} else {$.log(`账号[${this.index}]【${this.nickName}】 刷新令牌 ${res.msg}`);return false;}}randomEcpm(min, max) {// 生成一个介于min和max之间的随机整数const randomNumber = Math.floor(Math.random() * (max - min + 1)) + min;// 将随机数转换为字符串return randomNumber.toString();}async reward(source) {const options = {url: `https://api.quzanmi.com/api/ad/android/reward`,method: 'POST',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','Connection': 'keep-alive','Origin': 'http://anh5.quzanmi.com','Pragma': 'no-cache','Referer': 'http://anh5.quzanmi.com/','Sec-Fetch-Dest': 'empty','Sec-Fetch-Mode': 'cors','Sec-Fetch-Site': 'cross-site','Content-Type': 'application/json;charset=UTF-8','User-Agent': 'Mozilla/5.0 (Linux; Android 14; 22081212C Build/UKQ1.230917.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.3 Mobile Safari/537.36 AgentWeb/5.0.8 UCBrowser/11.6.4.950','sec-ch-ua': '"Android WebView";v="125", "Chromium";v="125", "Not.A/Brand";v="24"','sec-ch-ua-mobile': '?1','sec-ch-ua-platform': '"Android"','x-qzm-aid': `|${this.oaid}|${this.androidId}`,'x-qzm-bundle': 'com.zhangwen.quzanmi|Redmi|14|1.0.1','x-qzm-device': 'android','x-qzm-time': parseInt((Date.now() / 1000).toString()).toString(),'x-qzm-token': this.ck,},body: JSON.stringify({"source": source})}const res = await $.request(options);if (res.code === 2000) {return true} else {$.log(`账号[${this.index}]【${this.nickName}】 领取奖励 ${res.msg}`);return false;}}async ecpm() {const options = {url: `https://api.quzanmi.com/api/ad/app/ecpm`,method: 'POST',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','Connection': 'keep-alive','Origin': 'http://anh5.quzanmi.com','Pragma': 'no-cache','Referer': 'http://anh5.quzanmi.com/','Sec-Fetch-Dest': 'empty','Sec-Fetch-Mode': 'cors','Sec-Fetch-Site': 'cross-site','Content-Type': 'application/json;charset=UTF-8','User-Agent': 'Mozilla/5.0 (Linux; Android 14; 22081212C Build/UKQ1.230917.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.3 Mobile Safari/537.36 AgentWeb/5.0.8 UCBrowser/11.6.4.950','sec-ch-ua': '"Android WebView";v="125", "Chromium";v="125", "Not.A/Brand";v="24"','sec-ch-ua-mobile': '?1','sec-ch-ua-platform': '"Android"','x-qzm-aid': `|${this.oaid}|${this.androidId}`,'x-qzm-bundle': 'com.zhangwen.quzanmi|Redmi|14|1.0.1','x-qzm-device': 'android','x-qzm-time': parseInt((Date.now() / 1000).toString()).toString(),'x-qzm-token': this.ck,},body: JSON.stringify({"ecpm": this.randomEcpm(100000,800000)+".0", "source": "android", "kind": "rewardAd", "rit_id": "1"+this.randomStringNum(8)})}const res = await $.request(options);if (res.code === 2000) {return true} else {return false;}}async trade(point){const options = {url: 'https://api.quzanmi.com/api/user/point/trade',method: 'POST',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','Connection': 'keep-alive','Origin': 'http://anh5.quzanmi.com','Pragma': 'no-cache','Referer': 'http://anh5.quzanmi.com/','Sec-Fetch-Dest': 'empty','Sec-Fetch-Mode': 'cors','Sec-Fetch-Site': 'cross-site','User-Agent': 'Mozilla/5.0 (Linux; Android 14; 22081212C Build/UKQ1.230917.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.3 Mobile Safari/537.36 AgentWeb/5.0.8 UCBrowser/11.6.4.950','sec-ch-ua': '"Android WebView";v="125", "Chromium";v="125", "Not.A/Brand";v="24"','sec-ch-ua-mobile': '?1','sec-ch-ua-platform': '"Android"','x-qzm-aid': `|${this.oaid}|${this.androidId}`,'x-qzm-bundle': 'com.zhangwen.quzanmi|Redmi|14|1.0.1','x-qzm-device': 'android','x-qzm-time': parseInt((Date.now() / 1000).toString()).toString(),'x-qzm-token': this.ck,},body: JSON.stringify({"point": Math.floor(point / 1000) * 1000})}// console.log(options)const res = await $.request(options);// console.log(res)if (res.code === 2000) {$.log(`账号[${this.index}]【${this.nickName}】 兑换金币成功`);return true} else {$.log(`账号[${this.index}]【${this.nickName}】 兑换金币 ${res.msg}`);return false;}}};(async () => {const qzm = [];for (const index in cookieArr) {qzm.push(new QZM(cookieArr[index], index));}for (const qzmElement of qzm) {try {await qzmElement.main();} catch (e) {console.log(e)}}})();function ENV(name, envNames) {const request = require("request");const cryptoJS = require("crypto-js");return new class {constructor(name, envNames = []) {this.name = name;this.envNames = envNames;this.startTime = Date.now();this.logs = [];if (this.envNames.length > 0) {for (const envName of envNames) {this[envName] = process.env[envName];}}this.log(`🔔${this.name},开始!`)}log(...args) {args.length > 0 && (this.logs = [...this.logs, ...args])console.log(...args)}md5(str) {return cryptoJS.MD5(str).toString()}sha256(str) {return cryptoJS.SHA256(str).toString()}aesCBCEncrypt(data, key, iv) {const n = cryptoJS.enc.Hex.parse(key);const r = cryptoJS.enc.Hex.parse(iv);const o = cryptoJS.AES.encrypt(data, n, {iv: r,mode: cryptoJS.mode.CBC,padding: cryptoJS.pad.Pkcs7});return cryptoJS.enc.Base64.stringify(o.ciphertext);}aesCBCDecrypt(data, key, iv) {const n = cryptoJS.enc.Hex.parse(key);const r = cryptoJS.enc.Hex.parse(iv);const o = cryptoJS.AES.decrypt(data, n, {iv: r,mode: cryptoJS.mode.CBC,padding: cryptoJS.pad.Pkcs7});return o.toString(cryptoJS.enc.Utf8);}request(options) {options.gzip = true;return new Promise((resolve, reject) => {request(options, (error, response, body) => {if (error) {resolve(error)}try {const objBody = JSON.parse(body);resolve(objBody);} catch (e) {resolve(body)}})})}wait(time) {return new Promise((resolve) => setTimeout(resolve, time));}}(name, envNames)}
解析
这个JavaScript脚本是为了自动完成一些视频观看任务来赚取金币或收益的自动化脚本。脚本使用了一系列的HTTP请求来与趣攒米视频平台的API进行交互,从而执行任务、领取奖励和兑换金币。
主要方法
constructor - 初始化对象实例,为每个用户生成随机的
oaid和androidId,用于API请求中模拟不同的设备信息。randomString - 生成指定长度的随机字符串,使用小写字母和数字。此函数用于生成设备ID等。
randomStringNum - 生成指定长度的随机数字字符串。这可能用于生成某些需要随机数字的API参数。
main - 主函数,控制整个脚本的流程,包括获取用户信息、获取并执行任务列表、领取奖励以及金币的兑换等。
getUserInfo - 发送HTTP GET请求以获取用户信息,如昵称、余额等。
taskList - 获取可执行的任务列表,特别是视频广告相关的任务。
access - 可能用于刷新或获取访问令牌,维持或更新会话状态。
reward - 发送HTTP POST请求以领取完成任务后的奖励。
ecpm - 模拟完成一个广告任务,可能与平台的广告收入相关。
trade - 兑换积累的金币为现金或其他奖励。
ENV - 一个环境类,用于处理环境变量、发送网络请求、处理日志等。内部包含加密、解密、网络请求等辅助功能。
脚本使用request库来发送网络请求,并使用环境变量来存储敏感信息,如用户的cookie(通过qzmCookie)。脚本通过循环处理多个用户账户,每个账户都尝试完成一系列任务并尝试兑换金币。
注意:
本文部分变量已做脱敏处理,仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断。技术层面需要提供帮助,可以通过打赏的方式进行探讨。
没有评论:
发表评论