1 Star 0 Fork 0

冷心/Thread

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
jd_phoneDiscount.py 25.27 KB
一键复制 编辑 原始数据 按行查看 历史
gys619 提交于 2023-01-11 18:11 . up
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
File: jd_phoneDiscount.py(手机折上折抽奖)
Author: HarbourJ
Date: 2022/12/29 20:00
TG: https://t.me/HarbourToulu
cron: 1 1 1 1 1 1
new Env('手机折上折抽奖');
活动入口: https://sjtx-dz.isvjcloud.com/phone_discount/?invite_id=63ad1171068bd98098&source=test&baseInfo=LM6HIKdH%2Cbrand_two
"""
import time, requests, sys, re, os, json, random
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
from functools import partial
print = partial(print, flush=True)
try:
from jd_sign import *
except ImportError as e:
print(e)
if "No module" in str(e):
print("请先运行Faker库依赖一键安装脚本(jd_check_dependent.py),安装jd_sign.so依赖")
sys.exit()
try:
from jdCookie import get_cookies
getCk = get_cookies()
except:
print("请先下载依赖脚本,\n下载链接: https://raw.githubusercontent.com/HarbourJ/HarbourToulu/main/jdCookie.py")
sys.exit(3)
redis_url = os.environ.get("redis_url") if os.environ.get("redis_url") else "172.17.0.1"
redis_port = os.environ.get("redis_port") if os.environ.get("redis_port") else "6379"
redis_pwd = os.environ.get("redis_pwd") if os.environ.get("redis_pwd") else ""
baseInfo = os.environ.get("baseInfo") if os.environ.get("baseInfo") else ""
if not baseInfo:
print('未设置export baseInfo="品牌编号",默认运行第九个任务brand_ten')
baseInfo = "8AHIKfsi%2Cbrand_ten"
else:
if baseInfo == "1":
baseInfo = "HXu94GdF%2Cbrand_one"
elif baseInfo == "2":
baseInfo = "LM6HIKdH%2Cbrand_two"
elif baseInfo == "3":
baseInfo = "KmwM4N4L%2Cbrand_three"
elif baseInfo == "4":
baseInfo = "8pTg6fXi%2Cbrand_four"
elif baseInfo == "5":
baseInfo = "Sr5zisvb%2Cbrand_five"
elif baseInfo == "6":
baseInfo = "B0cRJYyC%2Cbrand_six"
elif baseInfo == "7":
baseInfo = "ZRco56US%2Cbrand_seven"
elif baseInfo == "8":
baseInfo = "4tqyLzac%2Cbrand_eight"
elif baseInfo == "9":
baseInfo = "PIZ1W0ap%2Cbrand_nine"
elif baseInfo == "10":
baseInfo = "8AHIKfsi%2Cbrand_ten"
elif baseInfo == "11":
baseInfo = "zvNssjdW%2Cbrand_eleven"
else:
print('export baseInfo="品牌编号"设置有误,默认运行第九个任务brand_ten')
baseInfo = "8AHIKfsi%2Cbrand_ten"
appKey = baseInfo.split('%2C')[0]
brand = baseInfo.split('%2C')[1]
activity_url = f"https://sjtx-dz.isvjcloud.com/phone_discount/?invite_id=63ad1171068bd98098&source=test&baseInfo={baseInfo}"
print(f"【🛳活动入口】{activity_url}")
def redis_conn():
try:
import redis
try:
pool = redis.ConnectionPool(host=redis_url, port=redis_port, decode_responses=True, socket_connect_timeout=5, password=redis_pwd)
r = redis.Redis(connection_pool=pool)
r.get('conn_test')
print('✅redis连接成功')
return r
except:
print("⚠️redis连接异常")
except:
print("⚠️缺少redis依赖,请运行pip3 install redis")
sys.exit()
def getToken(ck, r=None):
host = f'{activityUrl.split("com/")[0]}com'
try:
pt_pin = unquote_plus(re.compile(r'pt_pin=(.*?);').findall(ck)[0])
except:
pt_pin = ck[:15]
try:
try:
Token = r.get(f'{activityUrl.split("https://")[1].split("-")[0]}_{pt_pin}')
except Exception as e:
Token = None
if Token is not None:
print(f"♻️获取缓存Token")
return Token
else:
s.headers = {
'Connection': 'keep-alive',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'User-Agent': '',
'Cookie': ck,
'Host': 'api.m.jd.com',
'Referer': '',
'Accept-Language': 'zh-Hans-CN;q=1 en-CN;q=0.9',
'Accept': '*/*'
}
sign({"url": f"{host}", "id": ""}, 'isvObfuscator')
f = s.post('https://api.m.jd.com/client.action', verify=False, timeout=30)
if f.status_code != 200:
print(f.status_code)
return
else:
if "参数异常" in f.text:
print(f.text)
return
Token_new = f.json()['token']
try:
if r.set(f'{activityUrl.split("https://")[1].split("-")[0]}_{pt_pin}', Token_new, ex=1800):
print("✅Token缓存成功")
else:
print("❌Token缓存失败")
except Exception as e:
print(f"✅获取实时Token")
return Token_new
except Exception as e:
print(f"Token error: {str(e)}")
return
def getJdTime():
url = "http://api.m.jd.com/client.action?functionId=queryMaterialProducts&client=wh5"
headers = {
'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-CN,zh;q=0.9',
'Host': 'api.m.jd.com',
'Proxy-Connection': 'keep-alive',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36'
}
try:
response = requests.request("GET", url, headers=headers, timeout=2)
if response.status_code == 200:
res = response.json()
jdTime = res['currentTime2']
except:
jdTime = int(round(time.time() * 1000))
return jdTime
def randomString(e, flag=False):
t = "0123456789abcdef"
if flag: t = t.upper()
n = [random.choice(t) for _ in range(e)]
return ''.join(n)
def refresh_cookies(res):
if res.cookies:
cookies = res.cookies.get_dict()
set_cookie = [(set_cookie + "=" + cookies[set_cookie]) for set_cookie in cookies]
global activityCookie
activityCookieMid = [i for i in activityCookie.split(';') if i != '']
for i in activityCookieMid:
for x in set_cookie:
if i.split('=')[0] == x.split('=')[0]:
if i.split('=')[1] != x.split('=')[1]:
activityCookieMid.remove(i)
activityCookie = ''.join(
sorted([(set_cookie + ";") for set_cookie in list(set(activityCookieMid + set_cookie))]))
# print("刷新cookie", activityCookie)
def getActivity():
url = activityUrl
headers = {
'Host': 'sjtx-dz.isvjcloud.com',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'User-Agent': ua,
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Connection': 'keep-alive',
'Referer': activityUrl,
'Cookie': f'IsvToen={token}'
}
response = requests.request("GET", url, headers=headers)
if response.status_code == 200:
return
else:
print(response.status_code)
print("⚠️疑似ip黑了")
sys.exit()
def getAuth():
url = f"https://sjtx-dz.isvjcloud.com/auth/jos?token={token}&jd_source=01&source=test&is_share=1"
headers = {
'Host': 'sjtx-dz.isvjcloud.com',
'Accept': 'application/json, text/plain, */*',
'App-Key': appKey,
'brand': brand,
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/json',
'Origin': 'https://sjtx-dz.isvjcloud.com',
'User-Agent': ua,
'Referer': activityUrl,
'Connection': 'keep-alive'
}
response = requests.request("POST", url, headers=headers)
res = response.json()
if res['status'] == 0:
return res['body']['access_token']
else:
print(f"⚠️{res}")
def getUserInfo(authToken):
url = "https://sjtx-dz.isvjcloud.com/phone-discount-api/get_user_info?source=test&is_share=1"
headers = {
'Host': 'sjtx-dz.isvjcloud.com',
'Accept': 'application/json, text/plain, */*',
'App-Key': appKey,
'Authorization': f'Bearer {authToken}',
'brand': brand,
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/json',
'User-Agent': ua,
'Referer': activityUrl,
'Connection': 'keep-alive'
}
response = requests.request("GET", url, headers=headers)
res = response.json()
try:
code = res['code']
is_acvite_complete = res['is_acvite_complete']
user_click_invite = res['user_click_invite']
is_invite_complete = res['is_invite_complete']
user_new = res['user_new']
return code, is_acvite_complete, user_click_invite, is_invite_complete, user_new
except:
print(res)
def getFriendList(authToken):
url = "https://sjtx-dz.isvjcloud.com/phone-discount-api/get_friend_list?source=test&is_share=1"
headers = {
'Host': 'sjtx-dz.isvjcloud.com',
'Accept': 'application/json, text/plain, */*',
'App-Key': appKey,
'Authorization': f'Bearer {authToken}',
'brand': brand,
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/json',
'User-Agent': ua,
'Referer': activityUrl,
'Connection': 'keep-alive'
}
response = requests.request("GET", url, headers=headers)
res = response.json()
# print("getFriendList:", res)
try:
friendList = res['friend_list']
except Exception as e:
print(f"getFriendList Error: {str(e)}")
friendList = []
return friendList
def inviteFriend(inviter_id, authToken):
url = "https://sjtx-dz.isvjcloud.com/phone-discount-api/invite_friend?source=test&is_share=1"
payload = '{"inviter_id":"' + inviter_id + '","channel":2}'
headers = {
'Host': 'sjtx-dz.isvjcloud.com',
'Accept': 'application/json, text/plain, */*',
'App-Key': appKey,
'Authorization': f'Bearer {authToken}',
'brand': brand,
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/json',
'Origin': 'https://sjtx-dz.isvjcloud.com',
'User-Agent': ua,
'Referer': activityUrl,
'Connection': 'keep-alive'
}
response = requests.request("POST", url, headers=headers, data=payload)
res = response.json()
return res
def invite(authToken):
url = f"https://sjtx-dz.isvjcloud.com/burying/stat?action=invite&source=test&is_share=1"
headers = {
'Host': 'sjtx-dz.isvjcloud.com',
'Accept': 'application/json, text/plain, */*',
'App-Key': appKey,
'Authorization': f'Bearer {authToken}',
'brand': brand,
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/json',
'Origin': 'https://sjtx-dz.isvjcloud.com',
'User-Agent': ua,
'Referer': activityUrl,
'Connection': 'keep-alive'
}
response = requests.request("POST", url, headers=headers)
res = response.json()
return res
def inviteFriendNew(inviter_id, authToken):
url = "https://sjtx-dz.isvjcloud.com/phone-discount-api/invite_friend_new?source=test&is_share=1"
payload = '{"inviter_id":"' + inviter_id + '","channel":2}'
headers = {
'Host': 'sjtx-dz.isvjcloud.com',
'Accept': 'application/json, text/plain, */*',
'App-Key': appKey,
'Authorization': f'Bearer {authToken}',
'brand': brand,
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/json',
'Origin': 'https://sjtx-dz.isvjcloud.com',
'User-Agent': ua,
'Referer': activityUrl,
'Connection': 'keep-alive'
}
response = requests.request("POST", url, headers=headers, data=payload)
res = response.json()
return res
def clickHomeGetPrize(authToken):
url = f"https://sjtx-dz.isvjcloud.com/burying/stat?action=click_home_get_prize&source=test&is_share=1"
headers = {
'Host': 'sjtx-dz.isvjcloud.com',
'Accept': 'application/json, text/plain, */*',
'App-Key': appKey,
'Authorization': f'Bearer {authToken}',
'brand': brand,
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/json',
'Origin': 'https://sjtx-dz.isvjcloud.com',
'User-Agent': ua,
'Referer': activityUrl,
'Connection': 'keep-alive'
}
response = requests.request("POST", url, headers=headers)
res = response.json()
return res
def clickEffectGetPrize(authToken):
url = f"https://sjtx-dz.isvjcloud.com/burying/stat?action=click_effect_get_prize&source=test&is_share=1"
headers = {
'Host': 'sjtx-dz.isvjcloud.com',
'Accept': 'application/json, text/plain, */*',
'App-Key': appKey,
'Authorization': f'Bearer {authToken}',
'brand': brand,
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/json',
'Origin': 'https://sjtx-dz.isvjcloud.com',
'User-Agent': ua,
'Referer': activityUrl,
'Connection': 'keep-alive'
}
response = requests.request("POST", url, headers=headers)
res = response.json()
return res
def homeSendPrizes(authToken):
url = f"https://sjtx-dz.isvjcloud.com/phone-discount-api/home_send_prizes?source=test&is_share=1"
headers = {
'Host': 'sjtx-dz.isvjcloud.com',
'Accept': 'application/json, text/plain, */*',
'App-Key': appKey,
'Authorization': f'Bearer {authToken}',
'brand': brand,
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/json',
'Origin': 'https://sjtx-dz.isvjcloud.com',
'User-Agent': ua,
'Referer': activityUrl,
'Connection': 'keep-alive'
}
response = requests.request("POST", url, headers=headers)
res = response.json()
return res
def clickCouponSenPrize(authToken):
url = f"https://sjtx-dz.isvjcloud.com/burying/stat?action=click_coupon_send_prize&source=test&is_share=1"
headers = {
'Host': 'sjtx-dz.isvjcloud.com',
'Accept': 'application/json, text/plain, */*',
'App-Key': appKey,
'Authorization': f'Bearer {authToken}',
'brand': brand,
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/json',
'Origin': 'https://sjtx-dz.isvjcloud.com',
'User-Agent': ua,
'Referer': activityUrl,
'Connection': 'keep-alive'
}
response = requests.request("POST", url, headers=headers)
res = response.json()
return res
def userClickInvite(authToken):
url = f"https://sjtx-dz.isvjcloud.com/phone-discount-api/user_click_invite?source=test&is_share=1"
headers = {
'Host': 'sjtx-dz.isvjcloud.com',
'Accept': 'application/json, text/plain, */*',
'App-Key': appKey,
'Authorization': f'Bearer {authToken}',
'brand': brand,
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/json',
'Origin': 'https://sjtx-dz.isvjcloud.com',
'User-Agent': ua,
'Referer': activityUrl,
'Connection': 'keep-alive'
}
requests.request("POST", url, headers=headers)
def inviteDrawPrize(invite_type, authToken):
url = "https://sjtx-dz.isvjcloud.com/phone-discount-api/invite_draw_prize?source=test&is_share=1"
payload = '{"invite_type":' + invite_type + '}'
headers = {
'Host': 'sjtx-dz.isvjcloud.com',
'Accept': 'application/json, text/plain, */*',
'App-Key': appKey,
'Authorization': f'Bearer {authToken}',
'brand': brand,
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/json',
'Origin': 'https://sjtx-dz.isvjcloud.com',
'User-Agent': ua,
'Referer': activityUrl,
'Connection': 'keep-alive'
}
response = requests.request("POST", url, headers=headers, data=payload)
res = response.json()
return res
if __name__ == '__main__':
r = redis_conn()
try:
cks = getCk
if not cks:
sys.exit()
except:
print("未获取到有效COOKIE,退出程序!")
sys.exit()
global shareUuid, inviteSuccNum, activityUrl, firstCk, allCookies
inviteSuccNum = 0
try:
shareUuid = remote_redis(brand, 1)
if not shareUuid:
shareUuid = "63ad1171068bd98098"
except:
shareUuid = "63ad1171068bd98098"
activityUrl = f"https://sjtx-dz.isvjcloud.com/phone_discount/?invite_id={shareUuid}&source=test&baseInfo={baseInfo}"
allCookies = cks
num = 0
for cookie in allCookies:
num += 1
if num == 1:
firstCk = cookie
if num % 6 == 0:
print("⏰等待3s,休息一下")
time.sleep(3)
global ua, activityCookie, token
ua = userAgent()
try:
pt_pin = re.compile(r'pt_pin=(.*?);').findall(cookie)[0]
pt_pin = unquote_plus(pt_pin)
except IndexError:
pt_pin = re.compile(r'pin=(.*?);').findall(cookie)[0]
pt_pin = unquote_plus(pt_pin)
print(f'\n******开始【京东账号{num}{pt_pin} *********\n')
print(datetime.now())
token = None
token = getToken(cookie, r)
if token is None:
if num == 1:
print(f"⚠️车头获取Token失败,退出本程序!")
sys.exit()
print(f"⚠️获取Token失败!⏰等待3s")
time.sleep(3)
continue
time.sleep(0.3)
getActivity()
time.sleep(0.2)
authToken = getAuth()
if not authToken:
if num == 1:
print("‼️车头为火爆号,换车头重新运行!")
sys.exit()
else:
print("📝移除火爆账号")
allCKs.remove()
time.sleep(1.5)
continue
time.sleep(0.2)
userInfo = getUserInfo(authToken)
if not userInfo:
if num == 1:
sys.exit()
else:
time.sleep(1.5)
continue
shareUuid1 = userInfo[0]
print(f"🤖助力码: {shareUuid1}")
is_acvite_complete = userInfo[1]
user_new = userInfo[4]
time.sleep(0.2)
if num == 1:
inviteSuccNum = len(getFriendList(authToken))
print(f"🧑‍🤝‍🧑CK1已邀请{inviteSuccNum}人")
if inviteSuccNum >= 10:
for i in range(2):
invite_type = i + 1
print(f"开始第{invite_type}次抽奖")
drawPrize = inviteDrawPrize(str(invite_type), authToken)
try:
if "prize_info" not in drawPrize:
print(drawPrize['message'])
else:
prize_info = f"{drawPrize['prize_info']['user_prize']['prize_name']} {drawPrize['prize_info']['user_prize']['prize_info']['quota']}"
print(f"🎁抽奖获得:{prize_info}")
except:
print(f"抽奖结果: {drawPrize}")
sys.exit()
time.sleep(0.2)
if user_new == 1: # 新用户
invite(authToken)
time.sleep(0.2)
inviteNewInfo = inviteFriendNew(shareUuid, authToken)
if "prize_info" in inviteNewInfo:
prize_info = [f"{x['user_prize']['prize_name']}{x['user_prize']['prize_info']['quota']}个" for x in inviteNewInfo['prize_info']]
if prize_info:
print(f"🎁获得{','.join(prize_info)}")
else:
print("来晚了没水了💨💨💨")
inviteSuccNum += 1
print(f"🎉助力成功!已邀请{inviteSuccNum}人")
else:
print(inviteNewInfo['message'])
clickHomeGetPrize(authToken)
time.sleep(0.2)
clickEffectGetPrize(authToken)
time.sleep(0.2)
homePrizes = homeSendPrizes(authToken)
if "prize_info" in homePrizes:
prize_info = [f"{x['user_prize']['prize_name']}{x['user_prize']['prize_info']['quota']}个" for x in homePrizes['prize_info']]
print(f"🎁获得{','.join(prize_info)}")
else:
print(homePrizes)
time.sleep(0.2)
userClickInvite(authToken)
if inviteSuccNum >= 10:
token = getToken(firstCk, r)
time.sleep(0.2)
getActivity()
time.sleep(0.2)
authToken0 = getAuth()
time.sleep(0.2)
getUserInfo(authToken0)
time.sleep(0.2)
for i in range(2):
invite_type = i + 1
print(f"开始第{invite_type}次抽奖")
drawPrize0 = inviteDrawPrize(str(invite_type), authToken0)
try:
if "prize_info" not in drawPrize0:
print(drawPrize0['message'])
else:
prize_info = f"{drawPrize0['prize_info']['user_prize']['prize_name']}{drawPrize0['prize_info']['user_prize']['prize_info']['quota']}"
print(f"🎁抽奖获得:{prize_info}")
except:
print(drawPrize0)
sys.exit()
else:
inviteInfo = inviteFriend(shareUuid, authToken)
if "prize_info" not in inviteInfo:
print(inviteInfo['message'])
if "已达到好友邀请上限" in inviteInfo['message']:
if num == 1:
shareUuid = shareUuid1
activityUrl = f"https://sjtx-dz.isvjcloud.com/phone_discount/?invite_id={shareUuid}&source=test&baseInfo={baseInfo}"
print(f"🤖后面的号全部助力: {shareUuid}")
continue
else:
token = getToken(firstCk, r)
time.sleep(0.2)
getActivity()
time.sleep(0.2)
authToken0 = getAuth()
time.sleep(0.2)
getUserInfo(authToken0)
time.sleep(0.2)
for i in range(2):
invite_type = i + 1
print(f"开始第{invite_type}次抽奖")
drawPrize0 = inviteDrawPrize(str(invite_type), authToken0)
try:
if "prize_info" not in drawPrize0:
print(drawPrize0['message'])
else:
prize_info = f"{drawPrize0['prize_info']['user_prize']['prize_name']}{drawPrize0['prize_info']['user_prize']['prize_info']['quota']}"
print(f"🎁抽奖获得:{prize_info}")
except:
print(drawPrize0)
sys.exit()
else:
inviteSuccNum += 1
print(f"🎉助力成功!已邀请{inviteSuccNum}人")
prize_info = [f"{x['user_prize']['prize_name']}{x['user_prize']['prize_info']['quota']}个" for x in inviteInfo['prize_info']]
print(f"🎁获得{','.join(prize_info)}")
if inviteSuccNum >= 10:
token = getToken(firstCk, r)
time.sleep(0.2)
getActivity()
time.sleep(0.2)
authToken0 = getAuth()
time.sleep(0.2)
getUserInfo(authToken0)
time.sleep(0.2)
for i in range(2):
invite_type = i + 1
print(f"开始第{invite_type}次抽奖")
drawPrize0 = inviteDrawPrize(str(invite_type), authToken0)
try:
if "prize_info" not in drawPrize0:
print(drawPrize0['message'])
else:
prize_info = f"{drawPrize0['prize_info']['user_prize']['prize_name']}{drawPrize0['prize_info']['user_prize']['prize_info']['quota']}"
print(f"🎁抽奖获得:{prize_info}")
except:
print(drawPrize0)
sys.exit()
if num == 1:
shareUuid = shareUuid1
activityUrl = f"https://sjtx-dz.isvjcloud.com/phone_discount/?invite_id={shareUuid}&source=test&baseInfo={baseInfo}"
print(f"🤖后面的号全部助力: {shareUuid}")
time.sleep(2)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/lengxin/Thread.git
git@gitee.com:lengxin/Thread.git
lengxin
Thread
Thread
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385