1 Star 0 Fork 4

ITCrowed/自用青龙脚本库

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ydybj.py 1.81 KB
一键复制 编辑 原始数据 按行查看 历史
# coding=utf-8
"""
cron: 0 0 6 * * ?
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('YDYBJ_COOKIE')
print("🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉\n")
print("获取到: "+str(len(users))+" 个用户")
print("-------------------------------------------")
for user in users:
signIn(user)
# 签到
def signIn(user):
global msg
ad = 0
payload = 'yaohuo:id34976'
headers = {'Cookie': user['cookie']}
re = requests.request(
"POST", "https://note.youdao.com/yws/api/daupromotion?method=sync", headers=headers, data=payload)
if 'error' not in re.text:
res = requests.request(
"POST", "https://note.youdao.com/yws/mapi/user?method=checkin", headers=headers, data=payload)
for i in range(3):
resp = requests.request(
"POST", "https://note.youdao.com/yws/mapi/user?method=adRandomPrompt", headers=headers, data=payload)
ad += resp.json()['space'] // 1048576
if 'reward' in re.text:
sync = re.json()['rewardSpace'] // 1048576
checkin = res.json()['space'] // 1048576
# 签到成功
print(user['name'] + " ---> " +
str(sync + checkin + ad) + 'M\n')
msg += user['name'] + "|" + \
str(sync + checkin + ad) + 'M\n\n'
else:
print(user['name'] + " ---> " + 'cookie失效\n')
msg += user['name'] + "|cookie失效\n\n"
print("-------------------------------------------")
main()
print("\n🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉")
notify.send("有道云笔记", msg)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/AxesJonney/ql.git
git@gitee.com:AxesJonney/ql.git
AxesJonney
ql
自用青龙脚本库
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385