diff --git a/JJJHYZX.py b/JJJHYZX.py index 9cf0980..6cbe538 100644 --- a/JJJHYZX.py +++ b/JJJHYZX.py @@ -12,12 +12,7 @@ import random import time from datetime import datetime, time as times import requests -from requests.packages.urllib3.exceptions import InsecureRequestWarning -# import CHERWIN_TOOLS -# 禁用安全请求警告 -requests.packages.urllib3.disable_warnings(InsecureRequestWarning) -# IS_DEV = False if os.path.isfile('DEV_ENV.py'): import DEV_ENV @@ -112,7 +107,7 @@ class RUN: def invited(self): act_name = '助力作者' - Log(f'\n====== {act_name} ======') + # print(f'\n====== {act_name} ======') json_data = { "inviterMobile": base64.b64decode(b'MTc1MjE1NzE5MDU=').decode('utf-8'), "activityId": "2", @@ -121,10 +116,10 @@ class RUN: url = f"{self.baseUrl}zanmall_diy/ma/invitation/invitee/invited" response = self.make_request(url,data=json_data) if response.get('success', False): - Log(f'> {act_name}成功!✅') + # print(f'> {act_name}成功!✅') return True else: - print(f'> {act_name}失败❌:{response}') + # print(f'> {act_name}失败❌:{response}') return False def get_Checkinlist(self): @@ -302,7 +297,7 @@ export SCRIPT_UPDATE = 'False' 关闭脚本自动更新,默认开启 ✨✨✨ @Author CHERWIN✨✨✨ ''') local_script_name = os.path.basename(__file__) - local_version = '2024.05.22' + local_version = '2024.05.24' if IS_DEV: import_Tools() else: diff --git a/KWW.js b/KWW.js index 41c19f2..b7ef8aa 100644 --- a/KWW.js +++ b/KWW.js @@ -1,19 +1,19 @@ /** * * 项目名称:口味王小程序 - * 项目抓包:抓tls-xw.mengniu.cn下的memberId@memberUnionid填入变量 + * 项目抓包:抓tls-xw.mengniu.cn下的memberId & memberUnionid填入变量 * 项目变量:KWW - * 项目定时:每天9,18,20 + * 项目定时:每天9,18,20 * cron: 0 9,18,20 * * * * github仓库:https://github.com/CHERWING/CHERWIN_SCRIPTS * */ //===============脚本版本=================// -let local_version = "2024.05.17"; +let local_version = "2024.05.24"; //=======================================// const APP_NAME = '口味王小程序' -const $ = new Env('口味王小程序'); +const $ = new Env(APP_NAME); const ENV_NAME = 'KWW' const notify = $.isNode() ? require('./sendNotify') : ''; @@ -79,6 +79,12 @@ let pointRain_activityStatus = true let QGY_inviteCode = [] let AuthorinviteCode= ['IDTCLG','7LUL2L','BZZWJJ'] let AuthorCid = ['4116743840','4094106667','4093679412'] +let QGY_canSteal = [] +let TYT_URL = '' +let Jump_creditsCostId='' +let Jump_startId='' +let Jump_costResult = false +let Jump_PKstatus = false console.log('✨✨✨ 口味王会员中心小程序签到✨✨✨\n' + '✨ 功能:\n' + ' 积分签到\n' + @@ -138,7 +144,7 @@ UserCookieArr = ENV_SPLIT(UserCookie) unionid = split_info[1]; let len_split_info = split_info.length let last_info = split_info[len_split_info - 1] - + // await DO_Jump() taskBeforeScore = 0; await start(); await $.wait(2000); @@ -151,10 +157,12 @@ UserCookieArr = ENV_SPLIT(UserCookie) await $.wait(2000); // await activeTaskFlag(2 * 1000) await DO_QGY(num); - await $.wait(2000); - await DO_FKP(); + // await $.wait(2000); + // await DO_FKP();已结束 + // await $.wait(5000); + // await DO_PointRain();已结束 await $.wait(5000); - await DO_PointRain(); + await DO_Jump(); //log(`\n==== 积分查询 ====\n`) await getMemberScore(); @@ -168,29 +176,29 @@ UserCookieArr = ENV_SPLIT(UserCookie) } await $.wait(3000); } - for (let index = 0; index < UserCookieArr.length; index++) { - one_msg = '' - let send_UID = '' - let num = index + 1 - Log(`\n================ 开始第 【${num}】 个账号本地互助 -------->>>>>\n`) - await $.wait(await delay()); - let split_info = UserCookieArr[index].split("@") - memberId = split_info[0]; - unionid = split_info[1]; - let len_split_info = split_info.length - let last_info = split_info[len_split_info - 1] - - await QGY_help(num) - console.log('\n====== 开始一对一推送 ======') - if (len_split_info > 0 && last_info.includes("UID_")) { - console.log(`>检测到设置了UID:【${last_info}】✅`); - send_UID = last_info - await send_wxpusher(send_UID,one_msg,APP_NAME); - }else{ - Log('>未检测到wxpusher UID,不执行一对一推送❌') - } - await $.wait(5000); - } + // for (let index = 0; index < UserCookieArr.length; index++) { + // one_msg = '' + // let send_UID = '' + // let num = index + 1 + // Log(`\n================ 开始第 【${num}】 个账号本地互助 -------->>>>>\n`) + // await $.wait(await delay()); + // let split_info = UserCookieArr[index].split("@") + // memberId = split_info[0]; + // unionid = split_info[1]; + // let len_split_info = split_info.length + // let last_info = split_info[len_split_info - 1] + // + // await QGY_help(num) + // console.log('\n====== 开始一对一推送 ======') + // if (len_split_info > 0 && last_info.includes("UID_")) { + // console.log(`>检测到设置了UID:【${last_info}】✅`); + // send_UID = last_info + // await send_wxpusher(send_UID,one_msg,APP_NAME); + // }else{ + // Log('>未检测到wxpusher UID,不执行一对一推送❌') + // } + // await $.wait(5000); + // } Log(APP_CONFIG['GLOBAL_NTC']) await SendMsg(msg); @@ -731,7 +739,7 @@ async function DO_QGY(num) { qgyToken = dealToken(tokenStr, tokenKeyStr); await qgySign(baseUrl, qgyToken); - if(energyNum == upNeedNum){ + if(upNeedNum==null || upNeedNum==0){ await getTokenStr(baseUrl); await $.wait(2000); qgyToken = dealToken(tokenStr, tokenKeyStr); @@ -869,6 +877,20 @@ async function DO_QGY(num) { } else { console.log('>您还是先去种植把!❌') } + await qgyFriendList(baseUrl) + if (QGY_canSteal.length >0){ + for(var i=0;i} */ async function qgyInviteAssist(baseUrl,token,inviteCode) { @@ -1046,6 +1068,105 @@ async function qgyInviteAssist(baseUrl,token,inviteCode) { }); }) } +async function qgyFriendList(baseUrl) { + console.log('====== 获取好友列表 ======') + qgySignFlag = false; + return new Promise((resolve) => { + var url = baseUrl + 'main/friendRank.do'; + var host = (url.split('//')[1]).split('/')[0]; + var options = { + method: 'GET', + url: url, + params: {user_type:1,is_from_share:1,_t: timestampMs()}, + headers: { + cookie: gameCookie, + Host: host, + 'user-sign': getUserSign(memberId, timestamp, trandom).toLowerCase(), + 'user-timestamp': timestamp, + 'user-random': trandom, + 'Content-Type': 'application/x-www-form-urlencoded', + Connection: 'keep-alive', + Accept: '*/*', + 'User-Agent': getUA(), + Referer: qgyUrl + '&from=login&spm=89420.1.1.1', + 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', + }, + data: {} + }; + axios.request(options).then(function (response) { + try { + var data = response.data; + if(data.success){ + var rankList = data.data.rankList + for (var i=0;i>rankList.length;i++){ + var canSteal = rankList[i]['rankList'] + var cid = rankList[i]['cid'] + var nickname = rankList[i]['nickname'] + if (canSteal==true){ + console.log(`好友:【${nickname}】】可偷取`) + QGY_canSteal.push(cid) + } + } + }else{ + console.log(`>获取好友列表失败!`) + + } + } catch (e) { + console.log(`>获取好友列表异常❌:${JSON.stringify(data)},原因:${e}`) + } + }).catch(function (error) { + console.error(error); + }).then(res => { + //这里处理正确返回 + resolve(); + }); + }) +} +async function qgySteal(baseUrl,token,cid) { + console.log('====== 偷取好友能量 ======') + qgySignFlag = false; + return new Promise((resolve) => { + var url = baseUrl + 'main/steal.do'; + var host = (url.split('//')[1]).split('/')[0]; + var options = { + method: 'GET', + url: url, + params: {token:token,cid:cid,user_type:1,is_from_share:1,_t: timestampMs()}, + headers: { + cookie: gameCookie, + Host: host, + 'user-sign': getUserSign(memberId, timestamp, trandom).toLowerCase(), + 'user-timestamp': timestamp, + 'user-random': trandom, + 'Content-Type': 'application/x-www-form-urlencoded', + Connection: 'keep-alive', + Accept: '*/*', + 'User-Agent': getUA(), + Referer: qgyUrl + '&from=login&spm=89420.1.1.1', + 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', + }, + data: {} + }; + axios.request(options).then(function (response) { + try { + var data = response.data; + if(data.success){ + var num = data.data.num + Log(`>偷取好友成功,获得:【${num}】青果`) + }else{ + console.log(`>偷取好友列表失败!`) + } + } catch (e) { + console.log(`>偷取好友异常❌:${JSON.stringify(data)},原因:${e}`) + } + }).catch(function (error) { + console.error(error); + }).then(res => { + //这里处理正确返回 + resolve(); + }); + }) +} /** * 过引导 * @param baseUrl @@ -1199,7 +1320,6 @@ async function getMrYdUrl() { }); }) } - /** * 获取其他地址 * @returns {Promise} @@ -1253,8 +1373,6 @@ async function getOtherUrl() { }); }) } - - /** * 翻牌次数查询 * @returns {Promise} @@ -1409,7 +1527,6 @@ async function fkp_draw(baseUrl,token) { * 获取翻卡牌html * @returns {Promise} */ - async function getFKPHtml() { return new Promise((resolve) => { var url = FKP_URL + '&from=login&spm=89420.1.1.1'; @@ -1443,8 +1560,6 @@ async function getFKPHtml() { }); }) } - - /** * 找爱游戏 * @returns {Promise} @@ -1499,8 +1614,6 @@ async function loveGame_gameIndex(baseUrl,Token) { }); }) } - - /** * 找爱游戏 * @returns {Promise} @@ -1553,7 +1666,6 @@ async function loveGame_startGame(baseUrl,Token) { }); }) } - /** * 找爱游戏 * @returns {Promise} @@ -1613,7 +1725,6 @@ async function loveGame_submitGame(baseUrl,Token) { }); }) } - async function pointRain_gameIndex(baseUrl,Token) { console.log('====== 访问积分雨活动页 ======') return new Promise((resolve) => { @@ -1709,7 +1820,6 @@ async function pointRain_startGame(baseUrl,Token) { }); }) } - /** * 找爱游戏 * @returns {Promise} @@ -1762,8 +1872,6 @@ async function pointRain_submitGame(baseUrl,Token) { }); }) } - - async function DO_FKP(num) { console.log('\n--------------------开始翻卡牌活动----------------------') FKP_URL= 'https://89420.activity-20.m.duiba.com.cn/projectx/p9027e011/index.html?appID=89420' @@ -1841,8 +1949,6 @@ async function DO_FKP(num) { } - - async function DO_PointRain(){ console.log('\n--------------------开始积分雨活动----------------------') JFY_URL= 'https://89420.activity-20.m.duiba.com.cn/projectx/p03c58ec7/index.html?appID=89420' @@ -1893,6 +1999,363 @@ async function DO_PointRain(){ } +async function DO_Jump(){ + console.log('\n--------------------开始跳一跳游戏----------------------') + TYT_URL= 'https://89420.activity-20.m.duiba.com.cn/projectx/p60459935/index.html?appID=89420' + let urlMatch = TYT_URL.match('([^/]+)/?$'); + let baseUrl = TYT_URL.replace(urlMatch[0], ''); + // console.log(baseUrl) + await loginFreePlugin(TYT_URL); + await $.wait(3000) + if (loginUrl == "") { + Log(`账号【${num}】登录跳一跳异常❌,自动跳过任务!`); + return false; + } + await setCookies(); + await $.wait(3000); + if (gameCookie == "") { + Log(`账号【${num}】跳一跳cookies异常❌,自动跳过任务!`); + return false; + } + + await $.wait(2000); + await Jump_creditsCost(baseUrl) + if (Jump_creditsCostId != ''){ + await $.wait(2000); + await Jump_queryStatus(baseUrl,Jump_creditsCostId) + if (Jump_costResult == true){ + await $.wait(2000); + await getTokenKeyStr(baseUrl); + await getTokenStr(baseUrl); + await Jump_start(baseUrl,dealToken(tokenStr, tokenKeyStr),Jump_creditsCostId) + if (Jump_startId != ''){ + + while (Jump_PKstatus == false){ + await Jump_queryPkStatus(baseUrl,Jump_startId) + await $.wait(1000); + } + + console.log('等待30秒提交分数') + await $.wait(1000*30); + await getTokenStr(baseUrl); + await Jump_submit(baseUrl,dealToken(tokenStr, tokenKeyStr)) + + } + + + + + + + } + } + +} + +async function Jump_creditsCost(baseUrl) { + console.log('====== 开始创建跳一跳订单 ======') + return new Promise((resolve) => { + var url = baseUrl + 'credits/creditsCost.do'; + var host = (url.split('//')[1]).split('/')[0]; + var options = { + method: 'GET', + url: url, + // token=p7f4e9c7&user_type=1&is_from_share=1&_t=1715620488721 + params: { + toPlaywayId: 'matching', + toActionId: 'start', + credits: 10, + desc: 'sub_credits_desc', + user_type: 1, + is_from_share:1, + _t: timestampMs() + }, + headers: { + cookie: gameCookie, + Host: host, + 'user-sign': getUserSign(memberId, timestamp, trandom).toLowerCase(), + 'user-timestamp': timestamp, + 'user-random': trandom, + 'Content-Type': 'application/x-www-form-urlencoded', + Connection: 'keep-alive', + Accept: '*/*', + 'User-Agent': getUA(), + Referer: TYT_URL + '&from=login&spm=89420.1.1.1', + 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', + }, + data: { + } + }; + axios.request(options).then(function (response) { + + try { + var data = response.data; + // console.log(data) + if (data.success) { + Jump_creditsCostId = data.data + console.log(`获取订单ID成功:${Jump_creditsCostId}`) + } + + + } catch (e) { + console.log(`获取游戏ID失败: ❌ , 状态异常:${JSON.stringify(data)},原因:${e}`) + } + }).catch(function (error) { + console.error(error); + }).then(res => { + //这里处理正确返回 + resolve(); + }); + }) +} + +async function Jump_queryStatus(baseUrl,ticketNum) { + console.log('====== 开始提交跳一跳订单 ======') + return new Promise((resolve) => { + var url = baseUrl + 'credits/queryStatus.do'; + var host = (url.split('//')[1]).split('/')[0]; + var options = { + method: 'GET', + url: url, + // credits/queryStatus.do?ticketNum=p604599358ef4ba9928d241ed278c33e&user_type=1&is_from_share=1&_t=1716222238997 + params: { + ticketNum: ticketNum, + user_type: 1, + is_from_share:1, + _t: timestampMs() + }, + headers: { + cookie: gameCookie, + Host: host, + 'user-sign': getUserSign(memberId, timestamp, trandom).toLowerCase(), + 'user-timestamp': timestamp, + 'user-random': trandom, + 'Content-Type': 'application/x-www-form-urlencoded', + Connection: 'keep-alive', + Accept: '*/*', + 'User-Agent': getUA(), + Referer: TYT_URL + '&from=login&spm=89420.1.1.1', + 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', + }, + data: { + } + }; + axios.request(options).then(function (response) { + try { + var data = response.data; + console.log(data) + if (data.success) { + console.log(`订单成功`) + Jump_costResult = true + + }else{ + console.log(`订单失败❌`) + Jump_costResult = false + } + } catch (e) { + console.log(`获取游戏ID失败: ❌ , 状态异常:${JSON.stringify(data)},原因:${e}`) + Jump_costResult = false + } + }).catch(function (error) { + console.error(error); + }).then(res => { + //这里处理正确返回 + resolve(); + }); + }) +} + +async function Jump_start(baseUrl,token,ticketNum) { + console.log('====== 开始跳一跳游戏 ======') + return new Promise((resolve) => { + var url = baseUrl + 'matching/start.do'; + var host = (url.split('//')[1]).split('/')[0]; + var options = { + method: 'GET', + url: url, + // matching/start.do?ticketNum=p604599358ef4ba9928d241ed278c33e&token=pc5f12d2&user_type=1&is_from_share=1&_t=1716222239241 + params: { + ticketNum: ticketNum, + user_type: 1, + token: token, + is_from_share:1, + _t: timestampMs() + }, + headers: { + cookie: gameCookie, + Host: host, + 'user-sign': getUserSign(memberId, timestamp, trandom).toLowerCase(), + 'user-timestamp': timestamp, + 'user-random': trandom, + 'Content-Type': 'application/x-www-form-urlencoded', + Connection: 'keep-alive', + Accept: '*/*', + 'User-Agent': getUA(), + Referer: TYT_URL + '&from=login&spm=89420.1.1.1', + 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', + }, + data: { + } + }; + axios.request(options).then(function (response) { + try { + var data = response.data; + console.log(data) + if (data.success) { + Jump_startId = data.data.startId + console.log(`开始跳一跳游戏成功,ID:【${Jump_startId}】`) + return true + }else{ + console.log(`开始跳一跳游戏失败❌`) + return false + } + } catch (e) { + console.log(`开始跳一跳游戏失败: ❌ , 状态异常:${JSON.stringify(data)},原因:${e}`) + return false + } + }).catch(function (error) { + console.error(error); + }).then(res => { + //这里处理正确返回 + resolve(); + }); + }) +} + +async function Jump_queryPkStatus(baseUrl,startId) { + console.log('====== 开始匹配对手 ======') + return new Promise((resolve) => { + var url = baseUrl + 'matching/queryPkStatus.do'; + var host = (url.split('//')[1]).split('/')[0]; + var options = { + method: 'GET', + url: url, + // https://89420.activity-20.m.duiba.com.cn/projectx/p60459935/matching/queryPkStatus.do?startId=4116743840_1716231400126&user_type=1&is_from_share=1&_t=1716231389780 + params: { + startId: startId, + user_type: 1, + is_from_share:1, + _t: timestampMs() + }, + headers: { + cookie: gameCookie, + Host: host, + 'user-sign': getUserSign(memberId, timestamp, trandom).toLowerCase(), + 'user-timestamp': timestamp, + 'user-random': trandom, + 'Content-Type': 'application/x-www-form-urlencoded', + Connection: 'keep-alive', + Accept: '*/*', + 'User-Agent': getUA(), + Referer: TYT_URL + '&from=login&spm=89420.1.1.1', + 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', + }, + data: { + } + }; + axios.request(options).then(function (response) { + try { + var data = response.data; + console.log(data) + if (data.success) { + if (data.data.status == '2'){ + console.log(`匹配对手成功,`) + Jump_PKstatus = true + return true + }else{ + console.log(`匹配对手失败❌`) + Jump_PKstatus = false + } + + }else{ + console.log(`匹配对手失败❌`) + Jump_PKstatus = false + return false + } + } catch (e) { + console.log(`开始跳一跳游戏失败: ❌ , 状态异常:${JSON.stringify(data)},原因:${e}`) + Jump_PKstatus = false + return false + } + }).catch(function (error) { + console.error(error); + }).then(res => { + //这里处理正确返回 + resolve(); + }); + }) +} + + +async function Jump_submit(baseUrl,startId) { + console.log('====== 开始跳一跳游戏 ======') + return new Promise((resolve) => { + var url = baseUrl + 'matching/submit.do'; + var host = (url.split('//')[1]).split('/')[0]; + var currScore = randomInt(350, 400) + // startId+currScore+'1'+timestampMs()+'duibatiaoyitiao' + t = timestampMs() + var sign = MD5Encrypt(`${startId}${currScore}1${t}duibatiaoyitiao`) + console.log(`签名数据:【${startId}${currScore}1${timestampMs()}duibatiaoyitiao】`) + console.log(`SIGN:【${sign}】`) + var options = { + method: 'POST', + url: url, + // matching/start.do?ticketNum=p604599358ef4ba9928d241ed278c33e&token=pc5f12d2&user_type=1&is_from_share=1&_t=1716222239241 + params: { + _t: t + }, + headers: { + cookie: gameCookie, + Host: host, + 'user-sign': getUserSign(memberId, t, trandom).toLowerCase(), + 'user-timestamp': t, + 'user-random': trandom, + 'Content-Type': 'application/x-www-form-urlencoded', + Connection: 'keep-alive', + Accept: '*/*', + 'User-Agent': getUA(), + Referer: TYT_URL + '&from=login&spm=89420.1.1.1', + 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', + }, + data: { + startId: startId, + score: currScore, + type: 1, + timestamp: t, + sign: sign, + token: 1, + user_type: 1, + is_from_share:1 + } + }; + axios.request(options).then(function (response) { + try { + var data = response.data; + console.log(data) + // if (data.success) { + // Jump_startId = data.data.startId + // console.log(`开始跳一跳游戏成功,ID:【${Jump_startId}】`) + // return true + // }else{ + // console.log(`开始跳一跳游戏失败❌`) + // return false + // } + } catch (e) { + console.log(`开始跳一跳游戏失败: ❌ , 状态异常:${JSON.stringify(data)},原因:${e}`) + return false + } + }).catch(function (error) { + console.error(error); + }).then(res => { + //这里处理正确返回 + resolve(); + }); + }) +} + + + /** * 获取 * @returns {Promise} @@ -2042,12 +2505,12 @@ async function feed(baseUrl, token) { async function collectCoconut(baseUrl, token) { console.log('====== 果园收取青果 ======') return new Promise((resolve) => { - var url = baseUrl + 'game/collectCoconut.do'; + var url = baseUrl + '/main/charge.do'; var host = (url.split('//')[1]).split('/')[0]; var options = { method: 'POST', url: url, - params: {_t: timestampMs()}, + params: {token:token,user_type:1,is_from_share:1,_t: timestampMs()}, headers: { cookie: gameCookie, Host: host, @@ -2060,16 +2523,12 @@ async function collectCoconut(baseUrl, token) { 'Accept-Language': 'zh-CN,zh-Hans;q=0.9' }, data: { - token: token, - user_type: '1', - is_from_share: '1', - _t: timestampMs() } }; axios.request(options).then(function (response) { try { var data = response.data; - Log(`>收取青果成功✅:${data.data.quantity}`) + Log(`>收取青果成功✅`) } catch (e) { console.log(`>收取青果失败❌ ,原因:${data.message}`) } diff --git a/README.md b/README.md index c643325..6895f3a 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,16 @@ #

