Alipay-wufu.exe(~⸣)һ֧ȫԄI(lng)ȡ~53帣֧(lin)52a(chn)ƷƳ帣ĻpyhtonΌһԄBm(x)I(lng)ȡijֻҪÿ60s֙CCaݔ뼴
ܛע⣺
Bm(x)@ȡ6023(j)ҵrӳ֧ѽ(jng)Lؔ(sh){(dio)10Caң24СrLأ֧CatL24Сr(ni)o^m(x)@ȡCaՈ@
ʹf
ݔҪI(lng)ȡվc_ʼ̖53վcI(lng)ȡ
ÿ60sԄГQվcMI(lng)ȡѽ(jng)I(lng)ȡɹMӛ´γ\ЕrI(lng)ȡɹվc
ҪQ֙C̖I(lng)ȡҪ½≺@ssuccess.jsonwȻς֙C̖I(lng)ȡɹվcM^
ע⣺֧˻ӲBm(x)@6023(j)ҵrӳ֧ѽ(jng)Lؔ(sh){(dio)10Caң24СrLأCat24Сr(ni)oمӴ˴λ
oGUIȜðsite.jsonsuccess.json횺ͳһĿ䛣tW
h(hun)64λԳ֧32λϵy(tng)
˴֧帣ҽQÿ˫@ó˾I(y)֮SCɷNĸһ_ɷN@F(xin)
af
ܶҪzһ´aİȫԣ䌍]ڳмӚֱӷgɿҪMԒֱӸľͿŶ
import requests
import os
import codecs
import sys
import time
import json
import re
class WebRequests:
def __init__(self):
self.dirPath = ''
self.getCaptchaUrl = 'https://rds.alipay.com/captcha.htm'
self.getResultUrl = 'https://mobilegw.alipay.com/mgw.htm'
self.operationType = {
'sendVerifyCode': 'alipay.tradecsa.biz.blessingprod.wufu2021.sendVerifyCode',
'outPrize': 'alipay.tradecsa.biz.blessingprod.wufu2021.outPrize'
}
self.s = requests.Session()
self.headers = {
'User-Agent': 'Mozilla/5.0 (Linux; U; Android 10; zh-CN; MI 9 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 Quark/4.3.3.145 Mobile Safari/537.36 Edg/89.0.4389.6',
'DNT': '1'
}
def loads_jsonp(self, _jsonp):
try:
return json.loads(re.match(".*?({.*}).*", _jsonp, re.S).group(1))
except:
raise ValueError('Invalid Input')
def getCaptcha(self, mobile, source):
digits = 32
hex = codecs.encode(os.urandom(digits), 'hex').decode()
data = {
'appid': "blessingprod_wufu_otp",
'bizNo': hex,
'mobile': mobile,
'refer': "",
'scene': "DO_NOTHING",
'type': "silence",
'useragent': "Mozilla/5.0 (Linux; U; Android 10; zh-CN; MI 8 UD Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 Quark/4.3.3.145 Mobile Safari/537.36 Edg/89.0.4389.6"
}
self.s.options(self.getCaptchaUrl)
try:
r = self.s.post(self.getCaptchaUrl, json=data,
headers=self.headers)
# print(r.text)
rdsToken = json.loads(r.content)['data']['extra']['token']
requestData = [{"mobile": mobile, "source": source,
"rdsBizNo": hex, "rdsToken": rdsToken}]
getResultData = {
'_fli_online': True,
'operationType': self.operationType['sendVerifyCode'],
'requestData': str(requestData),
'_': int(round(time.time() * 1000)),
'callback': 'jsonp' + str(int(round(time.time() * 1000)))
}
re = self.s.get(self.getResultUrl,
params=getResultData, headers=self.headers)
# 'jsonp16121({"resultStatus":1000,"result":{"code":"5101","resultView":"˚̫ˣՈԺԇ","success":true}})'
# print(re.text)
re_json = self.loads_jsonp(re.text)
if re_json['result']['success'] == True:
return {"code": 1000, "info": f'ɹ@ȡCaՈע'}
else:
resultView = re_json['result']['resultView']
return {"code": 1001, "info": f'@ȡCaʧԭ{resultView}'}
except Exception as e:
return {"code": 1001, "info": f'@ȡCaʧԭ {e}'}
def getResult(self, mobile, source, ackCode):
requestData = [
{"mobile": mobile, "source": source, "ackCode": str(ackCode)}]
getResultData = {
'_fli_online': True,
'operationType': self.operationType['outPrize'],
'requestData': str(requestData),
'_': int(round(time.time() * 1000)),
'callback': 'jsonp' + str(int(round(time.time() * 1000)))
}
try:
re = self.s.get(self.getResultUrl,
params=getResultData, headers=self.headers)
# jsonp16121({"resultStatus":1000,"result":{"code":"50144","hasPrized":false,"hasUserId":false,"resultView":"ѽ(jng)I(lng)ȡ^Ʒ","success":false}})
# print(re.text)
re_json = self.loads_jsonp(re.text)
if re_json['result']['success'] == True:
return {"code": 1000, "info": f'ɹI(lng)ȡ'}
else:
resultView = re_json['result']['resultView']
return {"code": 1001, "info": f'I(lng)ȡʧԭ {resultView}'}
except Exception as e:
return {"code": 1001, "info": f'I(lng)ȡʧԭ {e}'}
def getSiteNum(self):
path = os.path.join(self.dirPath, "site.json")
with open(path, 'r', encoding='utf8')as fp:
json_data = json.load(fp)
return len(json_data['channelList'])
def getSiteInfo(self, num):
path = os.path.join(self.dirPath, "site.json")
with open(path, 'r', encoding='utf8')as fp:
json_data = json.load(fp)
length = len(json_data['channelList'])
if num > length:
print(f"վcLȞ{length}{num}ѽ(jng)@L")
return None
return json_data['channelList'][num-1]
def getAllSiteInfo(self):
path = os.path.join(self.dirPath, "site.json")
with open(path, 'r', encoding='utf8')as fp:
json_data = json.load(fp)
return json_data['channelList']
def getSiteName(self, siteInfo):
return siteInfo['sourceList'][0]['name']
def getSiteSource(self, siteInfo):
return siteInfo['sourceList'][0]['source']
def addSuccessSite(self, siteInfo):
path = os.path.join(self.dirPath, "success.json")
add = self.isSuccessSite(siteInfo)
if add == False:
with open(path, 'r+', encoding='utf8')as fp:
json_data = json.load(fp)
with open(path, 'w', encoding='utf8')as fp:
json_data['channelList'].append(siteInfo)
fp.write(json.dumps(json_data, indent=4))
def isSuccessSite(self, siteInfo):
path = os.path.join(self.dirPath, "success.json")
with open(path, 'r+', encoding='utf8')as fp:
json_data = json.load(fp)
if siteInfo in list(json_data['channelList']):
return True
else:
return False
def main(path):
webRequests = WebRequests()
webRequests.dirPath = path
print(f"{webRequests.getSiteNum()}վcI(lng)ȡ")
for i in range(1, webRequests.getSiteNum()+1):
siteInfo = webRequests.getSiteInfo(i)
siteName = webRequests.getSiteName(siteInfo)
print(f"{i}{siteName}")
startSite = int(input("Ҫĵڎׂվc_ʼI(lng)"))
mobile = input("Ոݔ֙C̖:")
for i in range(startSite, webRequests.getSiteNum()+1):
siteInfo = webRequests.getSiteInfo(i)
siteName = webRequests.getSiteName(siteInfo)
siteSource = webRequests.getSiteSource(siteInfo)
if webRequests.isSuccessSite(siteInfo):
print(f"{i}{siteName} ѽ(jng)ɹI(lng)ȡ^")
continue
print(f"{i}{siteName} I(lng)ȡ")
result = webRequests.getCaptcha(mobile, siteSource)
print(result['info'])
if result['code'] == 1001:
if str(result['info']).find("Cal(f)^l") != -1:
print("Caȴ60sܫ@ȡڵȴ..")
time.sleep(60)
result = webRequests.getCaptcha(mobile, siteSource)
if str(result['info']).find("˚̫Ժԇԇ") != -1:
print("֙C̖ڽѽ(jng)@˶֧Caѱ֧24Сr(ni)o٫@CaKֹ")
break
elif str(result['info']).find("˚̫Ժԇԇ") == -1 and str(result['info']).find("Cal(f)^l") == -1:
continue
ackCode = input("ՈݔCa")
result = webRequests.getResult(mobile, siteSource, ackCode)
print(result['info'])
if result['code'] == 1000 or result['info'].find("ѽ(jng)I(lng)ȡ^Ʒ") != -1:
webRequests.addSuccessSite(siteInfo)
print("Caȴ60sܫ@ȡڵȴ..")
time.sleep(60)
input("ѽY(ji)P(gun)]˳")
if __name__ == '__main__':
path = os.path.dirname(os.path.realpath(sys.argv[0]))
main(path)