利用WPS实现【夸克网盘】全自动签到获取永久容量

利用WPS实现【夸克网盘】全自动签到获取永久容量插图羊毛日报

之前分享过利用WPS的AirScript实现【阿里云盘的全自动签到】,今天再来分享一下【夸克网盘】全自动签到获取永久容量的方法。

利用WPS实现【夸克网盘】全自动签到获取永久容量插图1羊毛日报
利用WPS实现【夸克网盘】全自动签到获取永久容量插图1羊毛日报

零成本,无服务器实现阿里云盘自动签到,轻松获得签到奖励

 

 

准备工作,先来获取夸克Cookie,教程如下:

1.电脑浏览器打开夸克网盘,先不登录的情况下 按 F12 ,选择“网络”,如图所示:

利用WPS实现【夸克网盘】全自动签到获取永久容量插图3羊毛日报

扫码登录后,请选择”sort?pr=ucpro&fr=pc“名称文件,并下滑找到”Cookie“所对应的值就是你的Cookie,如下图所示。

利用WPS实现【夸克网盘】全自动签到获取永久容量插图4羊毛日报

 

如果你需要复用之前阿里云盘签到配置的推送,可以直接在之前创建的表格中新建一个名为 夸克网盘 的工作表。再把新建一个脚本粘贴下方的代码,再把获取到的夸克网盘Cookie 放在 A 列即可,支持多账号,一行一个。

源码开源地址:https://registry.npmmirror.com/@asunajs/dist/0.0.3/files/quark.wps.js

