Skip to content

Commit

Permalink
Update kuake.py
Browse files Browse the repository at this point in the history
  • Loading branch information
wd210010 authored May 8, 2024
1 parent 6f1ac5c commit c3982ed
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion kuake.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -- coding: utf-8 --
# -------------------------------
# @Author : github@wd210010 https://github.com/wd210010/only_for_happly
# @Time : 2023/10/4 16:23
# @Time : 2024/5/4 16:23
# -------------------------------
# cron "0 0 2 * * *" script-path=xxx.py,tag=匹配cron用
# const $ = new Env('夸克签到')
Expand All @@ -14,6 +14,18 @@
import sys
import requests



#推送函数
# 推送加
plustoken = os.getenv("plustoken")
def Push(contents):
# 推送加
headers = {'Content-Type': 'application/json'}
json = {"token": plustoken, 'title': '夸克签到', 'content': contents.replace('\n', '<br>'), "template": "json"}
resp = requests.post(f'http://www.pushplus.plus/send', json=json, headers=headers).json()
print('push+推送成功' if resp['code'] == 200 else 'push+推送失败')

# 获取环境变量
def get_env():
# 判断 COOKIE_QUARK是否存在于环境变量
Expand Down Expand Up @@ -89,11 +101,13 @@ def do_sign(self):
if growth_info["cap_sign"]["sign_daily"]:
log = f"✅ 执行签到: 今日已签到+{int(growth_info['cap_sign']['sign_daily_reward'] / 1024 / 1024)}MB,连签进度({growth_info['cap_sign']['sign_progress']}/{growth_info['cap_sign']['sign_target']})"
msg += log + "\n"
Push(contents=msg)
else:
sign, sign_return = self.get_growth_sign()
if sign:
log = f"✅ 执行签到: 今日签到+{int(sign_return / 1024 / 1024)}MB,连签进度({growth_info['cap_sign']['sign_progress'] + 1}/{growth_info['cap_sign']['sign_target']})"
msg += log + "\n"
Push(contents=msg)
else:
msg += f"✅ 执行签到: {sign_return}\n"

Expand All @@ -103,6 +117,7 @@ def do_sign(self):
def main():
msg = ""
global cookie_quark

cookie_quark = get_env()

print("✅检测到共", len(cookie_quark), "个夸克账号\n")
Expand Down

0 comments on commit c3982ed

Please sign in to comment.