From f93abaceeadcef10b4567d568f8fda9271df404f Mon Sep 17 00:00:00 2001 From: Night Glow <44762336+NightGlowww@users.noreply.github.com> Date: Sat, 23 Nov 2024 20:16:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=8E=A8=E9=80=81=E5=A4=B1?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SFSY.py | 24 ++++++++++++++++-------- mtV1.py | 28 +++++++++++++++++++--------- sendNotify.py | 19 ++++++++++--------- 3 files changed, 45 insertions(+), 26 deletions(-) diff --git a/SFSY.py b/SFSY.py index aaaea45..73cf613 100644 --- a/SFSY.py +++ b/SFSY.py @@ -1639,13 +1639,22 @@ class RUN: # self.DRAGONBOAT_2024_Game_init() self.DRAGONBOAT_2024_coinStatus(True) - self.sendMsg() + # self.sendMsg() + self.send_notification_message('顺丰速运') return True - def sendMsg(self, help=False): - if self.send_UID: - push_res = CHERWIN_TOOLS.wxpusher(self.send_UID, one_msg, APP_NAME, help) - print(push_res) + # def sendMsg(self, help=False): + # if self.send_UID: + # push_res = CHERWIN_TOOLS.wxpusher(self.send_UID, one_msg, APP_NAME, help) + # print(push_res) + def send_notification_message(self,title): + try: + from notify import send + + send(title, ''.join(send_msg)) + except Exception as e: + if e: + print(f'发送通知消息失败!{e}') def get_quarter_end_date(): @@ -1716,7 +1725,7 @@ if __name__ == '__main__': 点击“积分”,以下几种url之一: https://mcs-mimp-web.sf-express.com/mcs-mimp/share/weChat/shareGiftReceiveRedirect https://mcs-mimp-web.sf-express.com/mcs-mimp/share/app/shareRedirect - 多账号#、@、换行分割 + 多账号#、@、换行分割 ✨ 设置青龙变量: export {ENV_NAME}='url'多账号#分割 @@ -1734,11 +1743,10 @@ export {ENV_NAME}='url'多账号#分割 print(f'无{ENV_NAME}变量') #exit() local_version = '2024.06.02' - + # print(tokens) if len(tokens) > 0: print(f"\n>>>>>>>>>>共获取到{len(tokens)}个账号<<<<<<<<<<") for index, infos in enumerate(tokens): run_result = RUN(infos, index).main() if not run_result: continue - diff --git a/mtV1.py b/mtV1.py index 4fb6808..d8bbc1a 100644 --- a/mtV1.py +++ b/mtV1.py @@ -28,9 +28,19 @@ else: meituanCookie = [''] print('无meituanCookie变量') + +def send_notification_message(title): + try: + from sendNotify import send + + send(title, ''.join(all_print_list)) + except Exception as e: + if e: + print('发送通知消息失败!') + #外卖 def waim(ck): - + cookie = f"token={ck};" headers = {"Cookie": cookie, "X-Requested-With":"com.tencent.mm", @@ -45,11 +55,11 @@ def waim(ck): print(f"获得{len(b['data']['allCoupons'])}张优惠券") for sj in b['data']['allCoupons']: print(f"{sj['couponName']}-{sj['amountLimit']}-{sj['couponAmount']}元-{sj['amountLimit']}-{sj['etime']}") - + #团购 def tuangou(ck): - + cookie = f"token={ck};" headers = {"Cookie": cookie, "X-Requested-With":"com.tencent.mm", @@ -64,7 +74,7 @@ def tuangou(ck): print(f"获得{len(b['data']['allCoupons'])}张优惠券") for sj in b['data']['allCoupons']: print(f"{sj['couponName']}-{sj['amountLimit']}-{sj['couponAmount']}元-{sj['amountLimit']}-{sj['etime']}") - + def main(): @@ -86,7 +96,7 @@ def main(): print('-------------') except Exception as e: print('错误') - + print('----------------------') z = z + 1 except Exception as e: @@ -97,7 +107,7 @@ if __name__ == '__main__': main() except Exception as e: print('未知错误') - # try: - # send_notification_message(title='') # 发送通知 - # except Exception as e: - # print('小错误') + try: + send_notification_message(title='') # 发送通知 + except Exception as e: + print('小错误') diff --git a/sendNotify.py b/sendNotify.py index 2c116f6..6e16cea 100644 --- a/sendNotify.py +++ b/sendNotify.py @@ -69,11 +69,11 @@ if "PUSH_PLUS_TOKEN" in os.environ: if "QYWX_AM" in os.environ: if len(os.environ["QYWX_AM"]) > 1: QYWX_AM = os.environ["QYWX_AM"] - + if "QYWX_KEY" in os.environ: if len(os.environ["QYWX_KEY"]) > 1: - QYWX_KEY = os.environ["QYWX_KEY"] + QYWX_KEY = os.environ["QYWX_KEY"] # print("已获取并使用Env环境 QYWX_AM") #接入飞书webhook推送 @@ -159,7 +159,8 @@ def serverJ(title, content): "text": title, "desp": content.replace("\n", "\n\n") } - response = requests.post(f"https://sc.ftqq.com/{PUSH_KEY}.send", data=data).json() + response = requests.post( + f"https://sct.ftqq.com/{PUSH_KEY}.send", data=data).json() if response['code'] == 0: print('推送成功!') else: @@ -267,13 +268,13 @@ def wecom_key(title, content): print("QYWX_KEY服务启动") print("content"+content) headers = {'Content-Type': 'application/json'} - data = { + data = { "msgtype":"text", "text":{ "content":title+"\n"+content.replace("\n", "\n\n") } } - + print(f"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={QYWX_KEY}") response = requests.post(f"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={QYWX_KEY}", json=data,headers=headers).json() print(response) @@ -287,13 +288,13 @@ def fs_key(title, content): print("FS_KEY服务启动") print("content"+content) headers = {'Content-Type': 'application/json'} - data = { + data = { "msg_type":"text", "content":{ "text":title+"\n"+content.replace("\n", "\n\n") } } - + print(f"https://open.feishu.cn/open-apis/bot/v2/hook/{FS_KEY}") response = requests.post(f"https://open.feishu.cn/open-apis/bot/v2/hook/{FS_KEY}", json=data,headers=headers).json() print(response) @@ -439,9 +440,9 @@ def send(title, content): continue elif i == 'wecom_key': if QYWX_KEY: - + for i in range(int(len(content)/2000)+1): - wecom_key(title=title, content=content[i*2000:(i+1)*2000]) + wecom_key(title=title, content=content[i*2000:(i+1)*2000]) else: print('未启用企业微信应用消息推送') continue