Alipay-wufu.exe(額外福卡)是一款支付寶全自動(dòng)領(lǐng)取額外53張?ㄎ甯V郑Ц秾毬(lián)合其他52個(gè)產(chǎn)品推出送五福的活動(dòng),用pyhton簡單寫了一個(gè)自動(dòng)連續(xù)領(lǐng)取的程序,只需要每隔60s把手機(jī)的驗(yàn)證碼輸入即可。
軟件注意:
連續(xù)獲取60(2月3日,根據(jù)大家的情況反映,支付寶已經(jīng)把風(fēng)控?cái)?shù)量調(diào)整到10個(gè)驗(yàn)證碼左右,24小時(shí)后解除風(fēng)控)個(gè)支付寶驗(yàn)證碼則會(huì)被風(fēng)控,24小時(shí)內(nèi)無法繼續(xù)獲取驗(yàn)證碼,請(qǐng)按照需求獲取。
使用說明:
首先輸入要領(lǐng)取的站點(diǎn)開始的序號(hào),總共53個(gè)站點(diǎn)可以領(lǐng)取
每隔60s會(huì)自動(dòng)切換到下個(gè)站點(diǎn)進(jìn)行領(lǐng)取,已經(jīng)領(lǐng)取成功的,會(huì)進(jìn)行記錄,下次程序運(yùn)行時(shí)將忽略領(lǐng)取成功的站點(diǎn)
如果要換手機(jī)號(hào)領(lǐng)取,需要重新解壓這個(gè)壓縮包,把success.json覆蓋掉,不然會(huì)因?yàn)樯蟼(gè)手機(jī)號(hào)領(lǐng)取成功的站點(diǎn)而進(jìn)行跳過。
注意:支付寶此活動(dòng)不能連續(xù)獲得60(2月3日,根據(jù)大家的情況反映,支付寶已經(jīng)把風(fēng)控?cái)?shù)量調(diào)整到10個(gè)驗(yàn)證碼左右,24小時(shí)后解除風(fēng)控)個(gè)驗(yàn)證碼,否則24小時(shí)內(nèi)無法再參加此次活動(dòng)!
程序暫無GUI頁面,先湊合著用把。site.json和success.json必須和程序在一個(gè)目錄,否則程序會(huì)閃退!
因?yàn)榇虬h(huán)境是64位的,所以程序不支持32位操作系統(tǒng)。
因?yàn)榇舜沃Ц秾毼甯榱俗尨蠹医粨Q卡,每人獲得除了敬業(yè)福之外的隨機(jī)兩種福的概率是最大的,所以一般會(huì)大量開出兩種福,這是正,F(xiàn)象。
代碼說明:
很多人想要檢查一下代碼的安全性,其實(shí)沒有在程序中加殼,直接反編譯即可看到了。有人如果有人想要改進(jìn)的話直接改就可以了哦。
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":"人氣太旺了,請(qǐng)稍后再試","success":true}})'
# print(re.text)
re_json = self.loads_jsonp(re.text)
if re_json['result']['success'] == True:
return {"code": 1000, "info": f'成功獲取驗(yàn)證碼,請(qǐng)注意查收'}
else:
resultView = re_json['result']['resultView']
return {"code": 1001, "info": f'獲取驗(yàn)證碼失敗,原因?yàn)閧resultView}'}
except Exception as e:
return {"code": 1001, "info": f'獲取驗(yàn)證碼失敗,原因?yàn)?{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":"已經(jīng)領(lǐng)取過獎(jiǎng)品","success":false}})
# print(re.text)
re_json = self.loads_jsonp(re.text)
if re_json['result']['success'] == True:
return {"code": 1000, "info": f'成功領(lǐng)取'}
else:
resultView = re_json['result']['resultView']
return {"code": 1001, "info": f'領(lǐng)取失敗,原因?yàn)?{resultView}'}
except Exception as e:
return {"code": 1001, "info": f'領(lǐng)取失敗,原因?yàn)?{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"站點(diǎn)的長度為{length},{num}已經(jīng)超出這個(gè)長度")
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()}個(gè)站點(diǎn)可以領(lǐng)取福卡")
for i in range(1, webRequests.getSiteNum()+1):
siteInfo = webRequests.getSiteInfo(i)
siteName = webRequests.getSiteName(siteInfo)
print(f"{i}:{siteName}")
startSite = int(input("您要從第幾個(gè)站點(diǎn)開始向后領(lǐng)?"))
mobile = input("請(qǐng)輸入您的手機(jī)號(hào):")
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} 已經(jīng)成功領(lǐng)取,跳過")
continue
print(f"{i}:{siteName} 正在領(lǐng)取中")
result = webRequests.getCaptcha(mobile, siteSource)
print(result['info'])
if result['code'] == 1001:
if str(result['info']).find("驗(yàn)證碼發(fā)送過頻繁") != -1:
print("驗(yàn)證碼需等待60s后才能獲取,正在等待..")
time.sleep(60)
result = webRequests.getCaptcha(mobile, siteSource)
if str(result['info']).find("人氣太旺啦,稍候再試試") != -1:
print("您的手機(jī)號(hào)在近期已經(jīng)獲得了多次支付寶驗(yàn)證碼,已被支付寶限制,24小時(shí)內(nèi)無法再獲得驗(yàn)證碼,程序終止。")
break
elif str(result['info']).find("人氣太旺啦,稍候再試試") == -1 and str(result['info']).find("驗(yàn)證碼發(fā)送過頻繁") == -1:
continue
ackCode = input("請(qǐng)輸入驗(yàn)證碼:")
result = webRequests.getResult(mobile, siteSource, ackCode)
print(result['info'])
if result['code'] == 1000 or result['info'].find("已經(jīng)領(lǐng)取過獎(jiǎng)品") != -1:
webRequests.addSuccessSite(siteInfo)
print("驗(yàn)證碼需等待60s后才能獲取,正在等待..")
time.sleep(60)
input("程序已結(jié)束,您可以關(guān)閉此程序了")
if __name__ == '__main__':
path = os.path.dirname(os.path.realpath(sys.argv[0]))
main(path)