代码拉取完成,页面将自动刷新
同步操作将从 青铜少年/自用青龙脚本库 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# coding=utf-8
"""
每日8点
cron: 0 0 8 * * ?
new Env("药研社")
"""
import requests
import notify
import utils.tool as TOOL
import utils.getCookie as getCookie
global msg
msg = """
名称|今日|总研值
:--:|:--:|:--:
"""
def main():
users = getCookie.GetQlEnvs().getCookies('YYS_TOKEN')
print("🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉\n")
print("获取到: "+str(len(users))+" 个用户")
print("-------------------------------------------")
for user in users:
signIn(user)
# 签到
def signIn(user):
global msg
url = "https://m.yaoyanshe.com/web-api/mdUser/v2/sign"
headers = {
"Host": "m.yaoyanshe.com",
"Connection": "keep-alive",
"accessToken": user['cookie'],
"app-key": "MODULE_YYS_H5_201903161",
"version": "3.9.4",
"app-type": "",
"User-Agent": "Mozilla/5.0 (Linux; Android 11; Redmi K20 Pro Premium Edition Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/87.0.4280.141 Mobile Safari/537.36",
"Accept": "application/json, text/plain, */*",
"sign": "16892536F31504A9874AE85846B741D6",
"product-code": "yys-h5",
"devcie": "iOS",
"app-version": "3.9.4",
"X-Requested-With": "com.healthmudi.dia",
"Sec-Fetch-Site": "same-origin",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Dest": "empty",
"Referer": "https://m.yaoyanshe.com/h/fs/sign_in",
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"
}
res = requests.get(url=url, headers= headers)
json = res.json()
if json['status'] != 0:
print(user['name'] + " ---> " + "今日签到研值: " +
str(json['subMessage']) + " 总研值: " + str(json['subMessage']))
msg += user['name'] + "|" + "失效" + "|" + "失效" + "\n\n"
return
oneDayReward = json['data']['oneDayReward']
# 签到成功 获取 药研值
url = "https://yys.yaoyanshe.com/app-api/mdUserPoints/getUserPoints"
res = requests.get(url=url, headers=headers)
json = res.json()
allDayReward = json['data']
print(user['name'] + " ---> " + "今日签到研值: " +
str(oneDayReward) + " 总研值: " + str(allDayReward))
print("-------------------------------------------")
msg += user['name'] + "|" + \
str(oneDayReward)+"|"+str(allDayReward)+"\n\n"
main()
print("\n🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉")
notify.send("药研社", msg)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。