前言
想白嫖又拍云代金卷,搜了半天没有这个脚本,然后就随便写了一个,代码写的有点垃圾,大佬别喷 能一键签到云海探宝系列日常任务
python写的,需要安装requests库,cmd输入下面命令自动安装
pip install requests
签到代码:
需要填入你得又拍云账号跟密码,还有用户名,用户名在主页查看
import requests
def get_cookie():
login_data = {"username": "账号", "password": "密码"} #输入你的账号跟密码
url = 'https://console.upyun.com/accounts/signin/'
response = requests.post(url, data=login_data)
cookie = response.cookies.get('sid')
return {'Cookie': 'sid=' + cookie} if cookie else {}
def send_post_request(url, headers=None, json_data=None):
response = requests.post(url, headers=headers, json=json_data)
return response.json()
def send_get_request(url):
response = requests.get(url)
return response.json()
def sign_in(cookie):
url = 'https://console.upyun.com/activity/signin'
data = send_post_request(url, headers=cookie)
print('签到:', data.get('msg', '无响应消息'))
def use(cookie):
url = 'https://console.upyun.com/activity/mileage/use'
data = send_post_request(url, headers=cookie)
print('启航:', data.get('msg', '无响应消息'))
print('----------------------')
def tasks():
tasks_url = 'https://console.upyun.com/activity/tasks'
tasks_req = send_get_request(tasks_url)
unlimited = tasks_req.get('unlimited', [])
for unlimi in unlimited:
description = unlimi.get('description', '无描述')
event_id = unlimi.get('event_id', '无事件ID')
print(description)
event(event_id)
def event(event_id):
eval_post = {"event_id": event_id, "accountName": "用户名"} #输入你的用户名,在又拍云主页能看到
eval_token = {'x-token': '7c4ee7db-d67e-4912-b72b-9e2439352716'}
eval_url = 'https://console.upyun.com/activity/tasks'
eval_req = send_post_request(eval_url, headers=eval_token, json_data=eval_post)
print(eval_req)
# 执行主要流程
cookie_value = get_cookie()
if cookie_value:
sign_in(cookie_value)
use(cookie_value)
print('日常任务:\n------------------')
tasks()
else:
print('账号密码输入错误,或cookie获取失败!')
运行效果:
直接宝塔写个定时任务,每天运行签到即可: