wps实现夸克网盘自动签到领永久空间
发布日期:2024-07-22 05:46 点击次数:132
1、打开金山文档网页版:www.kdocs.cn ,新建excel表格。
图片
2、点击【效率】-【高级开发】-【AirScript脚本编辑器】
图片
3、点击【创建脚本】-【文档共享脚本】
图片
4、新建脚本,将下面的代码拷到文本内并保存
// ../../core/quark/api.ts function createApi(http) { let driveUrl = 'https://drive-m.quark.cn/1/clouddrive/capacity/growth'; return { getInfo: function() { return http.get(`${driveUrl}/info?pr=ucpro&fr=pc&uc_param_str=`); }, sign: function() { return http.post(`${driveUrl}/sign?pr=ucpro&fr=pc&uc_param_str=`, { sign_cyclic: !0 }); } }; } // ../../core/quark/index.ts function getInfo($) { try { let { data, code, status, message } = $.api.getInfo(); if (code !== 0) { $.logger.info('获取用户信息失败', code, status, message); return; } return data.cap_sign; } catch (error) { $.logger.error('获取用户信息异常', error.message); } } function signIn($) { try { let { data, code, status, message } = $.api.sign(); if (code !== 0) { $.logger.info('签到失败', code, status, message); return; } return data.sign_daily_reward; } catch (error) { $.logger.error('签到异常', error.message); } } function run($) { try { let info = getInfo($); if (!info) { $.logger.error('登录失败'); return; } let { sign_progress, sign_rewards, sign_target, sign_daily } = info; if (sign_daily) { $.logger.info(`今日已签到${sign_rewards[sign_progress - 1].name},连签进度${sign_progress}/${sign_target}。`); return; } let dailyReward = signIn($); dailyReward && $.logger.info(`签到成功,获得${dailyReward / 1048576}M,连签进度${sign_progress + 1}/${sign_target}。`); } catch (error) { $.logger.error('运行异常', error.message); } } // ../../packages/utils-pure/index.ts function createLogger(options) { let wrap = (type, ...args)=>{ if (options && options.pushData) { let msg = args.reduce((str, cur)=>`${str} ${cur}`, '').substring(1); options.pushData.push({ msg: msg, type: type, date: /* @__PURE__ */ new Date() }); } console[type](...args); }; return { info: (...args)=>wrap('info', ...args), error: (...args)=>wrap('error', ...args), debug: (...args)=>wrap('info', ...args) }; } // ../../core/push/index.ts function _send({ logger, http }, name = '自定义消息', options) { try { let requestOptions = { method: 'POST', headers: { 'Content-Type': 'application/json' }, timeout: 1e4, ...options }; Reflect.has(options, 'data') && Reflect.has(options.data, 'agent') && (requestOptions.agent = options.data.agent, delete options.data.agent); let data = http.fetch(requestOptions), { errcode, code, err } = data; if (errcode