完整代码如下:

 

    // ../../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(`\u4ECA\u65E5\u5DF2\u7B7E\u5230${sign_rewards[sign_progress - 1].name}\uFF0C\u8FDE\u7B7E\u8FDB\u5EA6${sign_progress}/${sign_target}\u3002`);
                return;
            }
            let dailyReward = signIn($);
            dailyReward && $.logger.info(`\u7B7E\u5230\u6210\u529F\uFF0C\u83B7\u5F97${dailyReward / 1048576}M\uFF0C\u8FDE\u7B7E\u8FDB\u5EA6${sign_progress + 1}/${sign_target}\u3002`);
        } 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 || err || ![
                0,
                200,
                void 0
            ].some((c)=>code === c)) return logger.error(`${name}\u53D1\u9001\u5931\u8D25`, JSON.stringify(data));
            logger.info(`${name}\u5DF2\u53D1\u9001\uFF01`);
        } catch (error) {
            logger.info(`${name}\u53D1\u9001\u5931\u8D25: ${error.message}`);
        }
    }
    function pushplus(apiOption, { token, ...option }, title, text) {
        return _send(apiOption, "pushplus", {
            url: "http://www.pushplus.plus/send",
            method: "POST",
            data: {
                token: token,
                title: title,
                content: text,
                ...option
            }
        });
    }
    function serverChan(apiOption, { token, ...option }, title, text) {
        return _send(apiOption, "Server酱", {
            url: `https://sctapi.ftqq.com/${token}.send`,
            headers: {
                "content-type": "application/x-www-form-urlencoded"
            },
            data: {
                text: title,
                desp: text.replaceAll(`
`, `

`),
                ...option
            }
        });
    }
    function workWeixin(apiOption, { msgtype = "text", touser = "@all", agentid, corpid, corpsecret, ...option }, title, text) {
        try {
            let { access_token } = apiOption.http.fetch({
                url: "https://qyapi.weixin.qq.com/cgi-bin/gettoken",
                method: "POST",
                data: {
                    corpid: corpid,
                    corpsecret: corpsecret
                },
                headers: {
                    "Content-Type": "application/json"
                }
            });
            return _send(apiOption, "企业微信推送", {
                url: `https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=${access_token}`,
                data: {
                    touser: touser,
                    msgtype: msgtype,
                    agentid: agentid,
                    [msgtype]: {
                        content: `${title}

${text}`
                    },
                    ...option
                }
            });
        } catch (error) {
            apiOption.logger.error("企业微信推送失败"), apiOption.logger.error(error);
        }
    }
    function workWeixinBot(apiOption, { url, msgtype = "text", ...option }, title, text) {
        return _send(apiOption, "企业微信Bot推送", {
            url: url,
            data: {
                msgtype: msgtype,
                [msgtype]: {
                    centent: `${title}

${text}`
                },
                ...option
            }
        });
    }
    function bark(apiOption, { key, level = "passive", ...options }, title, text) {
        return _send(apiOption, "Bark ios 推送", {
            url: `https://api.day.app/${key}`,
            data: {
                body: text,
                title: title,
                level: level,
                ...options
            }
        });
    }
    function twoIm(apiOption, { key, sid, query, msgtype = "text", ...options }, title, text) {
        let urlSearch = new URLSearchParams({
            key: key,
            sid: sid
        });
        return query && Object.entries(query).forEach(([key2, value])=>{
            urlSearch.append(key2, String(value));
        }), _send(apiOption, "Bark ios 推送", {
            url: `https://api.2im.cn/push?${urlSearch.toString()}`,
            data: {
                msgtype: msgtype,
                content: text,
                title: title,
                ...options
            }
        });
    }
    // ../utils/index.ts
    function createSimpleRequest(headers) {
        return {
            get: (url)=>HTTP.get(url, {
                    headers: headers
                }).json(),
            post: (url, data)=>HTTP.post(url, typeof data == "string" ? data : JSON.stringify(data), {
                    headers: headers
                }).json()
        };
    }
    function getPushConfig() {
        let usedRange2 = Application.Sheets.Item("推送").UsedRange;
        if (!usedRange2) return console.log("未开启推送"), {};
        let cells = usedRange2.Columns.Cells, columnEnd = Math.min(50, usedRange2.ColumnEnd), rowEnd = Math.min(50, usedRange2.RowEnd), pushConfig = {};
        for(let option = usedRange2.Column; option <= columnEnd; option++){
            let t = {}, item = cells.Item(option);
            if (item.Text) {
                pushConfig[item.Text] = t;
                for(let kv = 1; kv <= rowEnd; kv++){
                    let key = item.Offset(kv).Text;
                    key.trim() && (t[key] = valueHandle(item.Offset(kv, 1).Text.trim()));
                }
            }
        }
        let base = pushConfig.base;
        if (!base) return pushConfig;
        return delete pushConfig.base, {
            ...pushConfig,
            ...base
        };
        function valueHandle(value) {
            return value === "TRUE" || value === "是" ? !0 : value === "FALSE" || value === "否" ? !1 : value;
        }
    }
    function email({ logger }, email2, title, text) {
        try {
            if (!email2 || !email2.pass || !email2.from || !email2.host) return;
            let port = email2.port || 465, toUser = email2.to || email2.from;
            SMTP.login({
                host: email2.host,
                // 域名
                port: port,
                // 端口
                secure: port === 465,
                // TLS
                username: email2.from,
                // 账户名
                password: email2.pass
            }).send({
                from: `${title} <${email2.from}>`,
                to: toUser,
                subject: title,
                text: text.replace(/\n/g, `\r
`)
            }), logger.info("邮件消息已发送");
        } catch (error) {
            logger.error("邮件消息发送失败", error.message);
        }
    }
    function sendNotify(op, data, title, text) {
        let cbs = {
            pushplus: pushplus,
            serverChan: serverChan,
            workWeixin: workWeixin,
            email: email,
            workWeixinBot: workWeixinBot,
            bark: bark,
            twoIm: twoIm
        };
        for (let [name, d] of Object.entries(data)){
            let cb = cbs[name];
            cb && cb(op, d, title, text);
        }
    }
    function sendWpsNotify(pushData2, pushConfig) {
        if (pushData2.length && pushConfig && !(pushConfig.onlyError && !pushData2.some((el)=>el.type === "error"))) {
            let msg = pushData2.map((m)=>`[${m.type} ${m.date.toLocaleTimeString()}]${m.msg}`).join(`
`);
            msg && sendNotify({
                logger: createLogger(),
                http: {
                    fetch: (op)=>(op.data && typeof op.data != "string" && (op.body = JSON.stringify(op.data)), HTTP.fetch(op.url, op).json())
                }
            }, pushConfig, pushConfig.title || "asign 运行推送", msg);
        }
    }
    // index.ts
    function main(cookie, option) {
        if (!cookie) return;
        let logger = createLogger({
            pushData: option && option.pushData
        }), $ = {
            api: createApi(createSimpleRequest({
                "content-type": "application/json",
                "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0",
                cookie: cookie
            })),
            logger: logger,
            sleep: Time.sleep
        };
        $.logger.info("--------------"), run($);
    }
    var sheet = Application.Sheets.Item("夸克网盘") || Application.Sheets.Item("quark") || ActiveSheet, usedRange = sheet.UsedRange, columnA = sheet.Columns("A"), len = usedRange.Row + usedRange.Rows.Count - 1, pushData = [];
    for(let i = 1; i <= len; i++){
        let cell = columnA.Rows(i);
        cell.Text && (console.log(`\u6267\u884C\u7B2C ${i} \u884C`), main(cell.Text, {
            pushData: pushData
        }));
    }
    sendWpsNotify(pushData, getPushConfig());

汇集全网高性价比手机号卡套餐

文章声明   本站名称:羊毛日报
  本站永久网址:https://yangmaoribao.com/
  本站发布的内容具有时效性,本站不承诺任何用户在参与活动中可以百分百的获得奖品奖励。
  本站发布的内容中涉及的所有优惠活动规则、活动奖品发放及最终解释权归原举办公司所有。
  本站发布的所有活动均需按活动规则正常参与,如有用户利用活动漏洞非法牟利与本站无关。
  如果有侵犯您的权益请私信联系羊毛君 QQ:16700231 ,核实后会第一时间做删除处理。

给TA打赏
共{{data.count}}人
人已打赏
奇技淫巧

山东电信在线改5元无忧卡套餐教程

2024-3-15 10:17:09

奇技淫巧

山东电信星卡隐藏福利合集:白嫖月租、半价话费、短信代码、十元宽带、会员权益等

2024-3-30 10:05:16


扫码进群


    随手一点,助力本站SEO优化
    关键词不能为空
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索