MCPcopy Create free account
hub / github.com/Semporia/Scripts / updateInviteCodeCDN

Function updateInviteCodeCDN

jd_small_home.js:794–813  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

792 })
793}
794function updateInviteCodeCDN(url) {
795 return new Promise(async resolve => {
796 $.get({url, headers:{"User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1")}, timeout: 200000}, async (err, resp, data) => {
797 try {
798 if (err) {
799 console.log(`${JSON.stringify(err)}`)
800 console.log(`${$.name} API请求失败,请检查网路重试`)
801 } else {
802 $.inviteCodes = JSON.parse(data);
803 }
804 } catch (e) {
805 $.logErr(e, resp)
806 } finally {
807 resolve();
808 }
809 })
810 await $.wait(3000)
811 resolve();
812 })
813}
814function taskUrl(url, body = {}) {
815 return {
816 url: `${JD_API_HOST}/${url}?body=${escape(body)}`,

Callers 1

jd_small_home.jsFile · 0.85

Calls 6

getMethod · 0.45
isNodeMethod · 0.45
getdataMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected