MCPcopy Create free account
hub / github.com/ClydeTime/Surge / main

Function main

Script/Task/xmly.js:88–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86}
87
88async function main() {
89 config.headers = $.getjson(name + "_headers", {})
90 config.watch = $.getjson(name + "_watch", {})
91 config.spec = $.getjson(name + "_spec", {})
92 //config.gene = $.getjson(name + "_gene", {})
93 config.xm_cookie = `${typeof config['headers']['Cookie']=='undefined' ? config['headers']['cookie'] : config['headers']['Cookie']}`
94 let sign_flag = await xmlySign()
95
96 if (sign_flag) {
97 let watch_message = ""
98 //let gene_message = ""
99 let spec_message = ""
100
101 inspect("watch")
102
103 if (check("watch", 5)) {
104 let exec_times = 6 - config.watch.num
105 $.log("### 看广告任务进行中")
106 for (let i=0; i<exec_times; i++) {
107 let token = await adVideoGetToken()
108 if (token != "null") {
109 await adVideoFinish(token)
110 } else {
111 $.log("- 获取token失败,无法完成观看任务")
112 }
113 }
114 if (config.watch.num == 6) {
115 watch_message = `🟢 今日视频任务已全部完成`
116 } else {
117 watch_message = `🟡 今日视频任务尚未完成`
118 }
119 } else {
120 watch_message = `🟢 今日视频任务已全部完成`
121 }
122 $.log(watch_message)
123
124/* inspect("gene")
125
126 if (check("gene", 6)) {
127 let gene_flag = true
128 let exec_times = 7 - config.gene.num
129 if (exec_times != 0) {
130 $.log("### 通用任务进行中")
131 let listSet = [101, 143, 176, 177, 180, 260, 264] //任务列表分别为「逛福利列表, 浏览会员频道, 哈利波特互动页, 逛官方商城, 今日热点, 支付宝消费金, 答题赢积分, 浏览会员商品页(失效249), 123狂欢节(失效227), 高德领水果(失效224), 双十一特惠-(任务结束216), 年货节问卷(225), 点评(217), 百度(104)」
132 for (let i=0; i<exec_times; i++) {
133 await takeGeneralTask(listSet[i])
134 let temp_flag = await handInGeneralTask(listSet[i])
135 if (temp_flag == false) {
136 gene_flag = false
137 }
138 }
139 }
140
141 if (gene_flag) {
142 config.gene.num = 7
143 config.gene.time = format(startTime)
144 $.setdata(JSON.stringify(config.gene), name + "_gene")
145 gene_message = `🟢 今日通用任务已全部完成`

Callers 1

xmly.jsFile · 0.70

Calls 15

xmlySignFunction · 0.85
inspectFunction · 0.85
adVideoGetTokenFunction · 0.85
adVideoFinishFunction · 0.85
voiceAddFunction · 0.85
voiceDeleteFunction · 0.85
giveDynamicsLikeFunction · 0.85
cancelDynamicsLikeFunction · 0.85
giveVoiceLikeFunction · 0.85
cancelVoiceLikeFunction · 0.85
userAddFunction · 0.85
userDeleteFunction · 0.85

Tested by

no test coverage detected