CheckinScripts/dyjsb.js

125 lines
36 KiB
JavaScript
Raw Permalink Normal View History

2022-08-03 20:20:34 +08:00
/**
作者临渊
日期7-1
软件抖音极速版
2022-08-06 13:14:47 +08:00
功能签到看广告看小说搜索
抓包进入活动后 api5-normal-c-hl.amemv.com 域名请求体里cookie
2022-08-06 10:02:42 +08:00
变量格式export dyjsAPP='xxx'
2022-08-04 23:02:55 +08:00
Cron 13,43 8-18,23 * * *
2022-08-03 20:20:34 +08:00
不支持多账号不支持多账号不支持多账号多账号跑会有错误
[task_local]
#抖音极速版
2022-08-06 13:14:47 +08:00
10,40 8-18,23 * * * https://raw.githubusercontent.com/LinYuanovo/scripts/main/dyjsb.js, tag=抖音极速版, enabled=true
2022-08-03 20:20:34 +08:00
[rewrite_local]
https://api5-normal-c-hl.amemv.com/luckycat/aweme/v1/task url script-request-header https://raw.githubusercontent.com/LinYuanovo/scripts/main/dyjsb.js
[MITM]
hostname = api5-normal-c-hl.amemv.com
*/
const $ = new Env('抖音极速');
const notify = $.isNode() ? require('./sendNotify') : '';
const {log} = console;
const Notify = 2; //0为关闭通知1为完成任务进行通知2为23.40之后推送一次余额默认为2
const debug = 0; //0为关闭调试1为打开调试默认为0
2022-08-06 13:14:47 +08:00
let scriptVersion = "1.0.1";
2022-08-03 20:20:34 +08:00
//////////////////////
2022-08-06 13:14:47 +08:00
const _0x4d09=['push','getTimezoneOffset','headers','req_id','constructor','get','【上传步数】','\x20============','key','console','\x22,\x22ad_inspire\x22:\x22{\x22score_amount\x22:\x22888\x22,\x22amount\x22:\x22\x22,\x22req_id\x22:\x22','【上传',',\x22submit_time\x22:','搜索赚金币','compile','reward_amount','cookie','\x0a\x0a【debug】===============这是\x20开宝箱\x20返回data==============','【领取第','sendNotify','hasOwnProperty','v1/task/page',',现金余额:','/walk/step_submit?aid=2329&device_platform=android&update_version_code=21040000','\x22,\x22ad_inspire\x22:\x22{\x22score_amount\x22:\x22888\x5c\x22,\x22req_id\x22:\x22','/done/treasure_task?aid=2329&device_platform=android&update_version_code=21040000','excitation_ad_info','return\x20/\x22\x20+\x20this\x20+\x20\x22/','\x0a\x20【','\x20个账号\x20===================','ad_id','\x0a【领取视频奖励】今日已达上限','amount','步数】','warn','forEach','indexOf','*/*','\x0a\x0a【debug】===============这是\x20上传步数\x20返回data==============','toLocaleString','\x0a【debug】===============\x20这是\x20获取任务列表\x20请求\x20url\x20===============','./sendNotify','【领取步数奖励】','\x0a\x0a【debug】===============这是\x20领取视频奖励\x20返回data==============','/done/excitation_ad_treasure_box?aid=2329&device_platform=android&update_version_code=21040000','\x0a\x0a【debug】===============这是\x20签到\x20返回data==============','msg','【开宝箱】','done_limit','err_tips','split','\x0a【debug】===============\x20这是\x20领取搜索奖励\x20请求\x20url\x20===============','today_step','stringify','\x0a【debug】===============\x20这是\x20开宝箱\x20请求\x20url\x20===============','err_no','undefined','getdata','error','\x0a【debug】===============\x20这是\x20上传步数\x20请求\x20url\x20===============','isNode','\x0a【debug】===============\x20这是\x20领取看小说奖励\x20请求\x20url\x20===============','次看小说奖励】',',获得:','log','\x0a【领取开宝箱视频奖励】','\x0a\x0a=============================================\x20\x20\x20\x20\x0a脚本执行\x20-\x20北京时间(UTC+8)','exception','api5-normal-c-hl.amemv.com','apply','daily_times','已达到上限','task_list','看小说赚金币','\x0a=========\x20开始【第\x20','setdata','\x22,\x22amount\x22:\x22888\x22,\x22ad_rit\x22:\x22','done_time','{\x22step\x22:','amount1','wait','\x0a【领取第','status_extra','https://api5-normal-c-hl.amemv.com/luckycat/aweme/v1/task','data','\x0a【debug】===============\x20这是\x20领取签到视频奖励\x20请求\x20url\x20===============','trace','length','\x22}\x22,\x22ad_alias_position\x22:\x22check_in\x22,\x22timeout\x22:4000}','\x0a金币余额','return\x20(function()\x20','dyjsAPP','/done/read_novel?aid=2329&device_platform=android&update_version_code=21040000','\x0a【debug】===============\x20这是\x20领取开宝箱视频奖励\x20请求\x20url\x20===============','【领取视频奖励】','/done/sign_in?aid=2329&device_platform=android&update_version_code=21040000','金币余额:','\x0a\x0a【debug】===============这是\x20领取开宝箱视频奖励\x20返回data==============','debug','income_data','\x20,不用请自行关闭重写!','finally','【debug】\x20这是你的全部账号数组:\x0a\x20','{}.constructor(\x22return\x20this\x22)(\x20)','个\x20ck\x20成功:\x20','\x0a【debug】===============\x20这是\x20获取签到详情\x20请求\x20url\x20===============','【领取开宝箱视频奖励】','today_times','\x0a\x0a【debug】===============这是\x20领取看小说奖励\x20返回data==============','【领取搜索奖励】','/page?aid=2329&device_platform=android&update_version_code=21040000','{\x22task_key\x22:\x22','env','amount2','看广告赚金币','name','\x0a【签到】','\x0a\x0a【debug】===============这是\x20领取签到视频奖励\x20返回data==============','score_amount','\x0a===================\x20共找到\x20','\x0adebug===============\x20这是\
2022-08-03 20:20:34 +08:00
2022-08-06 13:14:47 +08:00
/**
* 随机数生成
*/
function randomString(e) {
e = e || 32;
var t = "QWERTYUIOPASDFGHJKLZXCVBNM1234567890",
a = t.length,
n = "";
for (i = 0; i < e; i++)
n += t.charAt(Math.floor(Math.random() * a));
return n
}
/**
* 随机整数生成
*/
function randomInt(min, max) {
return Math.round(Math.random() * (max - min) + min)
}
/**
* 获取毫秒时间戳
*/
function timestampMs(){
return new Date().getTime();
}
/**
* 获取秒时间戳
*/
function timestampS(){
return Date.parse(new Date())/1000;
}
/**
* 获取随机诗词
*/
function poem(timeout = 3 * 1000) {
return new Promise((resolve) => {
let url = {
url: `https://v1.jinrishici.com/all.json`
}
$.get(url, async (err, resp, data) => {
try {
data = JSON.parse(data)
log(`${data.content} \n————《${data.origin}${data.author}`);
} catch (e) {
log(e, resp);
} finally {
resolve()
}
}, timeout)
})
}
/**
* 修改配置文件
*/
function modify() {
fs.readFile('/ql/data/config/config.sh','utf8',function(err,dataStr){
if(err){
return log('读取文件失败!'+err)
}
else {
var result = dataStr.replace(/regular/g,string);
fs.writeFile('/ql/data/config/config.sh', result, 'utf8', function (err) {
if (err) {return log(err);}
});
}
})
}
/**
* 获取远程版本
*/
function getVersion(timeout = 3 * 1000) {
return new Promise((resolve) => {
let url = {
url: `https://raw.gh.fakev.cn/LinYuanovo/scripts/main/dyjsb.js`,
}
$.get(url, async (err, resp, data) => {
try {
scriptVersionLatest = data.match(/scriptVersion = "([\d\.]+)"/)[1]
} catch (e) {
$.logErr(e, resp);
} finally {
resolve()
}
}, timeout)
})
}
2022-08-03 20:20:34 +08:00
2022-08-04 23:02:55 +08:00
function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.