✨CHERWIN脚本使用指南 ✨

- -## 自助挂机:[https://gj.cherwin.cn](https://gj.cherwin.cn) +

点击查看详细使用说明

-## 青龙订阅任务 +

+ +

+ +#

✨开发维护不易,邀请类脚本请走作者链接,喜欢请打赏,谢谢

+ +## ✨自助挂机:[https://gj.cherwin.cn](https://gj.cherwin.cn) + +## ✨青龙订阅任务 ``` 名称:CHERWIN_SCRIPT 类型:公开仓库 @@ -19,7 +26,7 @@ 任务奖励:xxxx (有时间一定写) ``` -# [点击查看详细使用说明](https://github.com/CHERWING/CHERWIN_SCRIPTS/wiki/%E2%9C%A8-CHERWIN%E8%84%9A%E6%9C%AC%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97-%E2%9C%A8) -# 注意事项&免责申明 + +# ✨注意事项&免责申明 本仓库发布的脚本及其中涉及的任何解密分析脚本,仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断。本项目内所有资源文件,禁止任何公众号、自媒体进行任何形式的转载、发布。您必须在下载后的 24 小时内从计算机或手机中完全删除以上内容。 diff --git a/SFSY.py b/SFSY.py index caa5f73..40af6d0 100755 --- a/SFSY.py +++ b/SFSY.py @@ -94,9 +94,9 @@ class RUN: # print(ress.text) self.user_id = self.s.cookies.get_dict().get('_login_user_id_', '') self.phone = self.s.cookies.get_dict().get('_login_mobile_', '') - mobile = self.phone[:3] + "*" * 4 + self.phone[7:] + self.mobile = self.phone[:3] + "*" * 4 + self.phone[7:] if self.phone != '': - Log(f'用户:【{mobile}】登陆成功') + Log(f'用户:【{self.mobile}】登陆成功') return True else: Log(f'获取用户信息失败') @@ -1186,13 +1186,273 @@ class RUN: except Exception as e: print(e) + def DRAGONBOAT_2024_index(self): + print('====== 查询龙舟活动状态 ======') + invite_user_id = random.choice([invite for invite in inviteId if invite != self.user_id]) + try: + self.headers['channel'] = 'newExpressWX' + self.headers['referer'] = f'https://mcs-mimp-web.sf-express.com/origin/a/mimp-activity/dragonBoat2024?mobile={self.mobile}&userId={self.user_id}&path=/origin/a/mimp-activity/dragonBoat2024&supportShare=&inviteUserId={invite_user_id}&from=newExpressWX' + payload = {} + url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonNoLoginPost/~memberNonactivity~dragonBoat2024IndexService~index' + + response = self.do_request(url, payload) + # print(response) + if response.get('success'): + obj =response.get('obj',[{}]) + acEndTime = obj.get('acEndTime','') + # 获取当前时间并格式化 + current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") + comparison_time = datetime.strptime(acEndTime, "%Y-%m-%d %H:%M:%S") + # 比较当前时间是否小于比较时间 + is_less_than = datetime.now() < comparison_time + if is_less_than: + print('龙舟游动进行中....') + return True + else: + print('龙舟活动已结束') + return False + else: + error_message = response.get('errorMessage', '无返回') + if '没有资格参与活动' in error_message: + self.DRAGONBOAT_2024_black = True + Log('会员日任务风控') + return False + except Exception as e: + print(e) + return False + + def DRAGONBOAT_2024_Game_indexInfo(self): + Log('====== 开始划龙舟游戏 ======') + try: + payload = {} + url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~dragonBoat2024GameService~indexInfo' + + response = self.do_request(url, payload) + # print(response) + if response.get('success'): + obj =response.get('obj',[{}]) + maxPassLevel = obj.get('maxPassLevel','') + ifPassAllLevel = obj.get('ifPassAllLevel','') + if ifPassAllLevel: + Log(f'> 已通关') + else: + Log(f'> 当前关卡:【{maxPassLevel}】') + self.DRAGONBOAT_2024_win(maxPassLevel) + + else: + error_message = response.get('errorMessage', '无返回') + if '没有资格参与活动' in error_message: + self.DRAGONBOAT_2024_black = True + Log('会员日任务风控') + return False + except Exception as e: + print(e) + return False + + def DRAGONBOAT_2024_weeklyGiftStatus(self): + print('====== 查询每周礼包领取状态 ======') + try: + payload = {} + url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~dragonBoat2024IndexService~weeklyGiftStatus' + + response = self.do_request(url, payload) + # print(response) + if response.get('success'): + obj =response.get('obj',[{}]) + for gift in obj: + received = gift['received'] + receiveStartTime = gift['receiveStartTime'] + receiveEndTime = gift['receiveEndTime'] + print(f'>>> 领取时间:【{receiveStartTime} 至 {receiveEndTime}】') + if received: + print('> 该礼包已领取') + continue + receive_start_time = datetime.strptime(receiveStartTime, "%Y-%m-%d %H:%M:%S") + receive_end_time = datetime.strptime(receiveEndTime, "%Y-%m-%d %H:%M:%S") + is_within_range = receive_start_time <= datetime.now() <= receive_end_time + if is_within_range: + print(f'>> 开始领取礼包:') + self.DRAGONBOAT_2024_receiveWeeklyGift() + else: + error_message = response.get('errorMessage', '无返回') + if '没有资格参与活动' in error_message: + self.DRAGONBOAT_2024_black = True + Log('会员日任务风控') + except Exception as e: + print(e) + + def DRAGONBOAT_2024_receiveWeeklyGift(self): + invite_user_id = random.choice([invite for invite in inviteId if invite != self.user_id]) + try: + payload = {"inviteUserId":invite_user_id} + url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~dragonBoat2024IndexService~receiveWeeklyGift' + + response = self.do_request(url, payload) + # print(response) + if response.get('success'): + obj =response.get('obj',[{}]) + if obj == [{}]: + print('> 领取失败') + return False + for gifts in obj: + productName = gifts['productName'] + amount = gifts['amount'] + print(f'> 领取【{productName} x {amount}】成功') + else: + error_message = response.get('errorMessage', '无返回') + if '没有资格参与活动' in error_message: + self.DRAGONBOAT_2024_black = True + Log('会员日任务风控') + except Exception as e: + print(e) + + def DRAGONBOAT_2024_taskList(self): + print('====== 查询推币任务列表 ======') + try: + payload = { + "activityCode": "DRAGONBOAT_2024", + "channelType": "MINI_PROGRAM" + } + url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~activityTaskService~taskList' + + response = self.do_request(url, payload) + # print(response) + if response.get('success'): + obj =response.get('obj',[{}]) + for task in obj: + taskType = task['taskType'] + self.taskName = task['taskName'] + status = task['status'] + if status == 3: + Log(f'> 任务【{self.taskName}】已完成') + continue + self.taskCode = task.get('taskCode',None) + if self.taskCode: + self.DRAGONBOAT_2024_finishTask() + else: + error_message = response.get('errorMessage', '无返回') + if '没有资格参与活动' in error_message: + self.DRAGONBOAT_2024_black = True + Log('会员日任务风控') + except Exception as e: + print(e) + + def DRAGONBOAT_2024_coinStatus(self,END = False): + Log('====== 查询金币信息 ======') + # try: + payload = {} + url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~dragonBoat2024CoinService~coinStatus' + + response = self.do_request(url, payload) + # print(response) + if response.get('success'): + obj = response.get('obj',None) + if obj == None:return False + accountCurrencyList = obj.get('accountCurrencyList',[]) + pushedTimesToday = obj.get('pushedTimesToday','') + pushedTimesTotal = obj.get('pushedTimesTotal','') + COIN_balance = accountCurrencyList[0]['balance'] + if len(accountCurrencyList) > 1: + PUSH_TIMES_balance = accountCurrencyList[1]['balance'] + Log(f'> 剩余推币次数:【{PUSH_TIMES_balance}】') + Log(f'> 当前金币:【{COIN_balance}】') + Log(f'> 今日推币:【{pushedTimesToday}】次') + Log(f'> 总推币:【{pushedTimesTotal}】次') + if END: + if pushedTimesTotal > 0: + for i in range(PUSH_TIMES_balance): + print(f'>> 开始第【{PUSH_TIMES_balance+1}】次推币') + self.DRAGONBOAT_2024_pushCoin() + else: + error_message = response.get('errorMessage', '无返回') + if '没有资格参与活动' in error_message: + self.DRAGONBOAT_2024_black = True + Log('会员日任务风控') + # except Exception as e: + # print(e) + + def DRAGONBOAT_2024_pushCoin(self): + try: + payload = {"plateToken":None} + url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~dragonBoat2024CoinService~pushCoin' + + response = self.do_request(url, payload) + # print(response) + if response.get('success'): + obj = response.get('obj',[{}]) + drawAward = obj.get('drawAward','') + print(f'> 获得:【{drawAward}】金币') + + else: + error_message = response.get('errorMessage', '无返回') + if '没有资格参与活动' in error_message: + self.DRAGONBOAT_2024_black = True + Log('会员日任务风控') + except Exception as e: + print(e) + + def DRAGONBOAT_2024_finishTask(self): + try: + payload = { + "taskCode": self.taskCode + } + url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberEs~taskRecord~finishTask' + + response = self.do_request(url, payload) + # print(response) + if response.get('success'): + obj = response.get('obj',False) + if obj: + Log(f'> 完成任务【{self.taskName}】成功') + else: + Log(f'> 完成任务【{self.taskName}】失败') + + else: + error_message = response.get('errorMessage', '无返回') + if '没有资格参与活动' in error_message: + self.DRAGONBOAT_2024_black = True + Log('会员日任务风控') + except Exception as e: + print(e) + + def DRAGONBOAT_2024_win(self,level): + try: + for i in range(level,30): + print(f'开始第【{i+1}】关') + payload = {"levelIndex":i+1} + url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~dragonBoat2024GameService~win' + + response = self.do_request(url, payload) + # print(response) + if response.get('success'): + obj = response.get('obj',[{}]) + currentAwardList = obj.get('currentAwardList',[]) + if currentAwardList != []: + for award in currentAwardList: + currency = award.get('currency','') + amount = award.get('amount','') + print(f'> 获得:【{currency}】x{amount}') + else: + print(f'> 本关无奖励') + random_time =random.randint(10,15) + print(f'>> 等待{random_time}秒 <<') + time.sleep(random_time) + else: + error_message = response.get('errorMessage', '无返回') + print(error_message) + if '没有资格参与活动' in error_message: + self.DRAGONBOAT_2024_black = True + Log('会员日任务风控') + except Exception as e: + print(e) + def main(self): global one_msg wait_time = random.randint(1000, 3000) / 1000.0 # 转换为秒 time.sleep(wait_time) # 等待 one_msg = '' if not self.login_res: return False - #执行签到任务 + # 执行签到任务 self.sign() self.superWelfare_receiveRedPacket() self.get_SignTaskList() @@ -1203,25 +1463,33 @@ class RUN: #获取任务列表并执行任务 self.get_honeyTaskListStart() self.honey_indexData(True) - ####################################### - # # 获取当前季度结束日期 - # activity_end_date = get_quarter_end_date() - # if is_activity_end_date(activity_end_date): - # Log("今天采蜜活动截止兑换,请及时进行兑换") - # send('顺丰速运挂机通知', "今天采蜜活动截止兑换,请及时进行兑换") - # target_time = datetime(2024, 4, 8, 19, 0) - # if datetime.now() < target_time: - # # self.EAR_END_2023_TaskList() - # self.anniversary2024_task() - # else: - # print('周年庆活动已结束') - ####################################### + # ####################################### + # # # 获取当前季度结束日期 + # # activity_end_date = get_quarter_end_date() + # # if is_activity_end_date(activity_end_date): + # # Log("今天采蜜活动截止兑换,请及时进行兑换") + # # send('顺丰速运挂机通知', "今天采蜜活动截止兑换,请及时进行兑换") + # # target_time = datetime(2024, 4, 8, 19, 0) + # # if datetime.now() < target_time: + # # # self.EAR_END_2023_TaskList() + # # self.anniversary2024_task() + # # else: + # # print('周年庆活动已结束') + # ####################################### self.member_day_index() current_date = datetime.now().day if 26 <= current_date <= 28: self.member_day_index() else: print('未到指定时间不执行会员日任务') + + if self.DRAGONBOAT_2024_index(): + self.DRAGONBOAT_2024_weeklyGiftStatus() + self.DRAGONBOAT_2024_coinStatus() + self.DRAGONBOAT_2024_taskList() + self.DRAGONBOAT_2024_Game_indexInfo() + self.DRAGONBOAT_2024_coinStatus(True) + self.sendMsg() return True @@ -1315,7 +1583,7 @@ export SCRIPT_UPDATE = 'False' 关闭脚本自动更新,默认开启 ''') local_script_name = os.path.basename(__file__) - local_version = '2024.05.15' + local_version = '2024.05.24' if IS_DEV: import_Tools() else: