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

Function xmlySign

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

Source from the content-addressed store, hash-verified

210}
211
212async function xmlySign(){
213 $.log("### 签到任务进行中")
214 let headers = {
215 "Cookie": config.xm_cookie,
216 "Content-Type": "application/json"
217 }
218 let body = `{"aid":87}`
219 let myRequest = {
220 url: "http://hybrid.ximalaya.com/web-activity/signIn/v2/signIn?v=new",
221 headers: headers,
222 body: body
223 }
224 return await $.http.post(myRequest).then(
225 (response) => {
226 body = JSON.parse(response.body)
227 if (body.ret == 0) {
228 $.log("- 签到成功")
229 return true
230 } else {
231 $.log("- 签到失败")
232 $.log("- 请重新获取cookie")
233 return false
234 }
235 },(reason) => {
236 $.log("- 签到失败")
237 return false
238 }
239 )
240}
241
242async function flushTaskRecords(){
243 let headers = {

Callers 1

mainFunction · 0.85

Calls 3

logMethod · 0.45
postMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected