无聊刷日剧,看到签到断了好久,简单写了个脚本,通过模拟抓包的方式实现
0、先登录到字幕组网站获取token
1、用获取到的token登录到人人活动页面获取cookie
2、用获取到的cookie进行签到
import requests
import json
import time
def main():
# 登录,获取用户信息
info = json.loads(get_token())
uid,token = info['data']['uid'],info['data']['token']
# 登录到活动中心,获取cookie
cookies = get_huodong(uid,token)
# 签到
while True:
qiandao(cookies)
time.sleep(10800)
def qiandao(cookies):
headers["Cookie"] = 'PHPSESSID={}'.format(cookies)
info_url = "http://h5.rrhuodong.com/index.php?g=api/mission&m=index&a=user_info"
info = json.loads(get(info_url).text)['data']
print("称昵:{}\n等级:{}\n人人钻:{}\n".format(info['nickname'],info['main_group_name'],info['point'