活动地址:https://crazy-joy.jd.com/
脚本介绍:
1.python脚本,依赖requests库
2.这次cookie的获取直接使用pc炸年兽的cookie使用的,直接将脚本放在炸年兽的文件夹中即可,读取的是NS_Cookie.NS文件的cookie,也可以直接删除填入自己搞得Cookie
3.脚本可以完成签到,任务和看那个30s视频广告
4.由于一些同学不会py,顺带打包了下exe(PS:python打出来的包较大,不放心的直接用脚本即可)
自测了下没啥问题
[hint]本文资源下载
【免责声明】本订阅号大部分软件和资源收集于网络,只做私下学习和交流使用。所有资源和软件均来自互联网的优秀作者们,版权归原作者或企业所有。我们分享互联网资源和软件,但是不对任何资源和软件负法律责任,所有软件和资源请在您下载后24小时内删除。若作商业用途,请到官方购买正版,由于未及时购买和付费发生的侵权行为,与本订阅号无关,产生的一切后果由使用者自行承担。
1.微信扫下面二维关注公众号 2.后台回复 京东joy 进行下载[/hint]
代码语言:javascript复制import requests
import time
import json
import re
from urllib import parse
import urllib3
urllib3.disable_warnings()
ck = open('NS_Cookie.NS','r')
Cookie = ck.read()
headers = {
'User-Agent': 'jdapp;Mozilla/5.0 (Linux; U; Android 7.0; zh-CN; BAC-TL00 Build/HUAWEIBAC-TL00) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/11.6.4.950 UCBS/2.11.1.28 Mobile Safari/537.36 AliApp(TB/7.3.0.9) WindVane/8.3.0 1080X1812',
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded',
'Origin': 'https://h5.m.jd.com',
'Referer': 'https://h5.m.jd.com/babelDiy/Zeus/3DDunaJMLDamrmGwu73QbqtGtbX1/index.html?babelChannel=ttt5',
'Cookie':Cookie
}
def sign():
url = 'https://api.m.jd.com/?appid=crazy_joy&functionId=crazyJoy_task_doSign&t=%s' % int(round(time.time() * 1000))
try:
res = requests.get(url,headers=headers,verify=False).json()
if res.get('resultCode') == '0':
beans = res.get('data').get('beans')
coins = res.get('data').get('coins')
print('签到成功,获得%s个京豆%s个金币' % (beans,coins))
else:
print(res.get('message'))
except:
print('其他')
def task_list():
url = "https://api.m.jd.com/?body={"paramData":{"taskType":"DAY_TASK"}}&uts=880e9f5baedd9855938c06d5f1aebaa6600ba8bb&appid=crazy_joy&functionId=crazyJoy_task_getTaskState&t=1611376827417"
res = requests.get(url,headers=headers,verify=False).json()
datas = res.get('data')
lists = []
for i in datas:
taskId = i.get('taskId')
status = i.get('status')
taskTitle = i.get('taskTitle')
if status == 0 and taskId != 50:
s = (taskId,taskTitle)
lists.append(s)
if status == 3:
print(taskTitle '任务已完成')
return lists
def renwu():
lists = task_list()
for list1 in lists:
taskId,taskTitle = list1
times = re.findall(r'览(.*?)秒',taskTitle,re.S)
url = 'https://api.m.jd.com/?body={"action":"MARK","taskId":%s}&appid=crazy_joy&functionId=crazyJoy_task_viewPage' % taskId
res = requests.get(url,headers=headers,verify=False).json()
taskRecordId = res.get('data').get('taskRecordId')
sleep_time = int(times[0]) 1
print('[%s]执行中...等待%s秒' % (taskTitle,sleep_time))
time.sleep(sleep_time)
#逛店
url1 = 'https://api.m.jd.com/client.action?functionId=crazyJoy_task_viewPage'
data = {
'appid':'crazy_joy',
'body':'{"taskId":%s,"taskRecordId":"%s","rechargeversion":"8.5","action":"INCREASE"}' % (taskId,taskRecordId),
't':int(round(time.time() * 1000)),
'client':'wh5',
'clientVersion':'1.0.0'
}
try:
res1 = requests.post(url1,headers=headers,data=data, verify=False).json()
if res1.get('resultCode') == '0':
print('[%s]任务完成' % taskTitle)
else:
print(res1.get('message'))
except:
print('其他')
#领取
data1 = {
'body':'{"taskId":%s}' % taskId,
'appid':'crazy_joy',
'functionId':'crazyJoy_task_obtainAward',
't':int(round(time.time() * 1000))
}
data1 = parse.urlencode(data1)
url2 = 'https://api.m.jd.com/?' data1
try:
res2 = requests.get(url2,headers=headers,verify=False).json()
if res2.get('resultCode') == '0':
coins = res2.get('data').get('coins')
print('[%s]任务完成,获得%s金币' % (taskTitle,coins))
else:
print(res2.get('message'))
except:
print('其他')
def get_luckyBoxRecordId():
url = 'https://api.m.jd.com/?appid=crazy_joy&functionId=crazyJoy_joy_produce&t=%s' % int(round(time.time() * 1000))
try:
res = requests.get(url,headers=headers,verify=False).json()
luckyBoxRecordId = res.get('data').get('luckyBoxRecordId')
advertViewTimes = res.get('data').get('advertViewTimes')
return luckyBoxRecordId,advertViewTimes
except:
return None
def LuckyBox_Task():
while True:
luckyBoxRecordId,advertViewTimes = get_luckyBoxRecordId()
if advertViewTimes == 0:
print('观看任务已完成了哦')
break
print('还剩%s次观看次数' % advertViewTimes)
if luckyBoxRecordId != None:
data = {
'appid':'crazy_joy',
'functionId':'crazyJoy_event_getVideoAdvert',
'body':'{"eventType":"LUCKY_BOX_DROP","eventRecordId":"%s","eventPopupClick":0}' % luckyBoxRecordId,
't':int(round(time.time() * 1000))
}
data = parse.urlencode(data)
url = 'https://api.m.jd.com/?' data
try:
res = requests.get(url,headers=headers,verify=False).json()
if res.get('resultCode') == '0':
for x in range(31,-1,-1):
mystr = "获取任务成功,需要等待" str(x) '秒'
print(mystr,end = "")
print("b" * (len(mystr)*2),end = "",flush=True)
time.sleep(1)
data1 = {
'appid':'crazy_joy',
'functionId':'crazyJoy_event_obtainAward',
'body':'{"eventType":"LUCKY_BOX_DROP","eventRecordId":"%s"}' % luckyBoxRecordId,
't':int(round(time.time() * 1000))
}
data1 = parse.urlencode(data1)
url1 = 'https://api.m.jd.com/?' data1
try:
res1 = requests.get(url1,headers=headers,verify=False).json()
if res1.get('resultCode') == '0':
coins = res1.get('data').get('coins')
print('任务已完成,获得了%s个金币' % coins)
else:
print(res1.get('message'))
except:
print('其他1')
else:
print(res.get('message'))
except:
print('其他2')
print('等待5秒继续获取')
time.sleep(5)
sign()
renwu()
LuckyBox_Task()
print(time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(int(time.time()))))
input("搞完了,请按回车键退出")