王者荣耀王者营地腾讯云函数每日签到配置教程
本帖最后由 xiaohaiguai 于 2021-4-10 16:51 编辑2021-03-06:
此代码非原创,来源网络,此贴仅分享如何配置。
注:签到的营地币可以兑换东西,签到的天数累计有宝箱,适合懒人使用。
https://attach.52pojie.cn//forum/202103/06/100643htlvlffx6wvw8ow1.jpg?lhttps://attach.52pojie.cn//forum/202103/06/100639no6syjpj1b6k3yfb.jpg?l
1、下载HttpCanary软件(https://anmuxi.lanzouj.com/iPYb2mko0lc),在设置里面安装根证书,并设置目标应用为王者营地(防止获取到其他软件数据)。
https://attach.52pojie.cn//forum/202103/06/094302emxuxh0bexqi9k7m.jpg?lhttps://attach.52pojie.cn//forum/202103/06/094309pug4ghukkjj6hh66.jpg?l
2、打开王者营地并登录,选择“我-每日福利”页面,切换到HttpCanary右下角小箭头按钮开始抓包,再切换到王者营地每日福利页面点击签到,然后返回HttpCanary暂停抓包,找到这一项POST https://ssl.kohsocial.qq.com/......,复制Raw选项的最后appVersion.....这一段。
https://attach.52pojie.cn//forum/202103/06/094654h912xx4brxti9sxu.png?lhttps://attach.52pojie.cn//forum/202103/06/094803h4u77bsrvp3zru1a.jpg?l
3、打开腾讯云函数服务,新建自定义函数,默认Python3.6就可以了,复制以下代码进去,并在下方高级配置设置超时时间为60,其它默认即可。
https://attach.52pojie.cn//forum/202103/06/095354lgqqpgvooj6qzql3.png?lhttps://attach.52pojie.cn//forum/202103/06/100251op4u2lu4279c5zli.png?l
# -*- coding: utf8 -*-
import requests
import re
# 酷推sckey留空则不推送
sckey = ''
# 签到 请求体
data_str = ''
def run(data_str):
data_str = re.sub(r'&', '\n', data_str)
content = re.findall(r'(.*?)=(.*)', data_str)
data = {}
for i in content:
key = i
value = i
data = value
url = 'https://ssl.kohsocialapp.qq.com:10001/play/h5sign'
r = requests.post(url=url, data=data)
if r.json()['result'] == 0:
msg = '签到成功'
else:
msg = r.json()['returnMsg']
if sckey != '':
url_ = f'https://push.xuthus.cc/send/{sckey}?c={msg}'
requests.get(url_)
return msg
def main_handler(event, context):
return run(data_str)
4、将HttpCanary复制的那一段请求体复制到代码data_str = ''的单引号里,然后在云函数下面部署并测试,结果如下,是已经签到过的(刚刚配置的时候签到了),说明配置成功了(默认酷推,其它推送请自行修改)。
https://attach.52pojie.cn//forum/202103/06/095928ls3223ss2cns3l3x.png?l
5、可以在触发管理里面这样配置,即可每日自动签到,填入【0 0 10 * * * *】即为每日10点签到。
https://attach.52pojie.cn//forum/202103/06/100101auvp9vluvuyjssjr.png?l
教程至此完成,第一次发教程贴,如有问题请评论区指正,感谢支持。{:1_919:}{:1_919:}{:1_919:}
# -*- coding: utf8 -*-
import re, requests, time
from random import randint
# 处理账号参数 浏览点赞任务
idlist = []
dict0 = {
'gameOpenId': '',
'gameRoleId': '',
'gameServerId': '',
'token': '',
'userId': ''
}
dict1 = {
'gameOpenId': '',
'gameRoleId': '',
'gameServerId': '',
'token': '',
'userId': ''
}
idlist.append(dict0)
idlist.append(dict1)
# 领取奖励参数
idlist1 = []
dict2 = {
'serverId': '',
'roleId': '',
'userId': '',
'gameOpenid': '',
'openid': '',
'msdkToken': '',
'appOpenid': '',
'timestamp': '',
'sig': '',
'msdkEncodeParam': ''
}
dict3 = {
'serverId': '',
'roleId': '',
'userId': '',
'gameOpenid': '',
'openid': '',
'msdkToken': '',
'appOpenid': '',
'timestamp': '',
'sig': '',
'msdkEncodeParam': ''
}
idlist1.append(dict2)
idlist1.append(dict3)
# 请求str转dict
def strtodict(str):
str = re.sub(r'&', '\n', str)
content = re.findall(r'(.*?)=(.*)', str)
data = {}
for i in content:
key = i
value = i
data = value
return data
# 获取首页资讯
def get_zixun(dict):
url = 'https://ssl.kohsocialapp.qq.com:10001/info/listinfo'
data_str = ''
data = strtodict(data_str)
data.update(dict)
data['rRand'] = str(int(time.time() * 1000))
r = requests.post(url, data=data)
for i in range(2, 8):
try:
# print(r.text)
iInfoId = r.json()['data']['list']['iInfoId']
algoType = r.json()['data']['list']['algoType']
docid = r.json()['data']['list']['docid']
print(iInfoId, algoType)
get_liulan(dict, i, iInfoId, algoType)
time.sleep(randint(1, 3))
get_dianzan(dict, docid, iInfoId)
except:
msg = f'第{str(i)}次获取文章参数失败'
print(msg)
return msg
msg = '任务完成'
return msg
# print(data)
# 浏览资讯
def get_liulan(dict, pos, iInfoId, algoType):
url = 'https://ssl.kohsocialapp.qq.com:10001/game/detailinfov3'
data_str = ''
data = strtodict(data_str)
data.update(dict)
data['rRand'] = str(int(time.time() * 1000))
data['pos'] = pos
data['iInfoId'] = iInfoId
data['algoType'] = algoType
requests.post(url, data=data)
# 点赞
def get_dianzan(dict, docid, iInfoId):
url = 'https://ssl.kohsocialapp.qq.com:10001/user/addlike'
data_str = ''
data = strtodict(data_str)
data.update(dict)
data['rRand'] = str(int(time.time() * 1000))
data['docid'] = docid
data['iInfoId'] = iInfoId
# print(data)
r = requests.post(url, data=data)
# print(r.text)
if r.json()['data']['like'] == True:
print('点赞成功')
# 领取浏览奖励
def get_liulan_lq(dict):
url = 'https://ssl.kohsocialapp.qq.com:10001/play/h5taskgetgift'
data_str = ''
data = strtodict(data_str)
data.update(dict)
# data['timestamp'] = str(int(time.time() * 1000))
data['taskId'] = '2019071900007'
r = requests.post(url, data=data)
# print(r.text)
try:
if r.json()['result'] == 0:
msg = '浏览奖励领取成功'
else:
msg = r.json()['returnMsg']
except:
msg = '请求失败,请检查接口'
return msg
# 领取点赞奖励
def get_dianzan_lq(dict):
url = 'https://ssl.kohsocialapp.qq.com:10001/play/h5taskgetgift'
data_str = ''
data = strtodict(data_str)
data.update(dict)
# data['timestamp'] = str(int(time.time() * 1000))
data['taskId'] = '2019071900008'
r = requests.post(url, data=data)
# print(r.text)
try:
if r.json()['result'] == 0:
msg = '点赞奖励领取成功'
else:
msg = r.json()['returnMsg']
except:
msg = '请求失败,请检查接口'
return msg
# 签到
def qiandao(dict):
url = 'https://ssl.kohsocialapp.qq.com:10001/play/h5sign'
data_str = ''
data = strtodict(data_str)
data.update(dict)
# data['timestamp'] = str(int(time.time() * 1000))
r = requests.post(url, data=data)
try:
if r.json()['result'] == 0:
msg = '签到成功'
else:
msg = r.json()['returnMsg']
except:
msg = '请求失败,请检查接口'
# print(data['serverId']+ ':'+msg)
return msg
def main_handler(event, context):
n = 1
msg = ''
today = int(time.strftime("%w"))
if today == 2:
for i in idlist:
get_zixun(i)
msg_r = f'{str(n)}号,任务完成'
msg = msg + msg_r + '\n'
n += 1
time.sleep(randint(2, 5))
for i in idlist1:
if today == 2:
msg_r = get_dianzan_lq(i)
msg = msg + msg_r + '\t'
time.sleep(randint(1, 3))
msg_r = get_liulan_lq(i)
msg = msg + msg_r + '\t'
time.sleep(randint(1, 3))
msg_r = qiandao(i)
msg = msg + msg_r + '\n'
return msg
修改了下楼主源码,添加了每周浏览的任务 支持多账号
请求参数自行根据url地址抓包
请求参数直接填到对应的data_str中
账号的参数填到ditc里,默认弄了俩账号的 ,有多个的自己copy加一下
没有接消息提醒,有需要的自己接入
云函数超时时间设置长一些,代码里面有延时
最近学的python,大神勿喷
{:301_998:} 顾安 发表于 2021-3-11 15:44
# -*- coding: utf8 -*-
import re, requests, time
有没有可能模拟从营地登录王者和微信分享 刹那光华 发表于 2021-3-31 17:25
大佬能分享一下获取token的思路或者登录吗
微信和QQ不同的我找到的areaId appid两个参数
测试不同设备 ...
msdkEncodeParam反编译可以找到算法
msdkToken才是能不能登录的关键 好高深的样子 感谢!!! 凑币买改名卡 干得漂亮 楼主不说我都不知道还有这个云函数可以玩。。。 a327111 发表于 2021-3-6 10:23
好高深的样子
简简单单的做法 离人心上秋意浓 发表于 2021-3-6 10:24
感谢!!! 凑币买改名卡
哈哈,我改名卡二三十张了都 浪洗乾坤 发表于 2021-3-6 10:28
干得漂亮 楼主不说我都不知道还有这个云函数可以玩。。。
懒人操作比较多,可以在论坛多找找 感谢分享 同王者中毒用户,还有其他懒人操作了吗? 我有一个掌火签到{:301_986:}https://tva4.sinaimg.cn/mw690/d3dde9a5ly1go9zpqqkgwj20u01uoaj3.jpg