微博超话签到★百度贴吧签到★小米运动刷步数★恩山签到★雨云签到白嫖服务器★小茅预约★丽宝乐园小程序签到★天翼云盘签到★腾讯视频签到(会员领成长值)★阿里云盘签到★GW树洞机场签到★富贵论坛签到★一点万向签到打卡★什么值得买达人和关键词取消关注★STLXZ签到★PT站签到★帆软签到+摇摇乐★千图网签到★星空代理签到★什么值得买签到★值得买每日抽奖★小米社区签到★逑美在线app签到和抽卡★ddnsto自动续费七天★爱奇艺签到刷时长★双色球预测(娱乐)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
3.0 KiB

#!/usr/bin/python3
# -- coding: utf-8 --
# @Time : 2023/4/8 10:23
# -------------------------------
# cron "30 5 * * *" script-path=xxx.py,tag=匹配cron用
# const $ = new Env('阿里云盘签到');
import json
import requests
import os
##变量export ali_refresh_token=''
ali_refresh_token=os.getenv("ali_refresh_token").split('&')
#refresh_token是一成不变的呢,我们使用它来更新签到需要的access_token
#refresh_token获取教程:https://github.com/bighammer-link/Common-scripts/wiki/%E9%98%BF%E9%87%8C%E4%BA%91%E7%9B%98refresh_token%E8%8E%B7%E5%8F%96%E6%96%B9%E6%B3%95
# ali_refresh_token = os.getenv("ali_refresh_token")
# 推送加
plustoken = os.getenv("plustoken")
#推送函数
def Push(contents):
# 推送加
headers = {'Content-Type': 'application/json'}
json = {"token": plustoken, 'title': 'aliyun签到', '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+推送失败')
#签到函数
for i in range(len(ali_refresh_token)):
print(f'开始帐号{i+1}签到')
def daily_check(access_token):
url = 'https://member.aliyundrive.com/v1/activity/sign_in_list'
headers = {
'Authorization': access_token
}
response = requests.post(url=url, headers=headers, json={}).text
result = json.loads(response)
if 'success' in result:
print('签到成功')
for i, j in enumerate(result['result']['signInLogs']):
if j['status'] == 'miss':
day_json = result['result']['signInLogs'][i-1]
# print(day_json)
if not day_json['isReward']:
contents = '签到成功,今日未获得奖励'
else:
contents = '本月累计签到{}天,今日签到获得{}{}'.format(result['result']['signInCount'],
day_json['reward']['name'],
day_json['reward']['description'])
print(contents)
return contents
# 使用refresh_token更新access_token
def update_token(refresh_token):
url = 'https://auth.aliyundrive.com/v2/account/token'
data = {
'grant_type': 'refresh_token',
'refresh_token': ali_refresh_token[i]
}
response = requests.post(url=url, json=data).json()
access_token = response['access_token']
# print('获取的access_token为{}'.format(access_token))
return access_token
def mian():
# print('更新access_token')
access_token = update_token(ali_refresh_token)
# print('更新成功,开始进行签到')
content = daily_check(access_token)
if plustoken != '':
Push(content)
if __name__ == '__main__':
mian()