/******************************

脚本功能：大神水印——解锁VIP
下载地址：https://is.gd/CzynmP
软件版本：2.5.0
使用声明：此脚本仅供学习与交流，请勿转载与贩卖！⚠️⚠️⚠️

*******************************

[rewrite_local]

^http[s]?:\/\/mars.inout.top\/user\/get_user_info url script-response-body https://git.vsprit.com/shawenguan/Quantumult-X/raw/master/Scripts/others/dssy.js
^http[s]?:\/\/mars.inout.top\/media\/editor\/inpaint url script-response-body https://git.vsprit.com/shawenguan/Quantumult-X/raw/master/Scripts/others/dssy.js

[mitm] 

hostname = mars.inout.top

*******************************/
try {
    const url = $request.url;
    const path = $request.path;
    // console.log(`请求path=${path}#${$request.method}`);
    let data = JSON.parse(typeof $response != "undefined" && $response.body || null);
    switch (path) {
        case '/user/get_user_info':
            if(data && data.data){
                data.data['nickname'] = 'VIP已解锁';
                data.data['vip_expire_time'] = 4076744128000;
                data.data['auto_subscribe_or_permanent_vip'] = true;
                data.data['is_lifetime_membership'] = true;
                $done({ body: JSON.stringify(data) });
            }
            break;
        case '/media/editor/inpaint':
            // data['code'] = 200;
            // data['succ'] = true;
            $done({ body: JSON.stringify(data) });
            break;
    }
} catch (err) {
    $done();
}