diff --git a/package/ctcgfw/luci-app-jd-dailybonus/Makefile b/package/ctcgfw/luci-app-jd-dailybonus/Makefile index e66652a6f0..2a4e56245a 100644 --- a/package/ctcgfw/luci-app-jd-dailybonus/Makefile +++ b/package/ctcgfw/luci-app-jd-dailybonus/Makefile @@ -12,8 +12,8 @@ LUCI_DEPENDS:=+node +node-request +coreutils +coreutils-nohup +wget LUCI_PKGARCH:=all PKG_NAME:=luci-app-jd-dailybonus -PKG_VERSION:=0.8.7 -PKG_RELEASE:=20201031 +PKG_VERSION:=0.8.8 +PKG_RELEASE:=20201204 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/ctcgfw/luci-app-jd-dailybonus/luasrc/controller/jd-dailybonus.lua b/package/ctcgfw/luci-app-jd-dailybonus/luasrc/controller/jd-dailybonus.lua index 250a7f4a48..38914fe751 100644 --- a/package/ctcgfw/luci-app-jd-dailybonus/luasrc/controller/jd-dailybonus.lua +++ b/package/ctcgfw/luci-app-jd-dailybonus/luasrc/controller/jd-dailybonus.lua @@ -5,7 +5,7 @@ function index() if not nixio.fs.access("/etc/config/jd-dailybonus") then return end - + entry({"admin", "services", "jd-dailybonus"}, alias("admin", "services", "jd-dailybonus", "client"), _("JD-DailyBonus"), 10).dependent = true -- 首页 entry({"admin", "services", "jd-dailybonus", "client"}, cbi("jd-dailybonus/client"),_("Client"), 10).leaf = true -- 基本设置 entry({"admin", "services", "jd-dailybonus", "log"},form("jd-dailybonus/log"),_("Log"), 30).leaf = true -- 日志页面 @@ -32,7 +32,7 @@ function run() local failed = luci.http.formvalue("failed") local name = "" uci:foreach("vssr", "global", function(s) name = s[".name"] end) - + if cookie ~= " " then uci:set("jd-dailybonus", '@global[0]', 'auto_update', auto_update) uci:set("jd-dailybonus", '@global[0]', 'auto_update_time', auto_update_time) @@ -43,8 +43,8 @@ function run() uci:set("jd-dailybonus", '@global[0]', 'cookie2', cookie2) uci:set("jd-dailybonus", '@global[0]', 'serverchan', serverchan) uci:set("jd-dailybonus", '@global[0]', 'failed', failed) - uci:save("jd-dailybonus") - uci:commit("jd-dailybonus") + uci:save("jd-dailybonus") + uci:commit("jd-dailybonus") luci.sys.call("/usr/share/jd-dailybonus/newapp.sh -r") luci.sys.call("/usr/share/jd-dailybonus/newapp.sh -a") e.error = 0 diff --git a/package/ctcgfw/luci-app-jd-dailybonus/root/etc/config/jd-dailybonus b/package/ctcgfw/luci-app-jd-dailybonus/root/etc/config/jd-dailybonus index 99178b2af9..14a038cb7c 100644 --- a/package/ctcgfw/luci-app-jd-dailybonus/root/etc/config/jd-dailybonus +++ b/package/ctcgfw/luci-app-jd-dailybonus/root/etc/config/jd-dailybonus @@ -1,9 +1,9 @@ config global - option version '1.79' + option version '1.87' option auto_run_time '1' option auto_run '1' option auto_update_time '1' option auto_update '1' option stop '0' option failed '0' - option remote_url 'https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js' \ No newline at end of file + option remote_url 'https://cdn.jsdelivr.net/gh/NobyDa/Script/JD-DailyBonus/JD_DailyBonus.js' \ No newline at end of file diff --git a/package/ctcgfw/luci-app-jd-dailybonus/root/etc/uci-defaults/luci-jd-dailybonus b/package/ctcgfw/luci-app-jd-dailybonus/root/etc/uci-defaults/luci-jd-dailybonus old mode 100644 new mode 100755 diff --git a/package/ctcgfw/luci-app-jd-dailybonus/root/usr/share/jd-dailybonus/JD_DailyBonus.js b/package/ctcgfw/luci-app-jd-dailybonus/root/usr/share/jd-dailybonus/JD_DailyBonus.js index ea33dbaf29..53c3585f1f 100644 --- a/package/ctcgfw/luci-app-jd-dailybonus/root/usr/share/jd-dailybonus/JD_DailyBonus.js +++ b/package/ctcgfw/luci-app-jd-dailybonus/root/usr/share/jd-dailybonus/JD_DailyBonus.js @@ -2,8 +2,8 @@ 京东多合一签到脚本 -更新时间: 2020.10.24 21:00 v1.79 -有效接口: 42+ +更新时间: 2020.12.03 17:00 v1.87 +有效接口: 40+ 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js 电报频道: @NobyDa 问题反馈: @NobyDa_bot @@ -103,112 +103,132 @@ var out = 0; //接口超时退出, 用于可能发生的网络不稳定, 0则关 var $nobyda = nobyda(); async function all() { - if (stop == 0) { - await Promise.all([ - JingDongBean(stop), //京东京豆 - JDTakeaLook(stop), //京东发现-看一看 - JingDongStore(stop), //京东超市 - JingDongWebcasts(stop), //京东直播 - JingRongBean(stop), //金融简单赚钱 - JingRongSteel(stop), //金融钢镚 - JingDongTurn(stop), //京东转盘 - JDFlashSale(stop), //京东闪购 - JDOverseas(stop), //京东国际 - JingDongCash(stop), //京东现金红包 - JDMagicCube(stop, 2), //京东小魔方 - JingDongPrize(stop), //京东抽大奖 - JingDongSubsidy(stop), //京东金贴 - JingDongGetCash(stop), //京东领现金 - JingDongShake(stop), //京东摇一摇 - JDSecKilling(stop), //京东秒杀 - DoubleElevenSale(stop), //京东超值特卖入场红包 - JingRongDoll(stop, 'JRDoll', '京东金融-签壹', '890418F764'), - JingRongDoll(stop, 'JRTwoDoll', '京东金融-签贰', '3A3E839252'), - JingRongDoll(stop, 'JRThreeDoll', '京东金融-签叁', '69F5EC743C') - ]); - await Promise.all([ - JDUserSignPre(stop, 'JDToyMusic', '京东商城-乐器', '4N6RzwtBZdtdcgodvdsK7ZEzkUbZ'), //京东玩具乐器馆 - JDUserSignPre(stop, 'JDShoes', '京东商城-鞋靴', '4RXyb1W4Y986LJW8ToqMK14BdTD'), //京东鞋靴 - JDUserSignPre(stop, 'JDEsports', '京东商城-电竞', 'CHdHQhA5AYDXXQN9FLt3QUAPRsB'), //京东电竞 - JDUserSignPre(stop, 'JDCalendar', '京东日历-翻牌', '36V2Qw59VPNsuLxY84vCFtxFzrFs'), //京东日历翻牌 - JDUserSignPre(stop, 'JDChild', '京东商城-童装', '3Af6mZNcf5m795T8dtDVfDwWVNhJ'), //京东童装馆 - JDUserSignPre(stop, 'JDBaby', '京东商城-母婴', '3BbAVGQPDd6vTyHYjmAutXrKAos6'), //京东母婴馆 - JDUserSignPre(stop, 'JD3C', '京东商城-数码', '4SWjnZSCTHPYjE5T7j35rxxuMTb6'), //京东数码电器馆 - JDUserSignPre(stop, 'JDSubsidy', '京东晚市-补贴', 'xK148m4kWj5hBcTPuJUNNXH3AkJ'), //京东晚市补贴金 - JDUserSignPre(stop, 'JDDrug', '京东商城-医药', '3tqTG5sF1xCUyC6vgEF5CLCxGn7w'), //京东医药馆 - JDUserSignPre(stop, 'JDWomen', '京东商城-女装', 'DpSh7ma8JV7QAxSE2gJNro8Q2h9'), //京东女装馆 - JDUserSignPre(stop, 'JDFineWine', '京东商城-酒饮', 'zGwAUzL3pVGjptBBGeYfpKjYdtX'), //京东酒饮馆 - JDUserSignPre(stop, 'JDBook', '京东商城-图书', '3SC6rw5iBg66qrXPGmZMqFDwcyXi') //京东图书 - ]); - await Promise.all([ - JDUserSignPre(stop, 'JDSchool', '京东商城-校园', '4812pn2PAcUyfNdWr7Cvpww5MCyW'), //京东校园 - JDUserSignPre(stop, 'JDHealth', '京东商城-健康', 'w2oeK5yLdHqHvwef7SMMy4PL8LF'), //京东健康 - JDUserSignPre(stop, 'JDPet', '京东商城-宠物', '37ta5sh5ocrMZF3Fz5UMJbTsL42'), //京东宠物馆 - JDUserSignPre(stop, 'JDShand', '京东拍拍-二手', '3S28janPLYmtFxypu37AYAGgivfp'), //京东拍拍二手 - JDUserSignPre(stop, 'JDClean', '京东商城-清洁', '2Tjm6ay1ZbZ3v7UbriTj6kHy9dn6'), //京东清洁馆 - JDUserSignPre(stop, 'JDCare', '京东商城-个护', 'NJ1kd1PJWhwvhtim73VPsD1HwY3'), //京东个人护理馆 - JDUserSignPre(stop, 'JDJewels', '京东商城-珠宝', 'zHUHpTHNTaztSRfNBFNVZscyFZU'), //京东珠宝馆 - JDUserSignPre(stop, 'JDClocks', '京东商城-钟表', '2BcJPCVVzMEtMUynXkPscCSsx68W'), //京东钟表馆 - JDUserSignPre(stop, 'JDMakeup', '京东商城-美妆', '2smCxzLNuam5L14zNJHYu43ovbAP'), //京东美妆馆 - JDUserSignPre(stop, 'JDVege', '京东商城-菜场', 'Wcu2LVCFMkBP3HraRvb7pgSpt64'), //京东菜场 - JDUserSignPre(stop, 'JDFood', '京东商城-美食', '4PzvVmLSBq5K63oq4oxKcDtFtzJo') //京东美食馆 - ]); - } else { - await JingDongBean(stop); //京东京豆 - await JDTakeaLook(stop); //京东发现-看一看 - await JingDongStore(stop); //京东超市 - await JingDongWebcasts(stop); //京东直播 - await JingRongBean(stop); //金融简单赚钱 - await JingRongSteel(stop); //金融钢镚 - await JingDongTurn(stop); //京东转盘 - await JDFlashSale(stop); //京东闪购 - await JDOverseas(stop); //京东国际 - await JingDongCash(stop); //京东现金红包 - await JDMagicCube(stop, 2); //京东小魔方 - await JingDongGetCash(stop); //京东领现金 - await JingDongPrize(stop); //京东抽大奖 - await JingDongSubsidy(stop); //京东金贴 - await JingDongShake(stop); //京东摇一摇 - await JDSecKilling(stop); //京东秒杀 - await DoubleElevenSale(stop); //京东超值特卖入场红包 - await JingRongDoll(stop, 'JRDoll', '京东金融-签壹', '890418F764'); - await JingRongDoll(stop, 'JRTwoDoll', '京东金融-签贰', '3A3E839252'); - await JingRongDoll(stop, 'JRThreeDoll', '京东金融-签叁', '69F5EC743C'); - await JDUserSignPre(stop, 'JDToyMusic', '京东商城-乐器', '4N6RzwtBZdtdcgodvdsK7ZEzkUbZ'); //京东玩具乐器馆 - await JDUserSignPre(stop, 'JDSchool', '京东商城-校园', '4812pn2PAcUyfNdWr7Cvpww5MCyW'); //京东校园 - await JDUserSignPre(stop, 'JDHealth', '京东商城-健康', 'w2oeK5yLdHqHvwef7SMMy4PL8LF'); //京东健康 - await JDUserSignPre(stop, 'JDShoes', '京东商城-鞋靴', '4RXyb1W4Y986LJW8ToqMK14BdTD'); //京东鞋靴 - await JDUserSignPre(stop, 'JDEsports', '京东商城-电竞', 'CHdHQhA5AYDXXQN9FLt3QUAPRsB'); //京东电竞 - await JDUserSignPre(stop, 'JDCalendar', '京东日历-翻牌', '36V2Qw59VPNsuLxY84vCFtxFzrFs'); //京东日历翻牌 - await JDUserSignPre(stop, 'JDChild', '京东商城-童装', '3Af6mZNcf5m795T8dtDVfDwWVNhJ'); //京东童装馆 - await JDUserSignPre(stop, 'JDBaby', '京东商城-母婴', '3BbAVGQPDd6vTyHYjmAutXrKAos6'); //京东母婴馆 - await JDUserSignPre(stop, 'JD3C', '京东商城-数码', '4SWjnZSCTHPYjE5T7j35rxxuMTb6'); //京东数码电器馆 - await JDUserSignPre(stop, 'JDSubsidy', '京东晚市-补贴', 'xK148m4kWj5hBcTPuJUNNXH3AkJ'); //京东晚市补贴金 - await JDUserSignPre(stop, 'JDClocks', '京东商城-钟表', '2BcJPCVVzMEtMUynXkPscCSsx68W'); //京东钟表馆 - await JDUserSignPre(stop, 'JDDrug', '京东商城-医药', '3tqTG5sF1xCUyC6vgEF5CLCxGn7w'); //京东医药馆 - await JDUserSignPre(stop, 'JDWomen', '京东商城-女装', 'DpSh7ma8JV7QAxSE2gJNro8Q2h9'); //京东女装馆 - await JDUserSignPre(stop, 'JDPet', '京东商城-宠物', '37ta5sh5ocrMZF3Fz5UMJbTsL42'); //京东宠物馆 - await JDUserSignPre(stop, 'JDBook', '京东商城-图书', '3SC6rw5iBg66qrXPGmZMqFDwcyXi'); //京东图书 - await JDUserSignPre(stop, 'JDShand', '京东拍拍-二手', '3S28janPLYmtFxypu37AYAGgivfp'); //京东拍拍二手 - await JDUserSignPre(stop, 'JDMakeup', '京东商城-美妆', '2smCxzLNuam5L14zNJHYu43ovbAP'); //京东美妆馆 - await JDUserSignPre(stop, 'JDFineWine', '京东商城-酒饮', 'zGwAUzL3pVGjptBBGeYfpKjYdtX'); //京东酒饮馆 - await JDUserSignPre(stop, 'JDVege', '京东商城-菜场', 'Wcu2LVCFMkBP3HraRvb7pgSpt64'); //京东菜场 - await JDUserSignPre(stop, 'JDFood', '京东商城-美食', '4PzvVmLSBq5K63oq4oxKcDtFtzJo'); //京东美食馆 - await JDUserSignPre(stop, 'JDClean', '京东商城-清洁', '2Tjm6ay1ZbZ3v7UbriTj6kHy9dn6'); //京东清洁馆 - await JDUserSignPre(stop, 'JDCare', '京东商城-个护', 'NJ1kd1PJWhwvhtim73VPsD1HwY3'); //京东个人护理馆 - await JDUserSignPre(stop, 'JDJewels', '京东商城-珠宝', 'zHUHpTHNTaztSRfNBFNVZscyFZU'); //京东珠宝馆 + merge = {}; + switch (stop) { + case 0: + await Promise.all([ + JingDongBean(stop), //京东京豆 + JDTakeaLook(stop), //京东发现-看一看 + JingDongStore(stop), //京东超市 + JingDongWebcasts(stop), //京东直播 + JingRongBean(stop), //金融简单赚钱 + JingRongSteel(stop), //金融钢镚 + JingDongTurn(stop), //京东转盘 + JDFlashSale(stop), //京东闪购 + JDOverseas(stop), //京东国际 + JingDongCash(stop), //京东现金红包 + JDMagicCube(stop, 2), //京东小魔方 + JingDongSubsidy(stop), //京东金贴 + JingDongGetCash(stop), //京东领现金 + JingDongShake(stop), //京东摇一摇 + JDSecKilling(stop), //京东秒杀 + JRLuckyLottery(stop), //金融抽奖顶部签到 + JingDongBuyCar(stop), //京东汽车 + JingRongDoll(stop, 'JRTwoDoll', '京东金融-签贰', '3A3E839252'), + JingRongDoll(stop, 'JRThreeDoll', '京东金融-签叁', '69F5EC743C'), + JingRongDoll(stop, 'JRFourDoll', '京东金融-签肆', '30C4F86264'), + JingRongDoll(stop, 'JRFiveDoll', '京东金融-签伍', '1D06AA3B0F') + ]); + await Promise.all([ + // JDUserSignPre(stop, 'JDComputer', '京东电脑-数码', '31HbNBjr6YLyZfJtR5biFFc9ZYXN'), //京东电脑数码馆 + JDUserSignPre(stop, 'JDUnderwear', '京东商城-内衣', '4PgpL1xqPSW1sVXCJ3xopDbB1f69'), //京东内衣馆 + // JDUserSignPre(stop, 'JDToyMusic', '京东商城-乐器', '4N6RzwtBZdtdcgodvdsK7ZEzkUbZ'), //京东玩具乐器馆 + JDUserSignPre(stop, 'JDShoes', '京东商城-鞋靴', '4RXyb1W4Y986LJW8ToqMK14BdTD'), //京东鞋靴 + // JDUserSignPre(stop, 'JDEsports', '京东商城-电竞', 'CHdHQhA5AYDXXQN9FLt3QUAPRsB'), //京东电竞 + JDUserSignPre(stop, 'JDCalendar', '京东日历-翻牌', '36V2Qw59VPNsuLxY84vCFtxFzrFs'), //京东日历翻牌 + JDUserSignPre(stop, 'JDChild', '京东商城-童装', '3Af6mZNcf5m795T8dtDVfDwWVNhJ'), //京东童装馆 + JDUserSignPre(stop, 'JDBaby', '京东商城-母婴', '3BbAVGQPDd6vTyHYjmAutXrKAos6'), //京东母婴馆 + JDUserSignPre(stop, 'JD3C', '京东商城-数码', '4SWjnZSCTHPYjE5T7j35rxxuMTb6'), //京东数码电器馆 + JDUserSignPre(stop, 'JDSubsidy', '京东晚市-补贴', 'xK148m4kWj5hBcTPuJUNNXH3AkJ'), //京东晚市补贴金 + JDUserSignPre(stop, 'JDDrug', '京东商城-医药', '3tqTG5sF1xCUyC6vgEF5CLCxGn7w'), //京东医药馆 + JDUserSignPre(stop, 'JDWomen', '京东商城-女装', 'DpSh7ma8JV7QAxSE2gJNro8Q2h9'), //京东女装馆 + JDUserSignPre(stop, 'JDFineWine', '京东商城-酒饮', 'zGwAUzL3pVGjptBBGeYfpKjYdtX'), //京东酒饮馆 + JDUserSignPre(stop, 'JDBook', '京东商城-图书', '3SC6rw5iBg66qrXPGmZMqFDwcyXi') //京东图书 + ]); + await Promise.all([ + JDUserSignPre(stop, 'JDSuitcase', '京东商城-箱包', 'ZrH7gGAcEkY2gH8wXqyAPoQgk6t'), //京东箱包馆 + // JDUserSignPre(stop, 'JDConstell', '京东商城-京鱼', '3BPdJHCESW5cfak79ZRz37wTKbuV'), //京东京鱼座 + JDUserSignPre(stop, 'JDSchool', '京东商城-校园', '4812pn2PAcUyfNdWr7Cvpww5MCyW'), //京东校园 + JDUserSignPre(stop, 'JDHealth', '京东商城-健康', 'w2oeK5yLdHqHvwef7SMMy4PL8LF'), //京东健康 + JDUserSignPre(stop, 'JDPet', '京东商城-宠物', '37ta5sh5ocrMZF3Fz5UMJbTsL42'), //京东宠物馆 + JDUserSignPre(stop, 'JDShand', '京东拍拍-二手', '3S28janPLYmtFxypu37AYAGgivfp'), //京东拍拍二手 + JDUserSignPre(stop, 'JDClean', '京东商城-清洁', '2Tjm6ay1ZbZ3v7UbriTj6kHy9dn6'), //京东清洁馆 + JDUserSignPre(stop, 'JDCare', '京东商城-个护', 'NJ1kd1PJWhwvhtim73VPsD1HwY3'), //京东个人护理馆 + JDUserSignPre(stop, 'JDJewels', '京东商城-珠宝', 'zHUHpTHNTaztSRfNBFNVZscyFZU'), //京东珠宝馆 + JDUserSignPre(stop, 'JDClocks', '京东商城-钟表', '2BcJPCVVzMEtMUynXkPscCSsx68W'), //京东钟表馆 + JDUserSignPre(stop, 'JDMakeup', '京东商城-美妆', '2smCxzLNuam5L14zNJHYu43ovbAP'), //京东美妆馆 + JDUserSignPre(stop, 'JDVege', '京东商城-菜场', 'Wcu2LVCFMkBP3HraRvb7pgSpt64'), //京东菜场 + // JDUserSignPre(stop, 'JDFood', '京东商城-美食', '4PzvVmLSBq5K63oq4oxKcDtFtzJo') //京东美食馆 + ]); + await Promise.all([ + JingRongDoll(stop, 'JRSixDoll', '金融现金-双签', 'F68B2C3E71'), //京东金融 现金双签 + JDJTDoubleSign(stop), //京东金融 金贴双签 + JRDoubleSign(stop), //京东金融 京豆双签 + JingDongSpeedUp(stop) //京东天天加速 + ]) + break; + default: + await JingDongBean(stop); //京东京豆 + await JDTakeaLook(stop); //京东发现-看一看 + await JingDongStore(stop); //京东超市 + await JingDongWebcasts(stop); //京东直播 + await JingRongBean(stop); //金融简单赚钱 + await JingRongSteel(stop); //金融钢镚 + await JingDongTurn(stop); //京东转盘 + await JDFlashSale(stop); //京东闪购 + await JDOverseas(stop); //京东国际 + await JingDongCash(stop); //京东现金红包 + await JDMagicCube(stop, 2); //京东小魔方 + await JingDongGetCash(stop); //京东领现金 + await JingDongSubsidy(stop); //京东金贴 + await JingDongShake(stop); //京东摇一摇 + await JDSecKilling(stop); //京东秒杀 + await JRLuckyLottery(stop); //金融抽奖顶部签到 + await JingDongBuyCar(stop); //京东汽车 + await JingRongDoll(stop, 'JRTwoDoll', '京东金融-签贰', '3A3E839252'); + await JingRongDoll(stop, 'JRThreeDoll', '京东金融-签叁', '69F5EC743C'); + await JingRongDoll(stop, 'JRFourDoll', '京东金融-签肆', '30C4F86264'); + await JingRongDoll(stop, 'JRFiveDoll', '京东金融-签伍', '1D06AA3B0F'); + await JDUserSignPre(stop, 'JDUnderwear', '京东商城-内衣', '4PgpL1xqPSW1sVXCJ3xopDbB1f69'); //京东内衣馆 + await JDUserSignPre(stop, 'JDSuitcase', '京东商城-箱包', 'ZrH7gGAcEkY2gH8wXqyAPoQgk6t'); //京东箱包馆 + // await JDUserSignPre(stop, 'JDComputer', '京东电脑-数码', '31HbNBjr6YLyZfJtR5biFFc9ZYXN'); //京东电脑数码馆 + // await JDUserSignPre(stop, 'JDConstell', '京东商城-京鱼', '3BPdJHCESW5cfak79ZRz37wTKbuV'); //京东京鱼座 + // await JDUserSignPre(stop, 'JDToyMusic', '京东商城-乐器', '4N6RzwtBZdtdcgodvdsK7ZEzkUbZ'); //京东玩具乐器馆 + await JDUserSignPre(stop, 'JDSchool', '京东商城-校园', '4812pn2PAcUyfNdWr7Cvpww5MCyW'); //京东校园 + await JDUserSignPre(stop, 'JDHealth', '京东商城-健康', 'w2oeK5yLdHqHvwef7SMMy4PL8LF'); //京东健康 + await JDUserSignPre(stop, 'JDShoes', '京东商城-鞋靴', '4RXyb1W4Y986LJW8ToqMK14BdTD'); //京东鞋靴 + // await JDUserSignPre(stop, 'JDEsports', '京东商城-电竞', 'CHdHQhA5AYDXXQN9FLt3QUAPRsB'); //京东电竞 + await JDUserSignPre(stop, 'JDCalendar', '京东日历-翻牌', '36V2Qw59VPNsuLxY84vCFtxFzrFs'); //京东日历翻牌 + await JDUserSignPre(stop, 'JDChild', '京东商城-童装', '3Af6mZNcf5m795T8dtDVfDwWVNhJ'); //京东童装馆 + await JDUserSignPre(stop, 'JDBaby', '京东商城-母婴', '3BbAVGQPDd6vTyHYjmAutXrKAos6'); //京东母婴馆 + await JDUserSignPre(stop, 'JD3C', '京东商城-数码', '4SWjnZSCTHPYjE5T7j35rxxuMTb6'); //京东数码电器馆 + await JDUserSignPre(stop, 'JDSubsidy', '京东晚市-补贴', 'xK148m4kWj5hBcTPuJUNNXH3AkJ'); //京东晚市补贴金 + await JDUserSignPre(stop, 'JDClocks', '京东商城-钟表', '2BcJPCVVzMEtMUynXkPscCSsx68W'); //京东钟表馆 + await JDUserSignPre(stop, 'JDDrug', '京东商城-医药', '3tqTG5sF1xCUyC6vgEF5CLCxGn7w'); //京东医药馆 + await JDUserSignPre(stop, 'JDWomen', '京东商城-女装', 'DpSh7ma8JV7QAxSE2gJNro8Q2h9'); //京东女装馆 + await JDUserSignPre(stop, 'JDPet', '京东商城-宠物', '37ta5sh5ocrMZF3Fz5UMJbTsL42'); //京东宠物馆 + await JDUserSignPre(stop, 'JDBook', '京东商城-图书', '3SC6rw5iBg66qrXPGmZMqFDwcyXi'); //京东图书 + await JDUserSignPre(stop, 'JDShand', '京东拍拍-二手', '3S28janPLYmtFxypu37AYAGgivfp'); //京东拍拍二手 + await JDUserSignPre(stop, 'JDMakeup', '京东商城-美妆', '2smCxzLNuam5L14zNJHYu43ovbAP'); //京东美妆馆 + await JDUserSignPre(stop, 'JDFineWine', '京东商城-酒饮', 'zGwAUzL3pVGjptBBGeYfpKjYdtX'); //京东酒饮馆 + await JDUserSignPre(stop, 'JDVege', '京东商城-菜场', 'Wcu2LVCFMkBP3HraRvb7pgSpt64'); //京东菜场 + // await JDUserSignPre(stop, 'JDFood', '京东商城-美食', '4PzvVmLSBq5K63oq4oxKcDtFtzJo'); //京东美食馆 + await JDUserSignPre(stop, 'JDClean', '京东商城-清洁', '2Tjm6ay1ZbZ3v7UbriTj6kHy9dn6'); //京东清洁馆 + await JDUserSignPre(stop, 'JDCare', '京东商城-个护', 'NJ1kd1PJWhwvhtim73VPsD1HwY3'); //京东个人护理馆 + await JDUserSignPre(stop, 'JDJewels', '京东商城-珠宝', 'zHUHpTHNTaztSRfNBFNVZscyFZU'); //京东珠宝馆 + await JingRongDoll(stop, 'JRSixDoll', '金融现金-双签', 'F68B2C3E71'); //京东金融 现金双签 + await JDJTDoubleSign(stop); //京东金融 金贴双签 + await JRDoubleSign(stop); //京东金融 京豆双签 + await JingDongSpeedUp(stop); //京东天天加速 + break; } - await Promise.all([ - JingDongSpeedUp(stop), //京东天天加速 - JRDoubleSign(stop) //金融双签 - ]) await Promise.all([ TotalSteel(), //总钢镚查询 TotalCash(), //总红包查询 TotalBean(), //总京豆查询 TotalSubsidy(), //总金贴查询 TotalMoney() //总现金查询 - ]) + ]); await notify(); //通知模块 } @@ -218,6 +238,8 @@ function notify() { var bean = 0; var steel = 0; var cash = 0; + var money = 0; + var subsidy = 0; var success = 0; var fail = 0; var err = 0; @@ -226,43 +248,45 @@ function notify() { bean += merge[i].bean ? Number(merge[i].bean) : 0 steel += merge[i].steel ? Number(merge[i].steel) : 0 cash += merge[i].Cash ? Number(merge[i].Cash) : 0 + money += merge[i].Money ? Number(merge[i].Money) : 0 + subsidy += merge[i].subsidy ? Number(merge[i].subsidy) : 0 success += merge[i].success ? Number(merge[i].success) : 0 fail += merge[i].fail ? Number(merge[i].fail) : 0 err += merge[i].error ? Number(merge[i].error) : 0 notify += merge[i].notify ? "\n" + merge[i].notify : "" } - var Cash = merge.TotalCash.TCash ? merge.TotalCash.TCash + "红包" : "" - var Steel = merge.TotalSteel.TSteel ? merge.TotalSteel.TSteel + "钢镚" + (Cash ? ", " : "") : "" - var beans = merge.TotalBean.Qbear ? merge.TotalBean.Qbear + "京豆" + (Steel || Cash ? ", " : "") : "" - var bsc = beans ? "\n" : Steel ? "\n" : Cash ? "\n" : "获取失败\n" - var Money = merge.TotalMoney.TMoney ? `${merge.TotalMoney.TMoney}现金` : "" - var Subsidy = merge.TotalSubsidy.TSubsidy ? `${merge.TotalSubsidy.TSubsidy}金贴${Money?", ":""}` : "" - var Sbsc = Subsidy ? "\n" : Money ? "\n" : "获取失败\n" - var Tbean = bean ? `${bean.toFixed(0)}京豆${steel||cash?", ":""}` : "" - var TSteel = steel ? `${steel.toFixed(2)}钢镚${cash?", ":""}` : "" - var TCash = cash ? `${cash.toFixed(2)}红包` : "" - var Tbsc = Tbean ? "\n" : TSteel ? "\n" : TCash ? "\n" : "获取失败\n" - var Ts = success ? "成功" + success + "个" + (fail || err ? ", " : "") : "" - var Tf = fail ? "失败" + fail + "个" + (err ? ", " : "") : "" - var Te = err ? "错误" + err + "个\n" : success ? "\n" : fail ? "\n" : "获取失败\n" - var one = "【签到概览】: " + Ts + Tf + Te - var two = "【签到总计】: " + Tbean + TSteel + TCash + Tbsc - var three = "【账号总计】: " + beans + Steel + Cash + bsc - var four = "【其他总计】: " + Subsidy + Money + Sbsc + var Cash = merge.TotalCash && merge.TotalCash.TCash ? `${merge.TotalCash.TCash}红包` : "" + var Steel = merge.TotalSteel && merge.TotalSteel.TSteel ? `${merge.TotalSteel.TSteel}钢镚${Cash?`, `:``}` : `` + var beans = merge.TotalBean && merge.TotalBean.Qbear ? `${merge.TotalBean.Qbear}京豆${Steel||Cash?`, `:``}` : "" + var Money = merge.TotalMoney && merge.TotalMoney.TMoney ? `${merge.TotalMoney.TMoney}现金` : "" + var Subsidy = merge.TotalSubsidy && merge.TotalSubsidy.TSubsidy ? `${merge.TotalSubsidy.TSubsidy}金贴${Money?", ":""}` : "" + var Tbean = bean ? `${bean.toFixed(0)}京豆${steel?", ":""}` : "" + var TSteel = steel ? `${steel.toFixed(2)}钢镚` : "" + var TCash = cash ? `${cash.toFixed(2)}红包${subsidy||money?", ":""}` : "" + var TSubsidy = subsidy ? `${subsidy.toFixed(2)}金贴${money?", ":""}` : "" + var TMoney = money ? `${money.toFixed(2)}现金` : "" + var Ts = success ? `成功${success}个${fail||err?`, `:``}` : `` + var Tf = fail ? `失败${fail}个${err?`, `:``}` : `` + var Te = err ? `错误${err}个` : `` + var one = `【签到概览】: ${Ts+Tf+Te}${Ts||Tf||Te?`\n`:`获取失败\n`}` + var two = Tbean || TSteel ? `【签到奖励】: ${Tbean+TSteel}\n` : `` + var three = TCash || TSubsidy || TMoney ? `【其他奖励】: ${TCash+TSubsidy+TMoney}\n` : `` + var four = `【账号总计】: ${beans+Steel+Cash}${beans||Steel||Cash?`\n`:`获取失败\n`}` + var five = `【其他总计】: ${Subsidy+Money}${Subsidy||Money?`\n`:`获取失败\n`}` var disa = $nobyda.disable ? "\n检测到上次执行意外崩溃, 已为您自动禁用相关接口. 如需开启请前往BoxJs ‼️‼️\n" : "" - var DName = merge.TotalBean.nickname ? merge.TotalBean.nickname : "获取失败" - var Name = add ? DualAccount ? "【签到号一】: " + DName + "\n" : "【签到号二】: " + DName + "\n" : "" - console.log("\n" + Name + one + two + three + four + disa + notify) + var DName = merge.TotalBean && merge.TotalBean.nickname ? merge.TotalBean.nickname : "获取失败" + var Name = add ? DualAccount ? `【签到号一】: ${DName}\n` : `【签到号二】: ${DName}\n` : "" + console.log("\n" + Name + one + two + three + four + five + disa + notify) if ($nobyda.isJSBox) { if (add && DualAccount) { Shortcut = Name + one + two + three + "\n" } else if (!add && DualAccount) { - $intents.finish(Name + one + two + three + four + notify) + $intents.finish(Name + one + two + three + four + five + notify) } else if (typeof Shortcut != "undefined") { $intents.finish(Shortcut + Name + one + two + three) } } - if (!$nobyda.isNode) $nobyda.notify("", "", Name + one + two + three + four + disa + notify); + if (!$nobyda.isNode) $nobyda.notify("", "", Name + one + two + three + four + five + disa + notify); if (DualAccount) { double(); } else { @@ -278,7 +302,6 @@ function notify() { } function ReadCookie() { - initial() DualAccount = true; const EnvInfo = $nobyda.isJSBox ? "JD_Cookie" : "CookieJD" const EnvInfo2 = $nobyda.isJSBox ? "JD_Cookie2" : "CookieJD2" @@ -317,7 +340,6 @@ function ReadCookie() { } function double() { - initial() add = true DualAccount = false if (DualKey || $nobyda.read($nobyda.isJSBox ? "JD_Cookie2" : "CookieJD2")) { @@ -330,6 +352,7 @@ function double() { } function JingDongBean(s) { + merge.JDBean = {}; return new Promise(resolve => { if (disable("JDBean")) return resolve() setTimeout(() => { @@ -394,6 +417,7 @@ function JingDongBean(s) { } function JingDongTurn(s) { + merge.JDTurn = {}, merge.JDTurn.notify = "", merge.JDTurn.success = 0, merge.JDTurn.bean = 0; return new Promise((resolve, reject) => { if (disable("JDTurn")) return reject() const JDTUrl = { @@ -492,6 +516,7 @@ function JingDongTurnSign(s, code) { } function JingRongBean(s) { + merge.JRBean = {}; return new Promise(resolve => { if (disable("JRBean")) return resolve() setTimeout(() => { @@ -554,6 +579,7 @@ function JRBeanCheckin(s, amount) { const Details = LogDetails ? "response:\n" + data : ''; if (data.match(/\"rewardCode\":\"00000\"/)) { console.log("\n" + "京东金融-金贴签到成功 " + Details) + merge.JRBean.subsidy = amount || 0 merge.JRBean.notify = `京东金融-金贴: 成功, 明细: ${amount || `无`}金贴 💰` merge.JRBean.success = 1 } else { @@ -579,15 +605,16 @@ function JRBeanCheckin(s, amount) { } function JingRongSteel(s) { + merge.JRSteel = {}; return new Promise(resolve => { if (disable("JRSteel")) return resolve() setTimeout(() => { const JRSUrl = { - url: 'https://ms.jr.jd.com/gw/generic/gry/h5/m/signIn', + url: 'https://ms.jr.jd.com/gw/generic/hy/h5/m/signIn1', headers: { Cookie: KEY }, - body: "reqData=%7B%22channelSource%22%3A%22JRAPP%22%2C%22riskDeviceParam%22%3A%22%7B%7D%22%7D" + body: "reqData=%7B%22channelSource%22%3A%22JRAPP6.0%22%2C%22riskDeviceParam%22%3A%22%7B%7D%22%7D" }; $nobyda.post(JRSUrl, function(error, response, data) { try { @@ -597,7 +624,8 @@ function JingRongSteel(s) { if (data.match(/\"resBusiCode\":0/)) { console.log("\n" + "京东金融-钢镚签到成功 " + Details) const leng = cc.resultData.resBusiData.actualTotalRewardsValue - merge.JRSteel.steel = leng ? leng > 9 ? `0.${leng}` : `0.0${leng}` : 0 + const spare = cc.resultData.resBusiData.baseReward + merge.JRSteel.steel = leng ? leng > 9 ? `0.${leng}` : `0.0${leng}` : spare ? spare : 0 merge.JRSteel.notify = `京东金融-钢镚: 成功, 明细: ${merge.JRSteel.steel || `无`}钢镚 💰` merge.JRSteel.success = 1 } else { @@ -625,6 +653,7 @@ function JingRongSteel(s) { } function JRDoubleSign(s) { + merge.JRDSign = {}; return new Promise(resolve => { if (disable("JRDSign")) return resolve() setTimeout(() => { @@ -648,15 +677,17 @@ function JRDoubleSign(s) { merge.JRDSign.notify = "京东金融-双签: 成功, 明细: " + merge.JRDSign.bean + "京豆 🐶" merge.JRDSign.success = 1 } else { - console.log("\n" + "京东金融-双签签到失败 " + Details) - merge.JRDSign.fail = 1 if (data.match(/已领取/)) { merge.JRDSign.notify = "京东金融-双签: 失败, 原因: 已签过 ⚠️" } else if (data.match(/未在/)) { merge.JRDSign.notify = "京东金融-双签: 失败, 未在京东签到 ⚠️" + } else if (data.match(/303sq|400sq|重复提交/)) { + return } else { merge.JRDSign.notify = "京东金融-双签: 失败, 原因: 无奖励 ⚠️" } + console.log("\n" + "京东金融-双签签到失败 " + Details) + merge.JRDSign.fail = 1 } } else { console.log("\n" + "京东金融-双签签到失败 " + Details) @@ -680,6 +711,7 @@ function JRDoubleSign(s) { } function JingDongShake(s) { + if (!merge.JDShake) merge.JDShake = {}, merge.JDShake.success = 0, merge.JDShake.bean = 0, merge.JDShake.notify = ''; return new Promise(resolve => { if (disable("JDShake")) return resolve() setTimeout(() => { @@ -743,6 +775,7 @@ function JingDongShake(s) { } function JDUserSignPre(s, key, title, ac) { + merge[key] = {}; if ($nobyda.isJSBox) { return JDUserSignPre2(s, key, title, ac); } else { @@ -922,7 +955,8 @@ function JDUserSign1(s, key, title, body) { } else if (data.match(/\"code\":\"?3\"?/)) { merge[key].notify = `${title}: 失败, 原因: Cookie失效‼️` } else { - merge[key].notify = `${title}: 失败, 原因: 未知 ⚠️` + const ng = data.match(/\"(errorMessage|subCodeMsg)\":\"(.+?)\"/) + merge[key].notify = `${title}: 失败, ${ng?ng[2]:`原因: 未知`} ⚠️` } merge[key].fail = 1 } @@ -981,7 +1015,8 @@ async function JDUserSign2(s, key, title, tid) { } else if (data.match(/(没有登录|B0001)/)) { merge[key].notify = `${title}: 失败, 原因: Cookie失效‼️` } else { - merge[key].notify = `${title}: 失败, 原因: 未知 ⚠️` + const ng = data.match(/\"(errorMessage|subCodeMsg)\":\"(.+?)\"/) + merge[key].notify = `${title}: 失败, ${ng?ng[2]:`原因: 未知`} ⚠️` } merge[key].fail = 1 } @@ -998,6 +1033,7 @@ async function JDUserSign2(s, key, title, tid) { } function JDFlashSale(s) { + merge.JDFSale = {}; return new Promise(resolve => { if (disable("JDFSale")) return resolve() setTimeout(() => { @@ -1015,7 +1051,7 @@ function JDFlashSale(s) { } else { const Details = LogDetails ? "response:\n" + data : ''; const cc = JSON.parse(data) - if (cc.result.code == 0) { + if (cc.result && cc.result.code == 0) { console.log("\n" + "京东商城-闪购签到成功 " + Details) merge.JDFSale.bean = cc.result.jdBeanNum || 0 merge.JDFSale.notify = "京东商城-闪购: 成功, 明细: " + (merge.JDFSale.bean || "无") + "京豆 🐶" @@ -1096,6 +1132,7 @@ function FlashSaleDivide(s) { } function JingDongCash(s) { + merge.JDCash = {}; return new Promise(resolve => { if (disable("JDCash")) return resolve() setTimeout(() => { @@ -1144,6 +1181,7 @@ function JingDongCash(s) { } function JDMagicCube(s, sign) { + merge.JDCube = {}; return new Promise((resolve, reject) => { if (disable("JDCube")) return reject() const JDUrl = { @@ -1229,114 +1267,8 @@ function JDMagicCubeSign(s, id) { }); } -function JingDongPrize(s) { - return new Promise(resolve => { - if (disable("JDPrize")) return resolve() - setTimeout(() => { - const JDkey = { - url: 'https://api.m.jd.com/client.action?functionId=vvipscdp_raffleAct_index&client=apple&clientVersion=8.1.0&appid=member_benefit_m', - headers: { - Cookie: KEY, - Referer: "https://jdmall.m.jd.com/beansForPrizes", - } - }; - $nobyda.get(JDkey, async function(error, response, data) { - try { - if (error) { - throw new Error(error) - } else { - const Details = LogDetails ? "response:\n" + data : ''; - if (data.match(/\"raffleActKey\":\"[a-zA-z0-9]{3,}\"/)) { - const cc = JSON.parse(data) - merge.JDPrize.key = cc.data.floorInfoList[0].detail.raffleActKey - console.log("\n" + "京东商城-大奖查询成功 " + Details) - if (merge.JDPrize.key) { - await JDPrizeCheckin(s) - } else { - merge.JDPrize.notify = "京东商城-大奖: 失败, 原因: 无奖池 ⚠️" - merge.JDPrize.fail = 1 - } - } else { - console.log("\n" + "京东商城-大奖查询KEY失败 " + Details) - merge.JDPrize.fail = 1 - if (data.match(/(未登录|\"101\")/)) { - merge.JDPrize.notify = "京东大奖-登录: 失败, 原因: Cookie失效‼️" - } else { - merge.JDPrize.notify = "京东大奖-登录: 失败, 原因: 未知 ⚠️" - } - } - } - } catch (eor) { - $nobyda.AnError("京东大奖-查询", "JDPrize", eor, response, data) - } finally { - resolve() - } - }) - }, s) - if (out) setTimeout(resolve, out + s) - }); -} - -function JDPrizeCheckin(s) { - return new Promise(resolve => { - setTimeout(() => { - const JDPUrl = { - url: 'https://api.m.jd.com/client.action?functionId=vvipscdp_raffleAct_lotteryDraw&body=%7B%22raffleActKey%22%3A%22' + merge.JDPrize.key + '%22%2C%22drawType%22%3A0%2C%22riskInformation%22%3A%7B%7D%7D&client=apple&clientVersion=8.1.0&appid=member_benefit_m', - headers: { - Cookie: KEY, - Referer: "https://jdmall.m.jd.com/beansForPrizes", - } - }; - $nobyda.get(JDPUrl, function(error, response, data) { - try { - if (error) { - throw new Error(error) - } else { - const Details = LogDetails ? "response:\n" + data : ''; - const c = JSON.parse(data) - if (data.match(/\"success\":true/)) { - console.log("\n" + "京东商城-大奖签到成功 " + Details) - merge.JDPrize.success = 1 - if (data.match(/\"beanNumber\":\d+/)) { - merge.JDPrize.notify = "京东商城-大奖: 成功, 明细: " + c.data.beanNumber + "京豆 🐶" - merge.JDPrize.bean = c.data.beanNumber - } else if (data.match(/\"couponInfoVo\"/)) { - if (data.match(/\"limitStr\"/)) { - merge.JDPrize.notify = "京东商城-大奖: 获得满" + c.data.couponInfoVo.quota + "减" + c.data.couponInfoVo.discount + "优惠券→ " + c.data.couponInfoVo.limitStr - } else { - merge.JDPrize.notify = "京东商城-大奖: 成功, 明细: 优惠券" - } - } else if (data.match(/\"pitType\":0/)) { - merge.JDPrize.notify = "京东商城-大奖: 成功, 明细: 未中奖 🐶" - } else { - merge.JDPrize.notify = "京东商城-大奖: 成功, 明细: 未知 🐶" - } - } else { - console.log("\n" + "京东商城-大奖签到失败 " + Details) - merge.JDPrize.fail = 1 - if (data.match(/(已用光|7000003)/)) { - merge.JDPrize.notify = "京东商城-大奖: 失败, 原因: 已签过 ⚠️" - } else if (data.match(/(未登录|\"101\")/)) { - merge.JDPrize.notify = "京东商城-大奖: 失败, 原因: Cookie失效‼️" - } else if (data.match(/7000005/)) { - merge.JDPrize.notify = "京东商城-大奖: 失败, 原因: 未中奖 ⚠️" - } else { - merge.JDPrize.notify = "京东商城-大奖: 失败, 原因: 未知 ⚠️" - } - } - } - } catch (eor) { - $nobyda.AnError("京东大奖-签到", "JDPrize", eor, response, data) - } finally { - resolve() - } - }) - }, s) - if (out) setTimeout(resolve, out + s) - }); -} - function JingDongSpeedUp(s, id) { + if (!merge.SpeedUp) merge.SpeedUp = {}, merge.SpeedUp.bean = 0; return new Promise(resolve => { if (disable("SpeedUp")) return resolve() setTimeout(() => { @@ -1417,7 +1349,7 @@ function JingDongSpeedUp(s, id) { } if (!merge.SpeedUp.notify) { merge.SpeedUp.fail = 1 - merge.SpeedUp.notify = "京东天天-加速: 失败, 原因: 未知 ⚠️" + merge.SpeedUp.notify = "京东天天-加速: 失败, 原因: 无任务 ⚠️" } console.log("\n天天加速-判断状态失败") } @@ -1697,6 +1629,7 @@ function JDUseProps(s, PropID) { } function JingDongSubsidy(s) { + merge.subsidy = {}; return new Promise(resolve => { if (disable("subsidy")) return resolve() setTimeout(() => { @@ -1716,6 +1649,7 @@ function JingDongSubsidy(s) { if (data.match(/\"msg\":\"操作成功\"/)) { console.log("\n" + "京东商城-金贴签到成功 " + Details) const qt = data.match(/\"thisAmountStr\":\"(.+?)\"/) + merge.subsidy.subsidy = qt ? qt[1] : 0; merge.subsidy.notify = `京东商城-金贴: 成功, 明细: ${qt?qt[1]:`无`}金贴 💰` merge.subsidy.success = 1 } else { @@ -1741,7 +1675,8 @@ function JingDongSubsidy(s) { }); } -function JingRongDoll(s, key, title, code, type, num) { +function JingRongDoll(s, key, title, code, type, num, award) { + merge[key] = {}; return new Promise(resolve => { if (disable(key)) return resolve() setTimeout(() => { @@ -1750,7 +1685,7 @@ function JingRongDoll(s, key, title, code, type, num) { headers: { Cookie: KEY }, - body: `reqData=%7B%22actCode%22%3A%22${code}%22%2C%22type%22%3A${type?type:`3`}%7D` + body: `reqData=${encodeURIComponent(`{"actCode":"${code}","type":${type?type:`3`}${code=='F68B2C3E71'?`,"frontParam":{"belong":"xianjin"}`:``}}`)}` }; $nobyda.post(DollUrl, async function(error, response, data) { try { @@ -1761,34 +1696,44 @@ function JingRongDoll(s, key, title, code, type, num) { const Details = LogDetails ? "response:\n" + data : ''; if (cc.resultCode == 0) { if (cc.resultData.data.businessData != null) { + console.log(`\n${title}查询成功 ${Details}`) if (cc.resultData.data.businessData.pickStatus == 2) { - console.log(`\n${title}查询成功 ${Details}`) - if (data.match(/\"rewardPrice\":\"?(\d+)/)) { - var JRDoll_bean = data.match(/\"rewardPrice\":\"?(\d+)/)[1] - await JingRongDoll(s, key, title, code, '4', JRDoll_bean) + if (data.match(/\"rewardPrice\":\"\d.*?\"/)) { + const JRDoll_bean = data.match(/\"rewardPrice\":\"(\d.*?)\"/)[1] + const JRDoll_type = data.match(/\"rewardName\":\"金贴奖励\"/) ? true : false + await JingRongDoll(s, key, title, code, '4', JRDoll_bean, JRDoll_type) } else { merge[key].success = 1 - merge[key].notify = `${title}: 成功, 明细: 无京豆 🐶` + merge[key].notify = `${title}: 成功, 明细: 无奖励 🐶` } + } else if (cc.resultData.data.businessData.businessCode === '000sq' && code === 'F68B2C3E71') { + const ct = data.match(/"count":(\d+),/) + merge[key].success = 1 + merge[key].Money = ct ? ct[1] > 9 ? `0.${ct[1]}` : `0.0${ct[1]}` : 0 + merge[key].notify = `${title}: 成功, 明细: ${merge[key].Money||`无`}现金 💰` } else { - console.log(`\n${title}签到失败 ${Details}`) merge[key].notify = `${title}: 失败, 原因: 已签过 ⚠️`; merge[key].fail = 1 } } else if (cc.resultData.data.businessCode == 200) { console.log(`\n${title}签到成功 ${Details}`) - merge[key].bean = num || 0 + if (!award) { + merge[key].bean = num ? num.match(/\d+/)[0] : 0 + } else { + merge[key].subsidy = num || 0 + } merge[key].success = 1 - merge[key].notify = `${title}: 成功, 明细: ${num||`无`}京豆 🐶` + merge[key].notify = `${title}: 成功, 明细: ${(award?num:merge[key].bean)||`无`}${award?`金贴 💰`:`京豆 🐶`}` } else { - console.log(`\n${title}领取异常 ${Details}\n请尝试手动领取, 预计可得${num||'0'}京豆: \nhttps://uf1.jr.jd.com/up/redEnvelopes/index.html?actCode=${code}\n`) + console.log(`\n${title}领取异常 ${Details}`) + if (num) console.log(`\n${title} 请尝试手动领取, 预计可得${num}${award?`金贴`:`京豆`}: \nhttps://uf1.jr.jd.com/up/redEnvelopes/index.html?actCode=${code}\n`); merge[key].fail = 1; merge[key].notify = `${title}: 失败, 原因: 领取异常 ⚠️`; } } else { console.log(`\n${title}签到失败 ${Details}`) const redata = typeof(cc.resultData) == 'string' ? cc.resultData : '' - merge[key].notify = `${title}: 失败, 原因: ${cc.resultCode==3?`Cookie失效‼️`:`${redata||'未知 ⚠️'}`}` + merge[key].notify = `${title}: 失败, ${cc.resultCode==3?`原因: Cookie失效‼️`:`${redata||'原因: 未知 ⚠️'}`}` merge[key].fail = 1; } } @@ -1804,6 +1749,7 @@ function JingRongDoll(s, key, title, code, type, num) { } function JDOverseas(s) { + merge.Overseas = {}; return new Promise(resolve => { if (disable("Overseas")) return resolve() setTimeout(() => { @@ -1834,7 +1780,7 @@ function JDOverseas(s) { merge.Overseas.fail = 1 if (data.match(/(\"code\":\"13\"|重复签到)/)) { merge.Overseas.notify = "京东商城-国际: 失败, 原因: 已签过 ⚠️" - } else if (data.match(/\"code\":\"-1\"/)) { + } else if (data.match(/\"code\":\"(-1|3)\"/)) { merge.Overseas.notify = "京东商城-国际: 失败, 原因: Cookie失效‼️" } else { merge.Overseas.notify = "京东商城-国际: 失败, 原因: 未知 ⚠️" @@ -1853,6 +1799,7 @@ function JDOverseas(s) { } function JingDongGetCash(s) { + merge.JDGetCash = {}; return new Promise(resolve => { if (disable("JDGetCash")) return resolve() setTimeout(() => { @@ -1872,6 +1819,7 @@ function JingDongGetCash(s) { if (cc.data.success && cc.data.result) { console.log("\n" + "京东商城-现金签到成功 " + Details) merge.JDGetCash.success = 1 + merge.JDGetCash.Money = cc.data.result.signCash || 0 merge.JDGetCash.notify = `京东商城-现金: 成功, 明细: ${cc.data.result.signCash||`无`}现金 💰` } else { console.log("\n" + "京东商城-现金签到失败 " + Details) @@ -1897,6 +1845,7 @@ function JingDongGetCash(s) { } function JingDongWebcasts(s) { + merge.JDWebcasts = {}; return new Promise(resolve => { if (disable("JDWebcasts")) return resolve() setTimeout(() => { @@ -1934,6 +1883,7 @@ function JingDongWebcasts(s) { } function JDTakeaLook(s) { + merge.TakeaLook = {}; return new Promise(resolve => { if (disable("TakeaLook")) return resolve() setTimeout(() => { @@ -1972,6 +1922,7 @@ function JDTakeaLook(s) { } function JingDongStore(s) { + merge.JDGStore = {}; return new Promise(resolve => { if (disable("JDGStore")) return resolve() setTimeout(() => { @@ -2010,6 +1961,7 @@ function JingDongStore(s) { } function JDSecKilling(s) { + merge.JDSecKill = {}; return new Promise((resolve, reject) => { if (disable("JDSecKill")) return reject(); setTimeout(() => { @@ -2069,7 +2021,7 @@ function JDSecKilling(s) { } else { console.log(`\n京东秒杀-红包签到失败 ${Details}`); merge.JDSecKill.fail = 1; - merge.JDSecKill.notify = `京东秒杀-红包: 失败, 原因: ${cc.subCode==103?`已领取`:cc.msg?cc.msg:`未知`} ⚠️`; + merge.JDSecKill.notify = `京东秒杀-红包: 失败, ${cc.subCode==103?`原因: 已领取`:cc.msg?cc.msg:`原因: 未知`} ⚠️`; } } catch (eor) { $nobyda.AnError("京东秒杀-领取", "JDSecKill", eor, response, data); @@ -2081,36 +2033,37 @@ function JDSecKilling(s) { }, () => {}); } -function DoubleElevenSale(s) { +function JDJTDoubleSign(s) { + merge.JTDouble = {}; return new Promise(resolve => { - if (disable("ElevenSale")) return resolve(); + if (disable("JTDouble")) return resolve(); setTimeout(() => { $nobyda.post({ - url: 'https://api.m.jd.com/client.action', + url: 'https://nu.jr.jd.com/gw/generic/jrm/h5/m/process', headers: { - Cookie: KEY, - Origin: 'https://h5.m.jd.com' + Cookie: KEY }, - body: 'functionId=noahHaveFunLottery&appid=publicUseApi&body=%7B%22actId%22%3A%22RRD7PgE4k1PYkLBEJRWv6gfPkZUqgY%22%7D&client=wh5' + body: `reqData=${encodeURIComponent('{"type":3,"frontParam":{"channel":"JR","belong":4},"actCode":"1DF13833F7"}')}` }, (error, response, data) => { try { if (error) throw new Error(error); const cc = JSON.parse(data); const Details = LogDetails ? "response:\n" + data : ''; - if (cc.code == 0 && cc.lotteryResult) { - console.log(`\n京东入场-红包签到成功 ${Details}`) - const qt = data.match(/"disCount":"(\d.*?)",/); - merge.ElevenSale.success = 1; - merge.ElevenSale.Cash = qt ? Number(qt[1]) : 0; - merge.ElevenSale.notify = `京东入场-红包: 成功, 明细: ${merge.ElevenSale.Cash||`无`}红包 🧧${qt?` (2天)`:``}`; + if (cc.resultCode == 0 && cc.resultData.data.businessCode == '000ssq') { + console.log(`\n京东金贴-双签签到成功 ${Details}`) + const qt = data.match(/\"count\":\"?(\d.*?)\"?,/); + merge.JTDouble.success = 1; + merge.JTDouble.subsidy = qt ? qt[1] : 0; + merge.JTDouble.notify = `京东金贴-双签: 成功, 明细: ${merge.JTDouble.subsidy||`无`}金贴 💰`; } else { - console.log(`\n京东入场-红包签到失败 ${Details}`) - const tp = cc.subCode == 8 ? `无机会` : cc.code == 3 ? `Cookie失效` : `${cc.msg||`未知`}` - merge.ElevenSale.notify = `京东入场-红包: 失败, 原因: ${tp}${cc.code==3?`‼️`:` ⚠️`}` - merge.ElevenSale.fail = 1 + console.log(`\n京东金贴-双签签到失败 ${Details}`) + const es = cc.resultData && cc.resultData.data ? cc.resultData.data.businessMsg : null + const tp = data.match(/已领取|300ssq/) ? `已签过` : cc.resultCode == 3 ? `Cookie失效` : `${es||cc.resultMsg||`未知`}` + merge.JTDouble.notify = `京东金贴-双签: 失败, 原因: ${tp}${cc.resultCode==3?`‼️`:` ⚠️`}` + merge.JTDouble.fail = 1 } } catch (eor) { - $nobyda.AnError("京东入场-红包", "ElevenSale", eor, response, data) + $nobyda.AnError("京东金贴-双签", "JTDouble", eor, response, data) } finally { resolve() } @@ -2120,7 +2073,111 @@ function DoubleElevenSale(s) { }); } +function JRLuckyLottery(s) { //https://jdda.jd.com/app/hd/#/turntable + merge.JRLottery = {}; + return new Promise(resolve => { + if (disable("JRLottery")) return resolve() + setTimeout(() => { + $nobyda.post({ + url: 'https://ms.jr.jd.com/gw/generic/syh_yxmx/h5/m/handleSign', + headers: { + Cookie: KEY + }, + body: `reqData=${encodeURIComponent(`{"activityNo":"e2d1b240d5674def8178be6b4faac5b6","signType":"1","encryptSign":""}`)}` + }, (error, response, data) => { + try { + if (error) throw new Error(error); + const cc = JSON.parse(data); + const Details = LogDetails ? "response:\n" + data : ''; + if (cc.resultCode == 0 && cc.resultData && cc.resultData.resultCode == 0) { + console.log(`\n京东金融-抽奖签到成功 ${Details}`); + merge.JRLottery.success = 1; + merge.JRLottery.bean = cc.resultData.data.rewardList[0].rewardCount || 0 + merge.JRLottery.notify = `京东金融-抽奖: 成功, 明细: ${merge.JRLottery.bean||`无`}京豆 🐶`; + } else { + console.log(`\n京东金融-抽奖签到失败 ${Details}`); + const tp = data.match(/重复签到/) ? `已签过` : cc.resultCode == 3 ? `Cookie失效` : `${cc.resultMsg||`未知`}`; + merge.JRLottery.notify = `京东金融-抽奖: 失败, 原因: ${tp}${cc.resultCode==3?`‼️`:` ⚠️`}`; + merge.JRLottery.fail = 1; + } + } catch (eor) { + $nobyda.AnError("京东金融-抽奖", "JRLottery", eor, response, data); + } finally { + resolve(); + } + }) + }, s) + if (out) setTimeout(resolve, out + s); + }); +} + +function JingDongBuyCar(s) { + merge.JDBuyCar = {}; + return new Promise((resolve, reject) => { + if (disable("JDBuyCar")) return reject(); + setTimeout(() => { + $nobyda.get({ + url: 'https://cgame-stadium.jd.com/api/v1/first/login', + headers: { + Cookie: KEY, + ActivityId: `f4f998e5b91d48ce957983fe61b0ae90` + } + }, (error, response, data) => { + try { + if (error) throw new Error(error); + const Details = LogDetails ? "response:\n" + data : ''; + console.log(`\n京东汽车-检查签到状态 ${Details}`) + const cc = JSON.parse(data); + if (cc.status && cc.data && cc.data.firstLoginStatus) { + resolve() + } else { + const qt = cc.status && cc.data && cc.data.firstLoginStatus === false ? `已签过` : cc.error && cc.error.code == 2000 ? `Cookie失效` : cc.error && cc.error.msg ? cc.error.msg : `未知` + merge.JDBuyCar.notify = `京东商城-汽车: 失败, 原因: ${qt}${cc.error&&cc.error.code==2000?`‼️`:` ⚠️`}` + merge.JDBuyCar.fail = 1; + reject() + } + } catch (eor) { + $nobyda.AnError("京东汽车-状态", "JDBuyCar", eor, response, data) + reject() + } + }) + }, s) + if (out) setTimeout(resolve, out + s) + }).then(async () => { + await new Promise(resolve => { + $nobyda.post({ + url: 'https://cgame-stadium.jd.com/api/v1/sign', + headers: { + Cookie: KEY, + ActivityId: `f4f998e5b91d48ce957983fe61b0ae90` + } + }, (error, response, data) => { + try { + if (error) throw new Error(error); + const Details = LogDetails ? "response:\n" + data : ''; + const cc = JSON.parse(data); + if (cc.status === true) { + console.log(`\n京东商城-汽车签到成功 ${Details}`); + merge.JDBuyCar.success = 1; + merge.JDBuyCar.bean = cc.data && cc.data.beanNum ? cc.data.beanNum : 0 + merge.JDBuyCar.notify = `京东商城-汽车: 成功, 明细: ${merge.JDBuyCar.bean||`无`}京豆 🐶`; + } else { + console.log(`\n京东商城-汽车签到失败 ${Details}`); + merge.JDBuyCar.fail = 1; + merge.JDBuyCar.notify = `京东商城-汽车: 失败, ${cc.error&&cc.error.msg?cc.error.msg:`原因: 未知`} ⚠️`; + } + } catch (eor) { + $nobyda.AnError("京东汽车-签到", "JDBuyCar", eor, response, data); + } finally { + resolve(); + } + }) + }) + }, () => {}); +} + function TotalSteel() { + merge.TotalSteel = {}; return new Promise(resolve => { if (disable("TSteel")) return resolve() $nobyda.get({ @@ -2150,6 +2207,7 @@ function TotalSteel() { } function TotalBean() { + merge.TotalBean = {}; return new Promise(resolve => { if (disable("Qbear")) return resolve() $nobyda.post({ @@ -2187,6 +2245,7 @@ function TotalBean() { } function TotalCash() { + merge.TotalCash = {}; return new Promise(resolve => { if (disable("TCash")) return resolve() $nobyda.post({ @@ -2217,6 +2276,7 @@ function TotalCash() { } function TotalSubsidy() { + merge.TotalSubsidy = {}; return new Promise(resolve => { if (disable("TotalSubsidy")) return resolve() $nobyda.get({ @@ -2247,6 +2307,7 @@ function TotalSubsidy() { } function TotalMoney() { + merge.TotalMoney = {}; return new Promise(resolve => { if (disable("TotalMoney")) return resolve() $nobyda.get({ @@ -2308,73 +2369,12 @@ function disable(Val, name, way) { } } -function initial() { - merge = { - SpeedUp: {}, - JDBean: {}, - JDTurn: {}, - JRDSign: {}, - TakeaLook: {}, - Overseas: {}, - JDFSale: {}, - JDPet: {}, - JDToyMusic: {}, - JRDoll: {}, - JRTwoDoll: {}, - JRThreeDoll: {}, - JDHealth: {}, - JDEsports: {}, - JDSchool: {}, - JDCalendar: {}, - JDShoes: {}, - JD3C: {}, - JDChild: {}, - JDBaby: {}, - JDSubsidy: {}, - JDDrug: {}, - JDClocks: {}, - JDBook: {}, - JDGStore: {}, - JDShand: {}, - JDMakeup: {}, - JDWomen: {}, - JDFineWine: {}, - JDCare: {}, - JDFood: {}, - JDClean: {}, - JDVege: {}, - JDJewels: {}, - JDWebcasts: {}, - JDCube: {}, - JDPrize: {}, - JRSteel: {}, - JRBean: {}, - subsidy: {}, - ElevenSale: {}, - JDSecKill: {}, - JDCash: {}, - JDGetCash: {}, - JDShake: {}, - TotalBean: {}, - TotalSteel: {}, - TotalCash: {}, - TotalSubsidy: {}, - TotalMoney: {} - } - - for (var i in merge) { - merge[i].success = 0; - merge[i].bean = 0; - merge[i].notify = ''; - } -} - function GetCookie() { try { if ($request.headers && $request.url.match(/api\.m\.jd\.com.*=signBean/)) { var CV = $request.headers['Cookie'] - if (CV.match(/(pt_key=.+?pt_pin=|pt_pin=.+?pt_key=)/)) { - var CookieValue = CV.match(/pt_key=.+?;/) + CV.match(/pt_pin=.+?;/) + if (CV.match(/pt_key=.+?;/) && CV.match(/pt_pin=.+?;/)) { + var CookieValue = CV.match(/pt_key=.+?;/)[0] + CV.match(/pt_pin=.+?;/)[0] var CK1 = $nobyda.read("CookieJD") var CK2 = $nobyda.read("CookieJD2") var AccountOne = CK1 ? CK1.match(/pt_pin=.+?;/) ? CK1.match(/pt_pin=(.+?);/)[1] : null : null @@ -2389,43 +2389,32 @@ function GetCookie() { var CookieKey = "CookieJD2"; } else { $nobyda.notify("更新京东Cookie失败", "非历史写入账号 ‼️", '请开启脚本内"DeleteCookie"以清空Cookie ‼️') - $nobyda.done() return } } else { $nobyda.notify("写入京东Cookie失败", "", "请查看脚本内说明, 登录网页获取 ‼️") - $nobyda.done() return } - if ($nobyda.read(CookieKey)) { - if ($nobyda.read(CookieKey) != CookieValue) { - var cookie = $nobyda.write(CookieValue, CookieKey); - if (!cookie) { - $nobyda.notify("用户名: " + DecodeName, "", "更新京东" + CookieName + "Cookie失败 ‼️"); - } else { - $nobyda.notify("用户名: " + DecodeName, "", "更新京东" + CookieName + "Cookie成功 🎉"); - } - } else { - console.log("京东: \n与历史Cookie相同, 跳过写入") - } + const RA = $nobyda.read(CookieKey); + if (RA == CookieValue) { + console.log(`\n用户名: ${DecodeName}\n与历史京东${CookieName}Cookie相同, 跳过写入 ⚠️`) } else { - var cookie = $nobyda.write(CookieValue, CookieKey); - if (!cookie) { - $nobyda.notify("用户名: " + DecodeName, "", "首次写入京东" + CookieName + "Cookie失败 ‼️"); - } else { - $nobyda.notify("用户名: " + DecodeName, "", "首次写入京东" + CookieName + "Cookie成功 🎉"); - } + const WT = $nobyda.write(CookieValue, CookieKey); + $nobyda.notify(`用户名: ${DecodeName}`, ``, `${RA?`更新`:`写入`}京东${CookieName}Cookie${WT?`成功 🎉`:`失败 ‼️`}`) } + } else if ($request.url === 'http://www.apple.com/') { + $nobyda.notify("京东签到", "", "类型错误, 手动运行请选择上下文环境为Cron ⚠️"); } else { - $nobyda.notify("写入京东Cookie失败", "", "请检查匹配URL或配置内脚本类型 ‼️"); + $nobyda.notify("京东签到", "写入Cookie失败", "请检查匹配URL或配置内脚本类型 ⚠️"); } } catch (eor) { $nobyda.write("", "CookieJD") $nobyda.write("", "CookieJD2") $nobyda.notify("写入京东Cookie失败", "", '已尝试清空历史Cookie, 请重试 ⚠️') console.log(`\n写入京东Cookie出现错误 ‼️\n${JSON.stringify(eor)}\n\n${eor}\n\n${JSON.stringify($request.headers)}\n`) + } finally { + $nobyda.done() } - $nobyda.done() } // Modified from yichahucha function nobyda() { @@ -2599,7 +2588,7 @@ function nobyda() { } merge[keyname].error = 1 } - return console.log(`\n‼️${name}发生错误\n‼️名称: ${er.name}\n‼️描述: ${er.message}${JSON.stringify(er).match(/\"line\"/)?`\n‼️行列: ${JSON.stringify(er)}`:``}${resp&&resp.status?`\n‼️状态: ${resp.status}`:``}${body?`\n‼️响应: ${body}`:``}`) + return console.log(`\n‼️${name}发生错误\n‼️名称: ${er.name}\n‼️描述: ${er.message}${JSON.stringify(er).match(/\"line\"/)?`\n‼️行列: ${JSON.stringify(er)}`:``}${resp&&resp.status?`\n‼️状态: ${resp.status}`:``}${body?`\n‼️响应: ${resp&&resp.status!=503?body:`Omit.`}`:``}`) } const time = () => { const end = ((Date.now() - start) / 1000).toFixed(2) diff --git a/package/ctcgfw/luci-app-jd-dailybonus/root/usr/share/jd-dailybonus/newapp.sh b/package/ctcgfw/luci-app-jd-dailybonus/root/usr/share/jd-dailybonus/newapp.sh index 93f4ab05a8..ade596c959 100755 --- a/package/ctcgfw/luci-app-jd-dailybonus/root/usr/share/jd-dailybonus/newapp.sh +++ b/package/ctcgfw/luci-app-jd-dailybonus/root/usr/share/jd-dailybonus/newapp.sh @@ -49,8 +49,6 @@ cancel() { exit 1 } -REMOTE_SCRIPT=$(uci_get_by_type global remote_url) - fill_cookie() { cookie1=$(uci_get_by_type global cookie) if [ ! "$cookie1" = "" ]; then @@ -77,13 +75,6 @@ fill_cookie() { fi } -if [ -e $TEMP_SCRIPT ]; then - remote_ver=$(cat $TEMP_SCRIPT | sed -n '/更新时间/p' | awk '{for (i=1;i<=NF;i++){if ($i ~/v/) {print $i}}}' | sed 's/v//') -else - remote_ver=$(cat $JD_SCRIPT | sed -n '/更新时间/p' | awk '{for (i=1;i<=NF;i++){if ($i ~/v/) {print $i}}}' | sed 's/v//') -fi -local_ver=$(uci_get_by_type global version) - add_cron() { sed -i '/jd-dailybonus/d' $CRON_FILE [ $(uci_get_by_type global auto_run 0) -eq 1 ] && echo '5 '$(uci_get_by_type global auto_run_time)' * * * sleep '$(expr $(head -n 128 /dev/urandom | tr -dc "0123456789" | head -c4) % 180)'s; /usr/share/jd-dailybonus/newapp.sh -w' >>$CRON_FILE @@ -96,7 +87,7 @@ add_cron() { serverchan() { sckey=$(uci_get_by_type global serverchan) failed=$(uci_get_by_type global failed) - desc=$(cat /www/JD_DailyBonus.htm | grep -E '签到号|签到概览|签到总计|账号总计|其他总计' | sed 's/$/&\n/g') + desc=$(cat /www/JD_DailyBonus.htm | grep -E '签到号|签到概览|签到奖励|其他奖励|账号总计|其他总计' | sed 's/$/&\n/g') serverurlflag=$(uci_get_by_type global serverurl) serverurl=https://sc.ftqq.com/ if [ "$serverurlflag" = "sct" ]; then @@ -118,15 +109,13 @@ serverchan() { run() { fill_cookie echo -e $(date '+%Y-%m-%d %H:%M:%S %A') >$LOG_HTM 2>/dev/null - [ ! -f "/usr/bin/node" ] && echo "未安装node,请安装后再试!">>$LOG_HTM && exit 1 - node $JD_SCRIPT >>$LOG_HTM 2>&1 & + [ ! -f "/usr/bin/node" ] && echo -e "未安装node.js,请安装后再试!\nNode.js is not installed, please try again after installation!">>$LOG_HTM && exit 1 + node $JD_SCRIPT >>$LOG_HTM 2>/dev/null } back_run() { - fill_cookie - echo -e $(date '+%Y-%m-%d %H:%M:%S %A') >$LOG_HTM 2>/dev/null - [ ! -f "/usr/bin/node" ] && echo "未安装node,请安装后再试!">>$LOG_HTM && exit 1 - node $JD_SCRIPT >>$LOG_HTM 2>/dev/null + run + sleep 1s serverchan } @@ -136,22 +125,37 @@ save() { } # Update Script From Server +download() { + REMOTE_SCRIPT=$(uci_get_by_type global remote_url) + wget-ssl --user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36" --no-check-certificate -t 3 -T 10 -q $REMOTE_SCRIPT -O $TEMP_SCRIPT + return $? +} + +get_ver() { + echo $(cat $1 | sed -n '/更新时间/p' | awk '{for (i=1;i<=NF;i++){if ($i ~/v/) {print $i}}}' | sed 's/v//') +} check_ver() { - wget-ssl --user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36" --no-check-certificate -t 3 -T 10 -q $REMOTE_SCRIPT -O $TEMP_SCRIPT + download if [ $? -ne 0 ]; then cancel "501" else - echo $remote_ver + echo $(get_ver $TEMP_SCRIPT) fi } update() { - wget-ssl --user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36" --no-check-certificate -t 3 -T 10 -q $REMOTE_SCRIPT -O $TEMP_SCRIPT + download if [ $? -ne 0 ]; then cancel "501" fi - if [ $(expr $local_ver \< $remote_ver) -eq 1 ]; then + if [ -e $JD_SCRIPT ]; then + local_ver=$(get_ver $JD_SCRIPT) + else + local_ver=0 + fi + remote_ver=$(get_ver $TEMP_SCRIPT) + if [ $(expr "$local_ver" \< "$remote_ver") -eq 1 ]; then cp -r $TEMP_SCRIPT $JD_SCRIPT fill_cookie uci set jd-dailybonus.@global[0].version=$remote_ver