mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-04-23 10:58:44 +08:00
Update jd_shopLeague_opencard.py
This commit is contained in:
parent
1f24e107a9
commit
ab89276410
@ -2,35 +2,36 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
File: jd_shopLeague_opencard.py(通用开卡-shopLeague系列)
|
File: jd_shopLeague_opencard.py(通用开卡-超店shopLeague系列)
|
||||||
Author: HarbourJ
|
Author: HarbourJ
|
||||||
Date: 2022/8/12 20:37
|
Date: 2022/8/12 20:37
|
||||||
TG: https://t.me/HarbourToulu
|
TG: https://t.me/HarbourToulu
|
||||||
TgChat: https://t.me/HarbourSailing
|
TgChat: https://t.me/HarbourSailing
|
||||||
cron: 1 1 1 1 1 1
|
cron: 1 1 1 1 1 1
|
||||||
new Env('通用开卡-shopLeague系列');
|
new Env('通用开卡-超店shopLeague系列');
|
||||||
ActivityEntry: https://lzdz1-isv.isvjd.com/dingzhi/shop/league/activity?activityId=dzd16c3e4a819a0e14026da9shop
|
ActivityEntry: https://lzdz1-isv.isvjd.com/dingzhi/shop/league/activity?activityId=dzd16c3e4a819a0e14026da9shop
|
||||||
Description: dingzhi/shop/league系列通用开卡脚本(通常情况下,开一张卡5,最高获得220豆,邀请成功获得20豆)。
|
Description: dingzhi/shop/league系列通用开卡脚本(通常情况下,开一张卡5,最高获得220豆,邀请成功获得20豆)。
|
||||||
本地sign算法+redis缓存Token+代理ip(自行配置,实测可行)
|
本地sign算法+redis缓存Token
|
||||||
变量: export jd_shopLeagueId="2b870a1a7450xxxxxxxxxxxxx" 变量值需要传入活动id
|
变量: export jd_shopLeagueId="2b870a1a7450xxxxxxxxxxxxx" 变量值需要传入活动id
|
||||||
|
并发变量:export jd_shopLeague_uuid="你的shareUuid"
|
||||||
Update: 2022/11/01 更新入会算法,内置船新入会本地算法
|
Update: 2022/11/01 更新入会算法,内置船新入会本地算法
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import time
|
import time, requests, sys, re, os, json, random
|
||||||
import requests
|
|
||||||
import sys
|
|
||||||
import re
|
|
||||||
import os
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import json
|
|
||||||
import random
|
|
||||||
from urllib.parse import quote_plus, unquote_plus
|
from urllib.parse import quote_plus, unquote_plus
|
||||||
from functools import partial
|
from functools import partial
|
||||||
print = partial(print, flush=True)
|
print = partial(print, flush=True)
|
||||||
import warnings
|
import warnings
|
||||||
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
||||||
|
|
||||||
from jd_sign import *
|
try:
|
||||||
|
from jd_sign import *
|
||||||
|
except ImportError as e:
|
||||||
|
print(e)
|
||||||
|
if "No module" in str(e):
|
||||||
|
print("请先运行Faker库依赖一键安装脚本(jd_check_sign.py),安装jd_sign.so依赖")
|
||||||
|
sys.exit()
|
||||||
try:
|
try:
|
||||||
from jdCookie import get_cookies
|
from jdCookie import get_cookies
|
||||||
getCk = get_cookies()
|
getCk = get_cookies()
|
||||||
@ -39,12 +40,13 @@ except:
|
|||||||
sys.exit(3)
|
sys.exit(3)
|
||||||
|
|
||||||
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_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 ""
|
||||||
jd_shopLeagueId = os.environ.get("jd_shopLeagueId") if os.environ.get("jd_shopLeagueId") else ""
|
jd_shopLeagueId = os.environ.get("jd_shopLeagueId") if os.environ.get("jd_shopLeagueId") else ""
|
||||||
inviterUuid = os.environ.get("jd_shopLeague_uuid") if os.environ.get("jd_shopLeague_uuid") else ""
|
inviterUuid = os.environ.get("jd_shopLeague_uuid") if os.environ.get("jd_shopLeague_uuid") else ""
|
||||||
|
|
||||||
if not jd_shopLeagueId:
|
if not jd_shopLeagueId:
|
||||||
print("⚠️未发现有效活动变量,退出程序!")
|
print("⚠️未发现有效超店活动变量jd_shopLeagueId,退出程序!")
|
||||||
sys.exit()
|
sys.exit()
|
||||||
# 获取远程remote-redis活动ID
|
# 获取远程remote-redis活动ID
|
||||||
if "lzdz1_remote" in jd_shopLeagueId:
|
if "lzdz1_remote" in jd_shopLeagueId:
|
||||||
@ -63,7 +65,7 @@ def redis_conn():
|
|||||||
try:
|
try:
|
||||||
import redis
|
import redis
|
||||||
try:
|
try:
|
||||||
pool = redis.ConnectionPool(host=redis_url, port=6379, decode_responses=True, socket_connect_timeout=5, password=redis_pwd)
|
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 = redis.Redis(connection_pool=pool)
|
||||||
r.get('conn_test')
|
r.get('conn_test')
|
||||||
print('✅redis连接成功')
|
print('✅redis连接成功')
|
||||||
@ -77,48 +79,18 @@ def redis_conn():
|
|||||||
def getToken(ck, r=None):
|
def getToken(ck, r=None):
|
||||||
host = f'{activityUrl.split("com/")[0]}com'
|
host = f'{activityUrl.split("com/")[0]}com'
|
||||||
try:
|
try:
|
||||||
# redis缓存Token 活动域名+pt_pin
|
|
||||||
pt_pin = unquote_plus(re.compile(r'pt_pin=(.*?);').findall(ck)[0])
|
pt_pin = unquote_plus(re.compile(r'pt_pin=(.*?);').findall(ck)[0])
|
||||||
except:
|
except:
|
||||||
# redis缓存Token 活动域名+ck前7位(获取pin失败)
|
pt_pin = ck[:15]
|
||||||
pt_pin = ck[:8]
|
|
||||||
try:
|
try:
|
||||||
if r is not None:
|
try:
|
||||||
Token = r.get(f'{activityUrl.split("https://")[1].split("-")[0]}_{pt_pin}')
|
Token = r.get(f'{activityUrl.split("https://")[1].split("-")[0]}_{pt_pin}')
|
||||||
# print("Token过期时间", r.ttl(f'{activityUrl.split("https://")[1].split("-")[0]}_{pt_pin}'))
|
except Exception as e:
|
||||||
if Token is not None:
|
# print(f"redis get error: {str(e)}")
|
||||||
# print(f"♻️获取缓存Token->: {Token}")
|
Token = None
|
||||||
print(f"♻️获取缓存Token")
|
if Token is not None:
|
||||||
return Token
|
print(f"♻️获取缓存Token")
|
||||||
else:
|
return Token
|
||||||
print("🈳去设置Token缓存")
|
|
||||||
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_txt = sign({"url": f"{host}", "id": ""}, 'isvObfuscator')
|
|
||||||
# print(sign_txt)
|
|
||||||
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:
|
|
||||||
return
|
|
||||||
Token_new = f.json()['token']
|
|
||||||
# print(f"Token->: {Token_new}")
|
|
||||||
if r.set(f'{activityUrl.split("https://")[1].split("-")[0]}_{pt_pin}', Token_new, ex=1800):
|
|
||||||
print("✅Token缓存设置成功")
|
|
||||||
else:
|
|
||||||
print("❌Token缓存设置失败")
|
|
||||||
return Token_new
|
|
||||||
else:
|
else:
|
||||||
s.headers = {
|
s.headers = {
|
||||||
'Connection': 'keep-alive',
|
'Connection': 'keep-alive',
|
||||||
@ -131,19 +103,27 @@ def getToken(ck, r=None):
|
|||||||
'Accept-Language': 'zh-Hans-CN;q=1 en-CN;q=0.9',
|
'Accept-Language': 'zh-Hans-CN;q=1 en-CN;q=0.9',
|
||||||
'Accept': '*/*'
|
'Accept': '*/*'
|
||||||
}
|
}
|
||||||
sign_txt = sign({"url": f"{host}", "id": ""}, 'isvObfuscator')
|
sign({"url": f"{host}", "id": ""}, 'isvObfuscator')
|
||||||
# print(sign_txt)
|
|
||||||
f = s.post('https://api.m.jd.com/client.action', verify=False, timeout=30)
|
f = s.post('https://api.m.jd.com/client.action', verify=False, timeout=30)
|
||||||
if f.status_code != 200:
|
if f.status_code != 200:
|
||||||
print(f.status_code)
|
print(f.status_code)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
if "参数异常" in f.text:
|
if "参数异常" in f.text:
|
||||||
|
print(f.text)
|
||||||
return
|
return
|
||||||
Token = f.json()['token']
|
Token_new = f.json()['token']
|
||||||
print(f"Token->: {Token}")
|
try:
|
||||||
return Token
|
if r.set(f'{activityUrl.split("https://")[1].split("-")[0]}_{pt_pin}', Token_new, ex=1800):
|
||||||
except:
|
print("✅Token缓存成功")
|
||||||
|
else:
|
||||||
|
print("❌Token缓存失败")
|
||||||
|
except Exception as e:
|
||||||
|
# print(f"redis set error: {str(e)}")
|
||||||
|
print(f"✅获取实时Token")
|
||||||
|
return Token_new
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Get Token Error: {str(e)}")
|
||||||
return
|
return
|
||||||
|
|
||||||
def getJdTime():
|
def getJdTime():
|
||||||
@ -177,8 +157,7 @@ def getActivity():
|
|||||||
'User-Agent': ua,
|
'User-Agent': ua,
|
||||||
'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',
|
||||||
'Connection': 'keep-alive',
|
'Connection': 'keep-alive'
|
||||||
'Referer': activityUrl
|
|
||||||
}
|
}
|
||||||
response = requests.request("GET", url, headers=headers)
|
response = requests.request("GET", url, headers=headers)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
@ -232,7 +211,7 @@ def getSimpleActInfoVo():
|
|||||||
if res['result']:
|
if res['result']:
|
||||||
return res['data']
|
return res['data']
|
||||||
else:
|
else:
|
||||||
print(res['errorMessage'])
|
print(f"getSimpleActInfoVo Error: {res['errorMessage']}")
|
||||||
|
|
||||||
def getMyPing(index, venderId):
|
def getMyPing(index, venderId):
|
||||||
url = "https://lzdz1-isv.isvjcloud.com/customer/getMyPing"
|
url = "https://lzdz1-isv.isvjcloud.com/customer/getMyPing"
|
||||||
@ -256,7 +235,7 @@ def getMyPing(index, venderId):
|
|||||||
if res['result']:
|
if res['result']:
|
||||||
return res['data']['nickname'], res['data']['secretPin']
|
return res['data']['nickname'], res['data']['secretPin']
|
||||||
else:
|
else:
|
||||||
print(f"⚠️{res['errorMessage']}")
|
print(f"⚠️getMyPing Error: {res['errorMessage']}")
|
||||||
if index == 1 and "火爆" in res['errorMessage']:
|
if index == 1 and "火爆" in res['errorMessage']:
|
||||||
print(f"\t⛈车头黑,退出本程序!")
|
print(f"\t⛈车头黑,退出本程序!")
|
||||||
sys.exit()
|
sys.exit()
|
||||||
@ -320,7 +299,7 @@ def getUserInfo(pin):
|
|||||||
if res['result']:
|
if res['result']:
|
||||||
return res['data']['nickname'], res['data']['yunMidImageUrl'], res['data']['pin']
|
return res['data']['nickname'], res['data']['yunMidImageUrl'], res['data']['pin']
|
||||||
else:
|
else:
|
||||||
print(res['errorMessage'])
|
print(f"getUserInfo Error: {res['errorMessage']}")
|
||||||
|
|
||||||
def activityContent(pin, pinImg, nickname):
|
def activityContent(pin, pinImg, nickname):
|
||||||
url = "https://lzdz1-isv.isvjcloud.com/dingzhi/shop/league/activityContent"
|
url = "https://lzdz1-isv.isvjcloud.com/dingzhi/shop/league/activityContent"
|
||||||
@ -371,30 +350,33 @@ def drawContent(pin):
|
|||||||
requests.request("POST", url, headers=headers, data=payload)
|
requests.request("POST", url, headers=headers, data=payload)
|
||||||
|
|
||||||
def checkOpenCard(shareUuid, actorUuid):
|
def checkOpenCard(shareUuid, actorUuid):
|
||||||
url = "https://lzdz1-isv.isvjcloud.com/dingzhi/shop/league/checkOpenCard"
|
try:
|
||||||
payload = f"activityId={activityId}&pin={quote_plus(pin)}&shareUuid={shareUuid}&actorUuid={actorUuid}"
|
url = "https://lzdz1-isv.isvjcloud.com/dingzhi/shop/league/checkOpenCard"
|
||||||
headers = {
|
payload = f"activityId={activityId}&pin={quote_plus(pin)}&shareUuid={shareUuid}&actorUuid={actorUuid}"
|
||||||
'Host': 'lzdz1-isv.isvjcloud.com',
|
headers = {
|
||||||
'Accept': 'application/json',
|
'Host': 'lzdz1-isv.isvjcloud.com',
|
||||||
'X-Requested-With': 'XMLHttpRequest',
|
'Accept': 'application/json',
|
||||||
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
|
'X-Requested-With': 'XMLHttpRequest',
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
'Origin': 'https://lzdz1-isv.isvjcloud.com',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
'User-Agent': ua,
|
'Origin': 'https://lzdz1-isv.isvjcloud.com',
|
||||||
'Connection': 'keep-alive',
|
'User-Agent': ua,
|
||||||
'Referer': activityUrl,
|
'Connection': 'keep-alive',
|
||||||
'Cookie': activityCookie
|
'Referer': activityUrl,
|
||||||
}
|
'Cookie': activityCookie
|
||||||
response = requests.request("POST", url, headers=headers, data=payload)
|
}
|
||||||
# refresh_cookies(response)
|
response = requests.request("POST", url, headers=headers, data=payload)
|
||||||
res = response.json()
|
# refresh_cookies(response)
|
||||||
if res['result']:
|
res = response.json()
|
||||||
return res['data']
|
if res['result']:
|
||||||
else:
|
return res['data']
|
||||||
print(res['errorMessage'])
|
else:
|
||||||
if "活动已结束" in res['errorMessage']:
|
print(f"checkOpenCard Error: {res['errorMessage']}")
|
||||||
sys.exit()
|
if "活动已结束" in res['errorMessage']:
|
||||||
|
sys.exit()
|
||||||
|
except Exception as e:
|
||||||
|
print(f"checkOpenCard Error: {e}")
|
||||||
|
|
||||||
def getDrawRecordHasCoupon(pin, actorUuid):
|
def getDrawRecordHasCoupon(pin, actorUuid):
|
||||||
url = "https://lzdz1-isv.isvjcloud.com/dingzhi/taskact/common/getDrawRecordHasCoupon"
|
url = "https://lzdz1-isv.isvjcloud.com/dingzhi/taskact/common/getDrawRecordHasCoupon"
|
||||||
@ -435,7 +417,7 @@ def getShareRecord(actorUuid):
|
|||||||
if res['result']:
|
if res['result']:
|
||||||
return res['data']
|
return res['data']
|
||||||
else:
|
else:
|
||||||
print(res['errorMessage'])
|
print(f"getShareRecord Error: {res['errorMessage']}")
|
||||||
|
|
||||||
def saveTask(actorUuid, shareUuid, pin, taskType, taskValue):
|
def saveTask(actorUuid, shareUuid, pin, taskType, taskValue):
|
||||||
url = "https://lzdz1-isv.isvjcloud.com/dingzhi/shop/league/saveTask"
|
url = "https://lzdz1-isv.isvjcloud.com/dingzhi/shop/league/saveTask"
|
||||||
@ -459,13 +441,20 @@ def saveTask(actorUuid, shareUuid, pin, taskType, taskValue):
|
|||||||
print(res['data'])
|
print(res['data'])
|
||||||
return res['data']
|
return res['data']
|
||||||
else:
|
else:
|
||||||
print(res['errorMessage'])
|
print(f"saveTask Error: {res['errorMessage']}")
|
||||||
|
|
||||||
def bindWithVender(cookie, venderId):
|
def bindWithVender(cookie, venderId):
|
||||||
try:
|
try:
|
||||||
shopcard_url0 = f"https://lzdz1-isv.isvjcloud.com/dingzhi/joinCommon/activity/7854908?activityId={activityId}&shareUuid={shareUuid}"
|
payload = {
|
||||||
shopcard_url = f"https://shopmember.m.jd.com/shopcard/?venderId={venderId}&channel=401&returnUrl={quote_plus(shopcard_url0)}"
|
'appid': 'jd_shop_member',
|
||||||
s.headers = {
|
'functionId': 'bindWithVender',
|
||||||
|
'body': json.dumps({
|
||||||
|
'venderId': venderId,
|
||||||
|
'shopId': venderId,
|
||||||
|
'bindByVerifyCodeFlag': 1
|
||||||
|
}, separators=(',', ':'))
|
||||||
|
}
|
||||||
|
headers = {
|
||||||
'Connection': 'keep-alive',
|
'Connection': 'keep-alive',
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||||
@ -476,24 +465,14 @@ def bindWithVender(cookie, venderId):
|
|||||||
'Accept-Language': 'zh-Hans-CN;q=1 en-CN;q=0.9',
|
'Accept-Language': 'zh-Hans-CN;q=1 en-CN;q=0.9',
|
||||||
'Accept': '*/*'
|
'Accept': '*/*'
|
||||||
}
|
}
|
||||||
s.params = {
|
response = requests.request("POST", "https://api.m.jd.com/", headers=headers, data=payload, timeout=10).text
|
||||||
'appid': 'jd_shop_member',
|
res = json.loads(response)
|
||||||
'functionId': 'bindWithVender',
|
|
||||||
'body': json.dumps({
|
|
||||||
'venderId': venderId,
|
|
||||||
'shopId': venderId,
|
|
||||||
'bindByVerifyCodeFlag': 1
|
|
||||||
}, separators=(',', ':'))
|
|
||||||
}
|
|
||||||
res = s.post('https://api.m.jd.com/', verify=False, timeout=30).json()
|
|
||||||
if res['success']:
|
if res['success']:
|
||||||
return res['message']
|
return res['message'], res['result']['giftInfo'] if res['result'] else ""
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(f"bindWithVender Error: {venderId} {e}")
|
||||||
|
|
||||||
def getShopOpenCardInfo(cookie, venderId):
|
def getShopOpenCardInfo(cookie, venderId):
|
||||||
shopcard_url0 = f"https://lzdz1-isv.isvjcloud.com/dingzhi/shop/league/activity/7854908?activityId={activityId}&shareUuid={shareUuid}"
|
|
||||||
shopcard_url = f"https://shopmember.m.jd.com/shopcard/?venderId={venderId}&channel=401&returnUrl={quote_plus(shopcard_url0)}"
|
|
||||||
try:
|
try:
|
||||||
body = {"venderId": str(venderId), "channel": "401"}
|
body = {"venderId": str(venderId), "channel": "401"}
|
||||||
url = f'https://api.m.jd.com/client.action?appid=jd_shop_member&functionId=getShopOpenCardInfo&body={json.dumps(body)}&client=H5&clientVersion=9.2.0&uuid=88888'
|
url = f'https://api.m.jd.com/client.action?appid=jd_shop_member&functionId=getShopOpenCardInfo&body={json.dumps(body)}&client=H5&clientVersion=9.2.0&uuid=88888'
|
||||||
@ -504,10 +483,10 @@ def getShopOpenCardInfo(cookie, venderId):
|
|||||||
'Cookie': cookie,
|
'Cookie': cookie,
|
||||||
'User-Agent': ua,
|
'User-Agent': ua,
|
||||||
'Accept-Language': 'zh-cn',
|
'Accept-Language': 'zh-cn',
|
||||||
'Referer': shopcard_url,
|
'Referer': 'https://shopmember.m.jd.com/',
|
||||||
'Accept-Encoding': 'gzip, deflate'
|
'Accept-Encoding': 'gzip, deflate'
|
||||||
}
|
}
|
||||||
response = requests.get(url=url, headers=headers, timeout=5).text
|
response = requests.get(url=url, headers=headers, timeout=10).text
|
||||||
res = json.loads(response)
|
res = json.loads(response)
|
||||||
if res['success']:
|
if res['success']:
|
||||||
venderCardName = res['result']['shopMemberCardInfo']['venderCardName']
|
venderCardName = res['result']['shopMemberCardInfo']['venderCardName']
|
||||||
@ -540,7 +519,7 @@ if __name__ == '__main__':
|
|||||||
num += 1
|
num += 1
|
||||||
if num == 1:
|
if num == 1:
|
||||||
firstCk = cookie
|
firstCk = cookie
|
||||||
if num % 8 == 0:
|
if num % 5 == 0:
|
||||||
print("⏰等待10s,休息一下")
|
print("⏰等待10s,休息一下")
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
global ua, activityCookie, token
|
global ua, activityCookie, token
|
||||||
@ -561,26 +540,28 @@ if __name__ == '__main__':
|
|||||||
print(f"⚠️获取Token失败!⏰等待3s")
|
print(f"⚠️获取Token失败!⏰等待3s")
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
continue
|
continue
|
||||||
time.sleep(0.5)
|
time.sleep(0.3)
|
||||||
activityCookie = getActivity()
|
activityCookie = getActivity()
|
||||||
time.sleep(0.5)
|
time.sleep(0.3)
|
||||||
getSystemConfigForNew()
|
getSystemConfigForNew()
|
||||||
time.sleep(0.3)
|
time.sleep(0.3)
|
||||||
getSimAct = getSimpleActInfoVo()
|
getSimAct = getSimpleActInfoVo()
|
||||||
if getSimAct:
|
if getSimAct:
|
||||||
venderId = getSimAct['venderId']
|
venderId = getSimAct['venderId']
|
||||||
else:
|
else:
|
||||||
venderId = "1000010825"
|
venderId = "1000003571"
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
getPin = getMyPing(num, venderId)
|
getPin = getMyPing(num, venderId)
|
||||||
if getPin is not None:
|
if getPin:
|
||||||
nickname = getPin[0]
|
nickname = getPin[0]
|
||||||
secretPin = getPin[1]
|
secretPin = getPin[1]
|
||||||
time.sleep(0.5)
|
time.sleep(0.2)
|
||||||
accessLogWithAD(venderId, secretPin)
|
accessLogWithAD(venderId, secretPin)
|
||||||
time.sleep(0.5)
|
time.sleep(0.2)
|
||||||
userInfo = getUserInfo(secretPin)
|
userInfo = getUserInfo(secretPin)
|
||||||
time.sleep(0.8)
|
if not userInfo:
|
||||||
|
continue
|
||||||
|
time.sleep(0.3)
|
||||||
nickname = userInfo[0]
|
nickname = userInfo[0]
|
||||||
yunMidImageUrl = userInfo[1]
|
yunMidImageUrl = userInfo[1]
|
||||||
pin = userInfo[2]
|
pin = userInfo[2]
|
||||||
@ -589,6 +570,7 @@ if __name__ == '__main__':
|
|||||||
if num == 1:
|
if num == 1:
|
||||||
print("⚠️无法获取车头邀请码,退出本程序!")
|
print("⚠️无法获取车头邀请码,退出本程序!")
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
time.sleep(3)
|
||||||
continue
|
continue
|
||||||
hasEnd = actContent['hasEnd']
|
hasEnd = actContent['hasEnd']
|
||||||
if hasEnd:
|
if hasEnd:
|
||||||
@ -601,69 +583,87 @@ if __name__ == '__main__':
|
|||||||
addSku = actContent['addSku']['allStatus']
|
addSku = actContent['addSku']['allStatus']
|
||||||
print(f"邀请码->: {actorUuid}")
|
print(f"邀请码->: {actorUuid}")
|
||||||
print(f"准备助力->: {shareUuid}")
|
print(f"准备助力->: {shareUuid}")
|
||||||
time.sleep(0.5)
|
time.sleep(0.2)
|
||||||
drawContent(pin)
|
drawContent(pin)
|
||||||
time.sleep(0.5)
|
time.sleep(0.2)
|
||||||
checkOC = checkOpenCard(shareUuid, actorUuid)
|
checkOC = checkOpenCard(shareUuid, actorUuid)
|
||||||
allOpenCard = checkOC['allOpenCard']
|
allOpenCard = checkOC['allOpenCard']
|
||||||
assistStatus = checkOC['assistStatus']
|
assistStatus = checkOC['assistStatus']
|
||||||
beanNum = checkOC['beanNum']
|
beanNum = checkOC['beanNum']
|
||||||
|
sendBeanNum = checkOC['sendBeanNum']
|
||||||
cardList = checkOC['cardList']
|
cardList = checkOC['cardList']
|
||||||
|
assStat = False
|
||||||
if allOpenCard:
|
if allOpenCard:
|
||||||
print("已完成全部开卡任务")
|
print("已完成全部开卡任务")
|
||||||
if assistStatus == 0:
|
if assistStatus == 0:
|
||||||
print("已经助力过你~")
|
print("已经助力过你~")
|
||||||
|
elif assistStatus == 2:
|
||||||
|
print("已经助力过你~")
|
||||||
elif assistStatus == 3:
|
elif assistStatus == 3:
|
||||||
print("已助力过其他好友~")
|
print("已助力过其他好友~")
|
||||||
elif assistStatus == 1:
|
elif assistStatus == 1:
|
||||||
print("已完成开卡关注任务,未助力过好友~")
|
print("已完成开卡关注任务,未助力过好友~")
|
||||||
assStat = True
|
assStat = True
|
||||||
else:
|
else:
|
||||||
# print('assistStatus:', assistState0)
|
|
||||||
assStat = True
|
assStat = True
|
||||||
else:
|
else:
|
||||||
print("现在去开卡")
|
|
||||||
openCardLists = [(int(i['value']), i['name']) for i in cardList if i['status'] == 0]
|
openCardLists = [(int(i['value']), i['name']) for i in cardList if i['status'] == 0]
|
||||||
|
print(f"现在去开卡,共计{len(openCardLists)}个会员💳")
|
||||||
|
open_num = 0
|
||||||
for shop in openCardLists:
|
for shop in openCardLists:
|
||||||
print(f"去开卡 {shop[1]} {shop[0]}")
|
open_num += 1
|
||||||
|
print(f"去开卡 {open_num}/{len(openCardLists)} {shop[0]}")
|
||||||
venderId = shop[0]
|
venderId = shop[0]
|
||||||
venderCardName = shop[1]
|
venderCardName = shop[1]
|
||||||
getShopOpenCardInfo(cookie, venderId)
|
getShopOpenCardInfo(cookie, venderId)
|
||||||
open_result = bindWithVender(cookie, venderId)
|
open_result = bindWithVender(cookie, venderId)
|
||||||
if open_result is not None:
|
if open_result is not None:
|
||||||
if "火爆" in open_result or "失败" in open_result:
|
if "火爆" in open_result[0] or "失败" in open_result[0] or "解绑" in open_result[0]:
|
||||||
time.sleep(1.5)
|
time.sleep(1.5)
|
||||||
print("\t尝试重新入会 第1次")
|
print(f"\t⛈⛈{venderCardName} {open_result[0]}")
|
||||||
open_result = bindWithVender(cookie, venderId)
|
|
||||||
if "火爆" in open_result or "失败" in open_result:
|
|
||||||
time.sleep(1.5)
|
|
||||||
print("\t尝试重新入会 第2次")
|
|
||||||
open_result = bindWithVender(cookie, venderId)
|
|
||||||
if "火爆" in open_result or "失败" in open_result:
|
|
||||||
print(f"\t⛈⛈{venderCardName} {open_result}")
|
|
||||||
assStat = False
|
assStat = False
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
print(f"\t🎉🎉{venderCardName} {open_result}")
|
print(f"\t🎉🎉{venderCardName} {open_result[0]}")
|
||||||
assStat = True
|
assStat = True
|
||||||
time.sleep(1.5)
|
if open_result[1]:
|
||||||
checkOpenCard(shareUuid, actorUuid)
|
print(f"\t🎁获得{','.join([gift['discountString'] + gift['prizeName'] for gift in open_result[1]['giftList']])}")
|
||||||
time.sleep(0.5)
|
if open_num % 5 == 0:
|
||||||
activityContent(pin, yunMidImageUrl, nickname)
|
print("⏰等待5s,休息一下")
|
||||||
time.sleep(0.5)
|
time.sleep(5)
|
||||||
drawContent(pin)
|
else:
|
||||||
|
time.sleep(2)
|
||||||
|
checkOC = checkOpenCard(shareUuid, actorUuid)
|
||||||
|
if not checkOC:
|
||||||
|
time.sleep(5)
|
||||||
|
continue
|
||||||
|
sendBeanNum = checkOC['sendBeanNum']
|
||||||
|
allOpenCard = checkOC['allOpenCard']
|
||||||
|
assistStatus = checkOC['assistStatus']
|
||||||
|
if sendBeanNum > 0:
|
||||||
|
print(f"\t🎁开卡获得{sendBeanNum}豆")
|
||||||
|
else:
|
||||||
|
print(f"\t🤖开卡可能没水啦!")
|
||||||
|
if allOpenCard and assistStatus == 1:
|
||||||
|
assStat = True
|
||||||
|
activityContent(pin, yunMidImageUrl, nickname)
|
||||||
|
time.sleep(0.5)
|
||||||
|
drawContent(pin)
|
||||||
print("现在去一键关注店铺")
|
print("现在去一键关注店铺")
|
||||||
saveTask(actorUuid, shareUuid, pin, 1, 1)
|
saveTask(actorUuid, shareUuid, pin, 1, 1)
|
||||||
time.sleep(0.5)
|
time.sleep(0.3)
|
||||||
print("现在去一键加购")
|
print("现在去一键加购")
|
||||||
saveTask(actorUuid, shareUuid, pin, 2, 2)
|
saveTask(actorUuid, shareUuid, pin, 2, 2)
|
||||||
time.sleep(0.5)
|
time.sleep(0.3)
|
||||||
getSR = getShareRecord(actorUuid)
|
getSR = getShareRecord(actorUuid)
|
||||||
if num == 1:
|
if getSR and num == 1:
|
||||||
if getSR:
|
print(f"🧑🤝🧑已经邀请{len(getSR)}人")
|
||||||
print(f"🎉🎉🎉已经邀请{len(getSR)}人")
|
if assStat and num != 1:
|
||||||
|
print("🎉🎉🎉助力成功~")
|
||||||
|
inviteSuccNum += 1
|
||||||
|
print(f"本次车头已邀请{inviteSuccNum}人")
|
||||||
if num == 1:
|
if num == 1:
|
||||||
print(f"后面账号全部助力 {actorUuid}")
|
print(f"后面账号全部助力 {actorUuid}")
|
||||||
if num == 1:
|
|
||||||
shareUuid = actorUuid
|
shareUuid = actorUuid
|
||||||
activityUrl = f"https://lzdz1-isv.isvjcloud.com/dingzhi/shop/league/activity/5929859?activityId={activityId}&shareUuid={shareUuid}"
|
activityUrl = f"https://lzdz1-isv.isvjcloud.com/dingzhi/shop/league/activity/5929859?activityId={activityId}&shareUuid={shareUuid}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user