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

Function adVideoGetToken

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

Source from the content-addressed store, hash-verified

697}
698
699async function adVideoGetToken(){
700 let headers = {
701 "Cookie": config.xm_cookie,
702 'Content-Type': `application/json`
703 }
704 let body = `{"aid":112,"taskId":252}`
705 let myRequest = {
706 url: `http://m.ximalaya.com/web-activity/task/v2/genTaskToken`,
707 headers: headers,
708 body: body
709 }
710 return await $.http.post(myRequest).then(
711 (response) => {
712 body = JSON.parse(response.body)
713 if (body.ret == 0) {
714 let token = body.data.token
715 return token
716 } else {
717 $.log("- !!!token获取失败")
718 let token = "null"
719 return token
720 }
721 },(reason) => {
722 $.log("- !!!token获取失败")
723 let token = "null"
724 return token
725 }
726 )
727}
728
729async function adVideoFinish(token){
730 let headers = {

Callers 1

mainFunction · 0.85

Calls 3

postMethod · 0.45
parseMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected