mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-05-07 03:48:44 +08:00
update
This commit is contained in:
parent
6138ef1ebc
commit
a4bdd9819c
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#依赖安装,运行一次就好
|
#依赖安装,运行一次就好
|
||||||
#1 1 1 1 1 jd_indeps.sh
|
#1 1 1 1 1 jd_indeps.sh
|
||||||
#new Env('依赖安装');
|
#new Env('Faker库脚本依赖安装');
|
||||||
#
|
#
|
||||||
|
|
||||||
npm_ver=`pnpm -v|awk -F. '{print $1}'`
|
npm_ver=`pnpm -v|awk -F. '{print $1}'`
|
||||||
@ -17,6 +17,7 @@ echo -e "开始安装............\n"
|
|||||||
apk add g++ make --no-cache
|
apk add g++ make --no-cache
|
||||||
pnpm config set registry https://registry.npm.taobao.org
|
pnpm config set registry https://registry.npm.taobao.org
|
||||||
pnpm install -g
|
pnpm install -g
|
||||||
|
pnpm install -g ds
|
||||||
pnpm install -g png-js
|
pnpm install -g png-js
|
||||||
pnpm install -g date-fns
|
pnpm install -g date-fns
|
||||||
pnpm install -g axios@0.27.2
|
pnpm install -g axios@0.27.2
|
||||||
@ -28,6 +29,7 @@ pnpm install -g request
|
|||||||
pnpm install -g jsdom
|
pnpm install -g jsdom
|
||||||
pnpm install -g moment
|
pnpm install -g moment
|
||||||
pnpm install -g tough-cookie
|
pnpm install -g tough-cookie
|
||||||
|
pnpm install -g https-proxy-agent
|
||||||
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ jieba
|
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ jieba
|
||||||
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ requests
|
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ requests
|
||||||
rm -rf /usr/local/pnpm-global/5/node_modules/.pnpm/canvas*
|
rm -rf /usr/local/pnpm-global/5/node_modules/.pnpm/canvas*
|
||||||
|
@ -36,8 +36,34 @@ except:
|
|||||||
redis_url = os.environ.get("redis_url") if os.environ.get("redis_url") else "172.17.0.1"
|
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_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 ""
|
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 ""
|
||||||
|
|
||||||
activity_url = f"https://sjtx-dz.isvjcloud.com/phone_discount/?invite_id=63ad1171068bd98098&source=test&baseInfo=LM6HIKdH%2Cbrand_two"
|
if not baseInfo:
|
||||||
|
print('未设置export baseInfo="品牌编号",默认运行第二个任务brand_two')
|
||||||
|
baseInfo = "LM6HIKdH%2Cbrand_two"
|
||||||
|
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"
|
||||||
|
else:
|
||||||
|
print('export baseInfo="品牌编号"设置有误,默认运行第二个任务brand_two')
|
||||||
|
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}")
|
print(f"【🛳活动入口】{activity_url}")
|
||||||
|
|
||||||
def redis_conn():
|
def redis_conn():
|
||||||
@ -169,8 +195,8 @@ def getAuth():
|
|||||||
headers = {
|
headers = {
|
||||||
'Host': 'sjtx-dz.isvjcloud.com',
|
'Host': 'sjtx-dz.isvjcloud.com',
|
||||||
'Accept': 'application/json, text/plain, */*',
|
'Accept': 'application/json, text/plain, */*',
|
||||||
'App-Key': 'LM6HIKdH',
|
'App-Key': appKey,
|
||||||
'brand': 'brand_two',
|
'brand': brand,
|
||||||
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
|
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@ -191,9 +217,9 @@ def getUserInfo(authToken):
|
|||||||
headers = {
|
headers = {
|
||||||
'Host': 'sjtx-dz.isvjcloud.com',
|
'Host': 'sjtx-dz.isvjcloud.com',
|
||||||
'Accept': 'application/json, text/plain, */*',
|
'Accept': 'application/json, text/plain, */*',
|
||||||
'App-Key': 'LM6HIKdH',
|
'App-Key': appKey,
|
||||||
'Authorization': f'Bearer {authToken}',
|
'Authorization': f'Bearer {authToken}',
|
||||||
'brand': 'brand_two',
|
'brand': brand,
|
||||||
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
|
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@ -215,9 +241,9 @@ def getFriendList(authToken):
|
|||||||
headers = {
|
headers = {
|
||||||
'Host': 'sjtx-dz.isvjcloud.com',
|
'Host': 'sjtx-dz.isvjcloud.com',
|
||||||
'Accept': 'application/json, text/plain, */*',
|
'Accept': 'application/json, text/plain, */*',
|
||||||
'App-Key': 'LM6HIKdH',
|
'App-Key': appKey,
|
||||||
'Authorization': f'Bearer {authToken}',
|
'Authorization': f'Bearer {authToken}',
|
||||||
'brand': 'brand_two',
|
'brand': brand,
|
||||||
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
|
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@ -241,9 +267,9 @@ def inviteFriend(inviter_id, authToken):
|
|||||||
headers = {
|
headers = {
|
||||||
'Host': 'sjtx-dz.isvjcloud.com',
|
'Host': 'sjtx-dz.isvjcloud.com',
|
||||||
'Accept': 'application/json, text/plain, */*',
|
'Accept': 'application/json, text/plain, */*',
|
||||||
'App-Key': 'LM6HIKdH',
|
'App-Key': appKey,
|
||||||
'Authorization': f'Bearer {authToken}',
|
'Authorization': f'Bearer {authToken}',
|
||||||
'brand': 'brand_two',
|
'brand': brand,
|
||||||
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
|
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@ -262,9 +288,9 @@ def inviteDrawPrize(invite_type, authToken):
|
|||||||
headers = {
|
headers = {
|
||||||
'Host': 'sjtx-dz.isvjcloud.com',
|
'Host': 'sjtx-dz.isvjcloud.com',
|
||||||
'Accept': 'application/json, text/plain, */*',
|
'Accept': 'application/json, text/plain, */*',
|
||||||
'App-Key': 'LM6HIKdH',
|
'App-Key': appKey,
|
||||||
'Authorization': f'Bearer {authToken}',
|
'Authorization': f'Bearer {authToken}',
|
||||||
'brand': 'brand_two',
|
'brand': brand,
|
||||||
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
|
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@ -290,10 +316,10 @@ if __name__ == '__main__':
|
|||||||
global shareUuid, inviteSuccNum, activityUrl, firstCk
|
global shareUuid, inviteSuccNum, activityUrl, firstCk
|
||||||
inviteSuccNum = 0
|
inviteSuccNum = 0
|
||||||
try:
|
try:
|
||||||
shareUuid = remote_redis(f"sjtx", 1)
|
shareUuid = remote_redis(brand, 1)
|
||||||
except:
|
except:
|
||||||
shareUuid = "63ad1171068bd98098"
|
shareUuid = "63ad1171068bd98098"
|
||||||
activityUrl = f"https://sjtx-dz.isvjcloud.com/phone_discount/?invite_id={shareUuid}&source=test&baseInfo=LM6HIKdH%2Cbrand_two"
|
activityUrl = f"https://sjtx-dz.isvjcloud.com/phone_discount/?invite_id={shareUuid}&source=test&baseInfo={baseInfo}"
|
||||||
|
|
||||||
num = 0
|
num = 0
|
||||||
for cookie in cks[:]:
|
for cookie in cks[:]:
|
||||||
@ -362,7 +388,31 @@ if __name__ == '__main__':
|
|||||||
inviteInfo = inviteFriend(shareUuid, authToken)
|
inviteInfo = inviteFriend(shareUuid, authToken)
|
||||||
if "prize_info" not in inviteInfo:
|
if "prize_info" not in inviteInfo:
|
||||||
print(inviteInfo['message'])
|
print(inviteInfo['message'])
|
||||||
pass
|
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)
|
||||||
|
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}")
|
||||||
|
sys.exit()
|
||||||
else:
|
else:
|
||||||
inviteSuccNum += 1
|
inviteSuccNum += 1
|
||||||
print(f"🎉助力成功!已邀请{inviteSuccNum}人")
|
print(f"🎉助力成功!已邀请{inviteSuccNum}人")
|
||||||
@ -389,7 +439,7 @@ if __name__ == '__main__':
|
|||||||
sys.exit()
|
sys.exit()
|
||||||
if num == 1:
|
if num == 1:
|
||||||
shareUuid = shareUuid1
|
shareUuid = shareUuid1
|
||||||
activityUrl = f"https://sjtx-dz.isvjcloud.com/phone_discount/?invite_id={shareUuid}&source=test&baseInfo=LM6HIKdH%2Cbrand_two"
|
activityUrl = f"https://sjtx-dz.isvjcloud.com/phone_discount/?invite_id={shareUuid}&source=test&baseInfo={baseInfo}"
|
||||||
print(f"🤖后面的号全部助力: {shareUuid}")
|
print(f"🤖后面的号全部助力: {shareUuid}")
|
||||||
|
|
||||||
time.sleep(2)
|
time.sleep(2)
|
9
jd_zns_collect.js
Normal file
9
jd_zns_collect.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user