Ks0727.py.txt

# 变量设置
# export kstoken="" token值
# cookie,salt中间用"|"分隔。只需要值,不填salt=。&或回车,分割多账号,
# export ksjsbCookie="全ck或kuaishou.api_st=xx; did=xx; ud=xx|salt值&全ck或kuaishou.api_st=xx; did=xx; ud=xx|salt值" ud不是必须的
# export isWithdraw # 是否提现 True是 False否 默认 False
# export withdrawType # 优先提现到哪里 wx微信 zfb支付宝 默认wx
# export withdrawMoney # 提现金额设置 最低提现金额限制 默认10 如为0表示不限制 自动选择大于设置值的最大课提现金额
# export fastMode 运行模式 True快速模式 False模拟模式 默认 模拟模式
import copy
sM=None
so=len
sl=True
su=False
sf=str
sY=int
sE=TypeError
sR=type
sQ=round
sK=range
sG=float
sg=reversed
sy=dict
sX=list
sT=Exception
sz=enumerate
iJ=copy.copy
import sys
ix=sys.exit
import time
it=time.sleep
ih=time.time
import requests
si=requests.post
ir=requests.get
iV=requests.session
iC=requests.adapters
import random
sA=random.randint
import logging
sH=logging.error
sc=logging.warning
sP=logging.info
sd=logging.INFO
sa=logging.basicConfig
import os
sU=os.environ
from requests.adapters import HTTPAdapter
i=sU
s=i.get("ksjsbCookie")
A=i.get("kstoken")
atx=i.get("isWithdraw")
d=i.get("withdrawType")
P=i.get('withdrawMoney')
c=i.get('fastMode')
A='' if A is sM else A
H=1 if so(A)==32 else 2 if so(A)==64 else 3
atx=sl if atx=='True' else su
d=2 if d=='zfb' else 1
P=10 if P is not sM else 10
c=sl if c=='True' else su
sa(level=sd,format='%(asctime)s|%(message)s',datefmt='%H:%M:%S')
M=iV()
M.mount('http://',HTTPAdapter(max_retries=5))
M.mount('https://',HTTPAdapter(max_retries=5))
M.keep_alive=su
o=[]
l=''
u={}
f={}
Y=''
E={"cs":"false","client_key":"2ac2a76d","os":"android","kuaishou.api_st":"","uQaTag":"0","token":""}
R=['mod','appver','isp','language','ud','did_tag','egid','thermal','net','kcv','app','kpf','bottom_navigation','ver','oDid','android_os','boardPlatform','kpn','androidApiLevel','newOc','slh','country_code','nbh','hotfix_ver','did_gt','keyconfig_state','sys','max_memory','cold_launch_time_ms','oc','sh','ddpi','deviceBit','browseType','power_mode','socName','is_background','c','sw','ftt','apptype','abi','userRecoBit','device_abi','totalMemory','grant_browse_type','iuid','rdid','sbh','darkMode','did']
Q={'11':2,'161-1':10,'161-2':0,'259':2,'173':10,'253':1,'20':3}
K='''Mozilla/5.0 (Linux; Android 12; Mi 10 Build/SKQ1.220303.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/99.0.4844.88 Mobile Safari/537.36 Yoda/2.8.3-rc1 ksNebula/10.4.10.3430 OS_PRO_BIT/64 MAX_PHY_MEM/7611 AZPREFIX/zw ICFO/0 StatusHT/32 TitleHT/44 NetType/WIFI ISLP/0 ISDM/0 ISLB/0 locale/zh-cn evaSupported/false CT/0 '''
global_headers ={"Connection":"close","User-Agent":K,"content-type":"application/json","Accept":"*/*","Sec-Fetch-Site":"same-origin","Sec-Fetch-Mode":"cors","Sec-Fetch-Dest":"empty","Accept-Encoding":"gzip, deflate","Accept-Language":"zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"}
def iG():
G="https://nebula.kuaishou.com/rest/n/nebula/activity/earn/overview/basicInfo"
g={'User-Agent':K,'Accept':'*/*','Accept-Language':'zh-CN,zh;q=0.9','Cookie':l}
y=M.get(url=G,headers=g,timeout=5).json()
global f
f={'name':sf(y['data']['userData']['nickname']),'cash':sf(y['data']['totalCash']),'coin':sY(y['data']['totalCoin'])}
def ig():
G="https://nebula.kuaishou.com/rest/n/nebula/box/explore?isOpen=true&isReadyOfAdPlay=true"
g={'User-Agent':K,'Accept':'*/*','Accept-Language':'zh-CN,zh;q=0.9','Cookie':l}
y=M.get(url=G,headers=g,timeout=5).json()
X=y['data']['show']
try:
if X:
if y['data']['commonAwardPopup']is not sM:
sP("账号["+f['name']+"]开宝箱获得"+sf(y['data']['commonAwardPopup']['awardAmount'])+"金币")
sP("账号["+f['name']+"]去看宝箱视频")
iW(77,-1,sM)
else:
if y['data']['openTime']==-1:
sP("账号["+f['name']+"]今日开宝箱次数已用完")
else:
sP("账号["+f['name']+"]开宝箱冷却时间还有"+sf(sY(y['data']['openTime']/1000))+"秒")
else:
sP("账号["+f['name']+"]账号获取开宝箱失败:疑似cookies格式不完整")
except sE as reason:
sP("开宝箱出错啦"+sf(reason)+y)
def iy():
G="https://nebula.kuaishou.com/rest/n/nebula/sign/queryPopup"
g={'User-Agent':K,'Accept':'*/*','Accept-Language':'zh-CN,zh;q=0.9','Cookie':l}
y=M.get(url=G,headers=g,timeout=5).json()
T=y['data']['nebulaSignInPopup']['todaySigned']
try:
if T:
sP("账号["+f['name']+"]今日已签到"+y['data']['nebulaSignInPopup']['subTitle']+","+y['data']['nebulaSignInPopup']['title'])
else:
iX()
except sE as reason:
sP("查询签到出错啦"+sf(reason)+y)
def iX():
G="https://nebula.kuaishou.com/rest/n/nebula/sign/sign?source=activity"
g={'User-Agent':K,'Accept':'*/*','Accept-Language':'zh-CN,zh;q=0.9','Cookie':l}
y=M.get(url=G,headers=g,timeout=5).json()
T=y['result']
try:
if T==1:
sP("账号["+f['name']+"]签到成功:"+sf(y['data']['toast']))
sP("账号["+f['name']+"]去看签到视频")
iW(-1,136,sM,9)
sP("账号["+f['name']+"]去翻倍签到1金额")
iW(0,0,'168')
else:
sP("账号["+f['name']+"]签到成功:"+y['error_msg'])
except sE as reason:
sP("查询签到出错啦"+sf(reason)+y)
def iT():
G="https://nebula.kuaishou.com/rest/n/nebula/account/withdraw/setShare"
g={'User-Agent':K,'Accept':'*/*','Accept-Language':'zh-CN,zh;q=0.9','Cookie':l}
z=""
y=M.get(url=G,data=z,headers=g,timeout=5).json()
try:
if y['result']==1:
sP("账号["+f['name']+"]"+"准备分享任务成功,正在执行分享...")
G="https://nebula.kuaishou.com/rest/n/nebula/daily/report?taskId=122"
F=M.get(url=G,headers=g,timeout=5).json()
if F['result']==1:
sP("账号["+f['name']+"]"+"分享任务成功:"+F['data']['msg']+sf(F['data']['amount']))
else:
sP("账号["+f['name']+"]"+"分享任务执行失败:疑似今日已分享."+F['error_msg'])
else:
sP("账号["+f['name']+"]"+"准备分享任务失败:"+y['error_msg'])
except sE as reason:
sP("账号["+f['name']+"]执行任务出错啦"+sf(reason)+F)
def iz(n,task_id):
G='https://nebula.kuaishou.com'+n+'?taskId='+sf(task_id)
g=iJ(global_headers)
g['Cookie']=l
y=M.get(url=G,headers=g,timeout=5).json()
if y['result']==1:
sP("账号["+f['name']+"] "+y['data']['msg'])
def iF():
O={}
for k in R:
O[k]=u[k]
return O
def iW(task_id,event_value,sR,u_qa_tag=sM):
if c:
N=sY(sQ(ih()*1000))
B=N-sA(30000,100000)
it(sA(3,6))
else:
B=sY(sQ(ih()*1000))
it(sA(25,36))
N=sY(sQ(ih()*1000))
q=iJ(E)
if u_qa_tag is not sM:
q['uQaTag']=sf(u_qa_tag)
p=sf(sA(20000001997,22999991997))
b='200'+sf(sA(1000553820678945,8999953820679999))
G="https://api2.e.kuaishou.com/rest/r/ad/nebula/reward"
n='/rest/r/ad/nebula/reward'
if sR is not sM:
G='https://api2.e.kuaishou.com/rest/r/ad/task/report'
n='/rest/r/ad/task/report'
if sR=='gj':
G='https://api2.e.kuaishou.com/rest/r/reward/task/getActivityReward'
n='/rest/r/reward/task/getActivityReward'
q['activityId']='148'
elif sR=='gj2':
G="https://api2.e.kuaishou.com/rest/r/reward/task/status"
n='/rest/r/reward/task/status'
q['activityId']='301'
elif sR=='zb':
G="https://api2.e.kuaishou.com/rest/r/neo/task/info"
n='/rest/r/neo/task/info'
q['from']='2'
q['neoParams']=''
elif sR=='zhibo':
q['bizStr']='{"businessId":75,"endTime":'+sf(N)+',"extParams":"56dfe31594b858e69ef613f5e97227fbd5f9da00aa5144df8830a5781ae07d7cfaf4d95abc2510c950f99404a9e0bf62f5b5765a867c385685e0570ed76b858a159dacd55e41e4a9813db4e619a8b092","mediaScene":"video","neoInfos":[{"creativeId":21876287785,"extInfo":"","llsid":'+b+',"taskType":1},{"creativeId":'+p+',"extInfo":"", "llsid": '+b+',"taskType":6}],"pageId":100012068,"posId":6765,"startTime":'+sf(B)+',"subPageId":100015089}'
elif sR=='161-1':
q['bizStr']='{"businessId":161,"endTime":'+sf(N)+',"extParams":"56dfe31594b858e69ef613f5e97227fbd4ab96cb9fa6000119ec3d6ebf88ee730d3f30cdc1c9029a523453210de5e4922eaf1032a200b76e58f4d1ce8fbb571da3cc6b1f11f37f9adfda67b633b46692","mediaScene":"video","neoInfos":[{"creativeId":'+p+',"extInfo":"","llsid":'+b+',"taskType":1},{"creativeId":'+p+',"extInfo":"", "llsid": '+b+',"taskType":6}],"pageId":11101,"posId":4684,"startTime":'+sf(B)+',"subPageId":100013628}'
elif sR=='161-2':
q['bizStr']='{"businessId":161,"endTime":'+sf(N)+',"extParams":"56dfe31594b858e69ef613f5e97227fbe097a4a092b07f22caafe3f8a466f881c3212b59181e06f9ed9538c157c7e5b0ccffb60e02e288420598440828940ccc3abbfe580c5bf04df66eaf3e58769fd0","mediaScene":"video","neoInfos":[{"creativeId":'+p+',"extInfo":"","llsid":'+b+',"taskType":1},{"creativeId":'+p+',"extInfo":"", "llsid": '+b+',"taskType":6}],"pageId":11101,"posId":4685,"startTime":'+sf(B)+',"subPageId":100013628}'
elif sR=='161-3':
q['bizStr']='{"businessId":161,"endTime":'+sf(N)+',"extParams":"56dfe31594b858e69ef613f5e97227fbe097a4a092b07f22caafe3f8a466f881c3212b59181e06f9ed9538c157c7e5b0ccffb60e02e288420598440828940ccc3abbfe580c5bf04df66eaf3e58769fd0","mediaScene":"video","neoInfos":[{"creativeId":'+p+',"extInfo":"","llsid":'+b+',"taskType":1},{"creativeId":'+p+',"extInfo":"", "llsid": '+b+',"taskType":6}],"pageId":11101,"posId":4685,"startTime":'+sf(B)+',"subPageId":100013630}'
elif sR=='11-1':
q['bizStr']='{"businessId":11,"endTime":'+sf(N)+',"extParams":"56dfe31594b858e69ef613f5e97227fbe097a4a092b07f22caafe3f8a466f881c3212b59181e06f9ed9538c157c7e5b0ccffb60e02e288420598440828940ccc3abbfe580c5bf04df66eaf3e58769fd0","mediaScene":"video","neoInfos":[{"creativeId":'+p+',"extInfo":"","llsid":'+b+',"taskType":1},{"creativeId":'+p+',"extInfo":"", "llsid": '+b+',"taskType":6}],"pageId":11101,"posId":4684,"startTime":'+sf(B)+',"subPageId":100013628}'
elif sR=='11-2':
q['bizStr']='{"businessId":11,"endTime":'+sf(N)+',"extParams":"56dfe31594b858e69ef613f5e97227fbe097a4a092b07f22caafe3f8a466f881c3212b59181e06f9ed9538c157c7e5b0ccffb60e02e288420598440828940ccc3abbfe580c5bf04df66eaf3e58769fd0","mediaScene":"video","neoInfos":[{"creativeId":'+p+',"extInfo":"","llsid":'+b+',"taskType":1},{"creativeId":'+p+',"extInfo":"", "llsid": '+b+',"taskType":6}],"pageId":11101,"posId":4685,"startTime":'+sf(B)+',"subPageId":100013628}'
elif sR=='lott':
q['bizStr']='{"businessId":161,"endTime":'+sf(N)+',"extParams":"56dfe31594b858e69ef613f5e97227fbc7b4adb59060f8b57992dbd5cfdde59d19704f3df5df67acf27d0e98a7b6f0cbbe624cfa294b7d1826d8d2053b164ca92e26340e075bb546a4cab639e79e0936","mediaScene":"video","neoInfos":[{"creativeId":'+p+',"extInfo":"","llsid":'+b+',"taskType":1},{"creativeId":'+p+',"extInfo":"", "llsid": '+b+',"taskType":6}],"pageId":11101,"posId":4685,"startTime":'+sf(B)+',"subPageId":100013630}'
elif sR=='20':
q['bizStr']='{"businessId":161,"endTime":'+sf(N)+',"extParams":"56dfe31594b858e69ef613f5e97227fb80029addcedc57d8114a19aceff4b5a4dbcaa81ee7101dfbc3c475fa19d1a6979c16ac3acaa082cf3690637b103bab58a4b6470802d248e78d563972c0dbc7ad","mediaScene":"video","neoInfos":[{"creativeId":'+p+',"extInfo":"","llsid":'+b+',"taskType":1},{"creativeId":'+p+',"extInfo":"", "llsid": '+b+',"taskType":6}],"pageId":11101,"posId":4684,"startTime":'+sf(B)+',"subPageId":100013629}'
elif sR=='173':
q['bizStr']='{"businessId":173,"endTime":'+sf(N)+',"extParams":"0b47b6a7f33c73ffdd1c3e7c043484fa4b21c13fb34eb2e067516193e75ab04596cd862d731f3b3017ba0704cfcadb0565e64286225fd3a6b027c5d7b8bc1a098b2227dab3bf85f1949172d2e90197f3bac4409224358e690c145ec367b60d31e9eb68ca90b35e920215b1236666fbc11257625cff0dbe87461dc3f1f6d0d46c23e8c5605d10a8bc4face4221cafc77a","mediaScene":"video","neoInfos":[{"creativeId":23799209984,"extInfo":"","llsid":'+b+',"taskType":1},{"creativeId":23799209984,"extInfo":"", "llsid": '+b+',"taskType":6}],"pageId":11101,"posId":5685,"startTime":'+sf(B)+',"subPageId":100014361}'
else:
q['bizStr']='{"businessId":'+sR+',"endTime":'+sf(N)+',"extParams":"56dfe31594b858e69ef613f5e97227fb02f1c8305a022e731b19317aa8b8f1fc4e68b5f6b346e62dade3545f285630556b0fd3c366406646a28bdd7a3889ca5b1bd5be22786fb5f8de8fc684d491e8e0","mediaScene":"video","neoInfos":[{"creativeId":22587646206,"extInfo":"","llsid":'+b+',"taskType":1}],"pageId":11101,"posId":4684,"startTime":'+sf(B)+',"subPageId":100013629}'
else:
q['bizStr']='{"endTime": '+sf(N)+',"eventValue":'+sf(event_value)+',"rewardList":[{"creativeId":'+p+''',"extInfo":"","llsid":'''+b+''',"taskType":1},{"creativeId":'''+p+''',"extInfo":"","llsid": '''+b+',"taskType":6}],"startTime": '+sf(B)+',"taskId": '+sf(task_id)+'} '
q['kuaishou.api_st']=u['kuaishou.api_st']
q['token']=u['kuaishou.api_st']
O=iF()
j=iI(O,q)
k=iv(n,j)
if-1==k:
sc('调用Api失败,跳过本次任务!')
return
g={"Host":"api2.e.kuaishou.com","Connection":"close","Cookie":l,"User-Agent":"kwai-android aegon/3.6.0","Accept-Language":"zh-cn","X-REQUESTID":sf(sY(sQ(ih()*1000))+sA(10000,99999)),"Content-Type":"application/x-www-form-urlencoded","Accept-Encoding":"gzip, deflate, br"}
q['sig']=k['sig']
q['__NS_sig3']=k['sig3']
q['__NStokensig']=k['tokensig']
y=M.post(url=G,headers=g,params=O,data=q,timeout=5).json()
if y['result']==1:
D=0
if sR is not sM:
if sR=='gj':
D=y['data']['amount']
sP("账号["+f['name']+"]逛街获得 "+sf(D)+" 金币")
elif sR=='gj2':
D=y['data']['amount']
sP("账号["+f['name']+"]逛街2获得 "+sf(D)+" 金币")
elif sR=='zb':
D=y['data']['popUp']['title']
sP("账号["+f['name']+"]看直播获得 "+sf(D)+" 金币")
else:
D=y['data']['neoAmount']
sP("账号["+f['name']+"]"+sR+"任务获得 "+sf(D)+" 金币")
else:
D=y['data']['awardAmount']
sP("账号["+f['name']+"]看广告视频获得 "+sf(D)+" 金币")
if D<=10:
return 0
else:
sP("账号["+f['name']+"]任务失败 "+sf(y['message']))
return y['result']
def ie():
G= '''https://nebula.kuaishou.com/rest/n/nebula/activity/earn/overview/tasks?addressBookAccessStatus=false&pushNotificationStatus=true&imei=&idfa=&oaid='''
g=iJ(global_headers)
g['Cookie']=l
y=M.get(url=G,headers=g,timeout=5).json()
I=y["result"]
if I==1:
return y["data"]
else:
sP("账号["+f['name']+"]获取任务列表失败")
def iO():
G="https://activity.e.kuaishou.com/rest/r/game/timer-reward/info"
g=iJ(global_headers)
g['Cookie']=l
y=M.get(url=G,headers=g,timeout=5).json()
if y["result"]==1:
z=y["data"]
m=z["lastTimerTime"]
W=z["serverTime"]
e=z["minutesInterval"]
if W-m>e*1000:
L=im()
if L==1:
sP("账号["+f['name']+"]打开抽奖宝箱,获得 "+sf(z["goldNum"])+" 个金币")
def im():
G="https://activity.e.kuaishou.com/rest/r/game/timer-reward"
g=iJ(global_headers)
g['Cookie']=l
y=M.post(url=G,headers=g,timeout=5).json()
return y["result"]
def iL():
G="https://activity.e.kuaishou.com/rest/r/game/sign-in"
g=iJ(global_headers)
g['Cookie']=l
y=M.get(url=G,headers=g,timeout=5).json()
if y["result"]:
sP("账号["+f['name']+"]抽奖签到成功")
def iN():
G='https://activity.e.kuaishou.com/rest/r/game/user/info'
g=iJ(global_headers)
g['Cookie']=l
y=M.get(url=G,headers=g,timeout=5).json()
if y["result"]==1:
v=y['data']['userDailyLotteryTimesResult']['remainTimes']
for i in sK(0,v):
ip()
def iB():
G="https://activity.e.kuaishou.com/rest/r/game/tasks"
g=iJ(global_headers)
g['Cookie']=l
y=M.get(url=G,headers=g,timeout=5).json()
if y["result"]==1:
w=y["data"]["dailyTasks"]
S=y["data"]["growthTasks"]
for J in w:
if J["taskState"]==1:
iq(J["taskName"])
for J in S:
if J["taskState"]==1:
iq(J["taskName"])
else:
sP("账号["+f['name']+"]获取任务列表失败")
def iq(task_name):
G="https://activity.e.kuaishou.com/rest/r/game/task/reward-receive"
g=iJ(global_headers)
g['Cookie']=l
y=M.get(url=G,headers=g,params={"taskName":task_name},timeout=5).json()
try:
if y["result"]==1:
sP("账号["+f['name']+"]抽奖任务获得 "+y["data"]["popUp"]["taskRewardName"])
except sE as e:
sP(y)
sP("账号["+f['name']+"]抽奖内任务失败")
def ip():
G="https://activity.e.kuaishou.com/rest/r/game/lottery?wheelVersion=2"
g=iJ(global_headers)
g['Cookie']=l
L=M.post(url=G,headers=g,timeout=5).json()
if L["result"]==1:
if L["data"]["popUpStyle"]==1:
sP("账号["+f['name']+"]抽奖成功获得金币 "+sf(L["data"]["coinCount"])+" 个")
elif L["data"]["popUpStyle"]==2:
sP("账号["+f['name']+"]抽奖成功获得钻石 "+sf(L["data"]["diamondCount"])+" 个")
elif L["data"]["popUpStyle"]==0:
sP("账号["+f['name']+"]抽奖机会已用完!")
iB()
else:
sP("账号["+f['name']+"]抽奖请求失败!")
def ib():
G='https://nebula.kuaishou.com/rest/n/nebula/account/withdraw'
g=iJ(global_headers)
g['Cookie']=l
y=M.get(url=G,headers=g,timeout=5).json()
if y['result']==1:
if y['data']:
if y['data']['isLimitCash']:
sP("账号["+f['name']+"] "+y['data']['cashExchangeLimitToast'])
else:
x=sG(y['data']['enWithdrawAmount'])
h=y['data']['withdrawList']
for t in sg(h):
C=t['amountYuan']
if x>=C:
if C<P:
sP("账号["+f['name']+"]可提现 "+sf(C)+"元,小于设置值"+sf(P)+'元,跳过提现')
break
sP("账号["+f['name']+"]去提现 "+sf(C)+"元")
ij(C*100,t['bizContent'])
break
def ij(fen,biz_content):
V=iD()
r=''
if V['code']=='SUCCESS':
iA=V['wechat_bind']
ia=V['alipay_bind']
if iA&d==1:
r='WECHAT'
elif ia:
r='ALIPAY'
G='https://www.kuaishoupay.com/pay/account/h5/withdraw/apply'
g=iJ(global_headers)
g['Cookie']=l
g['Content-Type']='application/x-www-form-urlencoded'
if r!='':
z={'account_group_key':'NEBULA_CASH_ACCOUNT','mobile_code':'','fen':fen,'provider':r,'total_fen':fen,'commission_fen':'0','third_account':r,'attach':'','biz_content':biz_content,'session_id':'','bank_id':'','pop_window_types':''}
y=M.post(url=G,headers=g,data=z,timeout=5).json()
sP("账号["+f['name']+"]"+y['msg'])
if y['code']=='SUCCESS':
it(1)
ik(y['link_page_url'])
elif y['code']=='WITHDRAW_VERIFY_SMS_CODE':
sP("账号["+f['name']+"]提现需要验证手机号!")
def ik(n):
sp=n.split('?')
G='https://www.kuaishoupay.com/pay/account/h5/withdraw/result'
g=iJ(global_headers)
g['Cookie']=l
g['Content-Type']='application/x-www-form-urlencoded'
z={'account_group_key':'','account_withdraw_no':''}
for da in sp[1].split['=']:
if da[0]=='accountGroupKey':
z['account_group_key']=da[1]
if da[0]=='orderNo':
z['account_withdraw_no']=da[1]
y=M.post(url=G,headers=g,data=z,timeout=5).json()
sP(y)
if y['code']=='SUCCESS':
iP=y['withdraw_progress']
ic=iP[so(iP)-1]
sP("账号["+f['name']+"]"+ic['progress_node_name'])
def iD():
G='https://www.kuaishoupay.com/pay/account/h5/provider/bind_info'
g=iJ(global_headers)
g['Cookie']=l
g['Content-Type']='application/x-www-form-urlencoded'
iH={'account_group_key':'NEBULA_CASH_ACCOUNT','bind_page_type':'3'}
y=M.post(url=G,headers=g,data=iH,timeout=5).json()
return y
def iI(str1:sy,str2:sy):
sX=[]
for k,v in str1.items():
sX.append(k+'='+v)
for k,v in str2.items():
sX.append(k+'='+v)
sX.sort()
iU=''
for i in sX:
iU+=i
return iU
def iv(n,iM):
G="http://ks.ltdzh.com/api/getSig1"
iM={'url':n,'body':iM,'type':H,'client_salt':Y}
g={"Connection":"close",'token':A}
for i in sK(1,5):
try:
y=M.post(url=G,json=iM,headers=g,timeout=5).json()
if y["code"]==200:
io=y['data']['signum']
if io==0:
sP('没有剩余调用Api次数,即将退出!')
ix()
else:
return y["data"]
else:
sP('调用Api失败,尝试第'+sf(i+1)+'次调用!')
it(5)
except sT as e:
sP('调用Api失败,尝试第'+sf(i+1)+'次调用!')
it(5)
sP('调用Api失败,不再尝试调用!')
return-1
def iw():
G="http://ks.ltdzh.com/api/getApiNum"
iM={'type':H}
g={"Connection":"close",'token':A}
for i in sK(1,5):
try:
y=M.post(url=G,json=iM,headers=g,timeout=5).json()
if y["code"]==200:
return y["data"]
else:
sP('获取Api剩余次数失败,尝试第'+sf(i+1)+'次获取!')
it(5)
except sT as e:
sP('获取Api剩余次数失败,尝试第'+sf(i+1)+'次获取!')
it(5)
sP('获取Api剩余次数失败!不再尝试获取。')
return-1
def iS():
iy()
ig()
il=ie()
for J in il['dailyTasks']:
if J['id']==17:
sP('账号['+f['name']+']任务['+J['name']+']完成情况'+sf(J['completedStages'])+'/'+sf(J['stages']))
if J['completedStages']<J['stages']:
iW(0,-1,sM)
if J['id']==148:
sP('账号['+f['name']+']任务['+J['name']+']完成情况'+sf(J['completedStages'])+'/'+sf(J['stages']))
if J['completedStages']<J['stages']:
iW(0,0,'gj')
if J['id']==161:
sP('账号['+f['name']+']任务['+J['name']+']完成情况'+sf(J['completedStages'])+'/'+sf(J['stages']))
if J['completedStages']<J['stages']:
iL()
try:
iO()
except sE as reason:
sP('账号['+f['name']+']抽奖宝箱错误!')
iW(0,0,'163-3')
iN()
iB()
if J['id']==34:
sP('账号['+f['name']+']任务['+J['name']+']完成情况'+sf(J['completedStages'])+'/'+sf(J['stages']))
if J['completedStages']<J['stages']:
try:
iW(0,0,'zb',9)
except sE:
a=1
iW(0,0,'zhibo')
if J['id']==177:
sP('账号['+f['name']+']任务['+J['name']+']完成情况'+sf(J['desc']))
if '点击翻倍' in J['linkText']:
iz(J['linkUrl'],J['id'])
if atx:
try:
ib()
except:
sP('账号['+f['name']+']提现出错')
for tp in Q.keys():
try:
v=Q[tp]
for i in sK(0,v):
L=iW(0,0,tp)
if L!=1:
sP('账号['+f['name']+']任务'+tp+'金币小于10或出错,本次运行跳过该任务')
break
except sE:
sP('账号['+f['name']+']任务'+tp+'错误')
if __name__=='__main__':
sP('===================脚本配置=====================')
sP('运行模式: %s','快速模式' if c else '模拟模式')
sP('是否自动提现: %s','是' if atx else '否')
if atx:
sP('优先提现到: %s','微信' if d==1 else '支付宝')
sP('最低提现金额: %d',P)
sP('==============================================')
o=[]
if s is sM:
sP('没有填写变量ksjsbCookie')
ix()
if A=='':
sP('没有填写变量kstoken')
ix()
if '&' in s:
o=s.split('&')
elif '\n' in s:
o=s.split('\n')
else:
o.append(s)
sP("================共发现 "+sf(so(o))+" 个账号===============")
for i,ck in sz(o):
sP("-----------开始第 "+sf(i+1)+" 个账号------------")
if '|' not in ck:
sP('第'+sf(i+1)+'个账号ck格式错误!')
sP('ck跟salt请用"|"隔开,如 kuaishou.api_st=xx;did=xx|salt')
break
iu=ck.split('|')
l=iu[0]
Y=iu[1]
iY=l.split(';')
if not l.startswith('kpn'):
for iE in iY:
kv=iE.split('=')
k=kv[0].strip()
if k=='kuaishou.api_st' or k=='did' or k=='ud':
u[k]=kv[1].strip()
if 'kuaishou.api_st' not in u:
sH('第'+sf(i+1)+'个账号ck格式错误!没有发现kuaishou.api_st')
break
if 'did' not in u:
sH('第'+sf(i+1)+'个账号ck格式错误!没有发现did')
break
if 'ud' not in u:
u['ud']='0'
if 'egid' not in u:
u['egid']='DFP8E053D864EE0'+sf(sA(100000,999999))+'E793AC38D7E643F46C9BB44B370864D1D21BD50169D'
l='kpn=NEBULA; kpf=ANDROID_PHONE;c=XIAOMI; ver=10.5; appver=10.5.31.3825; cold_launch_time_ms='+sf(sY(sQ(ih()*1000)))+'; egid='+u['egid']+'; thermal=10000; client_key=2ac2a76d; ud='+u['ud']+'; language=zh-cn; countryCode=CN; sys=ANDROID_9; mod=Xiaomi%28MI+6%29; net=WIFI; deviceName=Xiaomi%28MI+6%29; isp=; did_tag=7;kcv=1458; app=0; bottom_navigation=true; android_os=0; boardPlatform=msm8998; androidApiLevel=28; newOc=XIAOMI; slh=0; country_code=cn; nbh=0; hotfix_ver=; did_gt=1652302313321; keyconfig_state=2; max_memory=256; oc=XIAOMI; sh=1920; app_status=3; ddpi=480; deviceBit=0; browseType=3; power_mode=0; socName=Qualcomm+MSM8998; sw=1080; ftt=; apptype=22; abi=arm64; cl=0; userRecoBit=0; device_abi=arm64; totalMemory=5724; grant_browse_type=AUTHORIZED; iuid=; rdid=${$.didi}; sbh=72; darkMode=false; kuaishou.api_st='+u['kuaishou.api_st']+'; kuaishou.h5_st='+u['kuaishou.api_st']+'; is_background=0; did='+u['did']+'; oDid=TEST_'+u['did']+''
iY=l.split(';')
for iE in iY:
kv=iE.split('=')
u[kv[0].strip()]=kv[1].strip()
try:
iG()
except sE as e:
sc('第'+sf(i+1)+'个账号获取账号信息失败,疑似ck错误!')
continue
sP('账号['+f['name']+']现金: '+sf(f['cash'])+' 金币: '+sf(f['coin']))
iS()
iR=f['coin']
iG()
iQ=f['coin']
sP('账号['+f['name']+']本次运行共获得 '+sf(iQ-iR)+' 个金币')
iK=iw()
if iK!=-1:
sP('调用Api剩余 '+sf(iK['signum'])+' 次')
# Created by pyminifier (https://github.com/liftoff/pyminifier)

1 Download (24 KB)