Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Faker authored and Faker committed Nov 1, 2022
1 parent 41c58db commit 3f22aec
Show file tree
Hide file tree
Showing 5 changed files with 615 additions and 56 deletions.
39 changes: 22 additions & 17 deletions jd_jinggengInvite.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
活动入口: https://jinggeng-isv.isvjcloud.com/ql/front/showInviteJoin?id=9e80809282a4bdc90182ab254c7e0a12&user_id=1000121005
变量设置: export redis_url="xxx", export redis_port="xxx"(没有可省略), export redis_pwd="xxx"(没有可省略)
export jinggengInviteJoin="9e80809282a4bdc90182ab254c7e0a12&1000121005"(活动id&店铺id)
Update: 2022/11/01 更新入会算法,内置船新入会本地算法
"""

import time, requests, sys, re, os, json, random
Expand Down Expand Up @@ -331,28 +332,32 @@ def shopmember(cookie):
}
requests.request("GET", url, headers=headers)

def bindWithVender(cookie):
def bindWithVender(cookie, venderId):
try:
body = {"venderId": user_id, "shopId": user_id, "bindByVerifyCodeFlag": 1,"registerExtend": {},"writeChildFlag":0, "channel": 401}
h5st = getH5st("bindWithVender", body)
url = f"https://api.m.jd.com/client.action?appid=jd_shop_member&functionId=bindWithVender&body={quote_plus(json.dumps(body, separators=(',', ':')))}&client=H5&clientVersion=9.2.0&uuid=88888&h5st={h5st}"
headers = {
'Host': 'api.m.jd.com',
'Cookie': cookie,
'Accept-Encoding': 'gzip, deflate, br',
shopcard_url0 = f"https://lzdz1-isv.isvjcloud.com/dingzhi/joinCommon/activity/7854908?activityId={activityId}&shareUuid={shareUuid}"
shopcard_url = f"https://shopmember.m.jd.com/shopcard/?venderId={venderId}&channel=401&returnUrl={quote_plus(shopcard_url0)}"
s.headers = {
'Connection': 'keep-alive',
'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'User-Agent': ua,
'Referer': f'https://shopmember.m.jd.com/shopcard/?venderId={user_id}&channel=401&returnUrl={quote_plus(activityUrl + "&isOpenCard=1")}'
'Cookie': cookie,
'Host': 'api.m.jd.com',
'Referer': 'https://shopmember.m.jd.com/',
'Accept-Language': 'zh-Hans-CN;q=1 en-CN;q=0.9',
'Accept': '*/*'
}
s.params = {
'appid': 'jd_shop_member',
'functionId': 'bindWithVender',
'body': json.dumps({
'venderId': venderId,
'shopId': venderId,
'bindByVerifyCodeFlag': 1
}, separators=(',', ':'))
}
response = requests.get(url=url, headers=headers, timeout=30).text
res = json.loads(re.match(".*?({.*}).*", response, re.S).group(1))
res = s.post('https://api.m.jd.com/', verify=False, timeout=30).json()
if res['success']:
open_result = res['message']
if "火爆" in open_result:
print(f"\t⛈⛈⛈{open_result}")
else:
print(f"\t🎉🎉🎉{open_result}")
return res['message']
except Exception as e:
print(e)
Expand Down
43 changes: 28 additions & 15 deletions jd_joinCommon_opencard.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Description: dingzhi/joinCommon系列通用开卡脚本(通常情况下,开一张卡10豆,邀请成功获得20豆)。
本地sign算法+redis缓存Token+代理ip(自行配置,实测可行)
变量: export jd_joinCommonId="2b870a1a7450xxxxxxxxxxxxx&1000000904" 变量值需要传入活动id&shopId
Update: 2022/11/01 更新入会算法,内置船新入会本地算法
"""

import time, requests, sys, re, os, json, random
Expand Down Expand Up @@ -484,20 +485,27 @@ def bindWithVender(cookie, venderId):
try:
shopcard_url0 = f"https://lzdz1-isv.isvjcloud.com/dingzhi/joinCommon/activity/7854908?activityId={activityId}&shareUuid={shareUuid}"
shopcard_url = f"https://shopmember.m.jd.com/shopcard/?venderId={venderId}&channel=401&returnUrl={quote_plus(shopcard_url0)}"
body = {"venderId": venderId, "bindByVerifyCodeFlag": 1,"registerExtend": {},"writeChildFlag":0, "channel": 401}
h5st = getH5st("bindWithVender", body)
url = f"https://api.m.jd.com/client.action?appid=jd_shop_member&functionId=bindWithVender&body={quote_plus(json.dumps(body, separators=(',', ':')))}&client=H5&clientVersion=9.2.0&uuid=88888&h5st={h5st}"
headers = {
'Host': 'api.m.jd.com',
'Cookie': cookie,
'Accept-Encoding': 'gzip, deflate, br',
s.headers = {
'Connection': 'keep-alive',
'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'User-Agent': ua,
'Referer': shopcard_url
'Cookie': cookie,
'Host': 'api.m.jd.com',
'Referer': 'https://shopmember.m.jd.com/',
'Accept-Language': 'zh-Hans-CN;q=1 en-CN;q=0.9',
'Accept': '*/*'
}
s.params = {
'appid': 'jd_shop_member',
'functionId': 'bindWithVender',
'body': json.dumps({
'venderId': venderId,
'shopId': venderId,
'bindByVerifyCodeFlag': 1
}, separators=(',', ':'))
}
response = requests.get(url=url, headers=headers, timeout=30).text
res = json.loads(re.match(".*?({.*}).*", response, re.S).group(1))
res = s.post('https://api.m.jd.com/', verify=False, timeout=30).json()
if res['success']:
return res['message']
except Exception as e:
Expand Down Expand Up @@ -655,17 +663,22 @@ def getShopOpenCardInfo(cookie, venderId):
getShopOpenCardInfo(cookie, venderId)
open_result = bindWithVender(cookie, venderId)
if open_result is not None:
if "火爆" in open_result:
if "火爆" in open_result or "失败" in open_result:
time.sleep(1.5)
print("\t尝试重新入会 第1次")
open_result = bindWithVender(cookie, venderId)
if "火爆" in open_result:
time.sleep(1.5)
if "火爆" in open_result or "失败" in open_result:
time.sleep(2)
print("\t尝试重新入会 第2次")
open_result = bindWithVender(cookie, venderId)
if "火爆" in open_result:
if "火爆" in open_result or "失败" in open_result:
time.sleep(3)
print("\t尝试重新入会 第3次")
open_result = bindWithVender(cookie, venderId)
if "火爆" in open_result or "失败" in open_result:
print(f"\t⛈⛈{venderCardName} {open_result}")
assStat = False
break
else:
print(f"\t🎉🎉{venderCardName} {open_result}")
assStat = True
Expand Down
32 changes: 20 additions & 12 deletions jd_shopLeague_opencard.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Description: dingzhi/shop/league系列通用开卡脚本(通常情况下,开一张卡5,最高获得220豆,邀请成功获得20豆)。
本地sign算法+redis缓存Token+代理ip(自行配置,实测可行)
变量: export jd_shopLeagueId="2b870a1a7450xxxxxxxxxxxxx" 变量值需要传入活动id
Update: 2022/11/01 更新入会算法,内置船新入会本地算法
"""

import time
Expand Down Expand Up @@ -462,22 +463,29 @@ def saveTask(actorUuid, shareUuid, pin, taskType, taskValue):

def bindWithVender(cookie, venderId):
try:
shopcard_url0 = f"https://lzdz1-isv.isvjcloud.com/dingzhi/shop/league/activity/7854908?activityId={activityId}&shareUuid={shareUuid}"
shopcard_url0 = f"https://lzdz1-isv.isvjcloud.com/dingzhi/joinCommon/activity/7854908?activityId={activityId}&shareUuid={shareUuid}"
shopcard_url = f"https://shopmember.m.jd.com/shopcard/?venderId={venderId}&channel=401&returnUrl={quote_plus(shopcard_url0)}"
body = {"venderId": venderId, "bindByVerifyCodeFlag": 1,"registerExtend": {},"writeChildFlag":0, "channel": 401}
h5st = getH5st("bindWithVender", body)
url = f"https://api.m.jd.com/client.action?appid=jd_shop_member&functionId=bindWithVender&body={quote_plus(json.dumps(body, separators=(',', ':')))}&client=H5&clientVersion=9.2.0&uuid=88888&h5st={h5st}"
headers = {
'Host': 'api.m.jd.com',
'Cookie': cookie,
'Accept-Encoding': 'gzip, deflate, br',
s.headers = {
'Connection': 'keep-alive',
'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'User-Agent': ua,
'Referer': shopcard_url
'Cookie': cookie,
'Host': 'api.m.jd.com',
'Referer': 'https://shopmember.m.jd.com/',
'Accept-Language': 'zh-Hans-CN;q=1 en-CN;q=0.9',
'Accept': '*/*'
}
s.params = {
'appid': 'jd_shop_member',
'functionId': 'bindWithVender',
'body': json.dumps({
'venderId': venderId,
'shopId': venderId,
'bindByVerifyCodeFlag': 1
}, separators=(',', ':'))
}
response = requests.get(url=url, headers=headers, timeout=30).text
res = json.loads(re.match(".*?({.*}).*", response, re.S).group(1))
res = s.post('https://api.m.jd.com/', verify=False, timeout=30).json()
if res['success']:
return res['message']
except Exception as e:
Expand Down
36 changes: 24 additions & 12 deletions jd_wdz.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Description: 微定制组队通用脚本
本地sign算法+redis缓存Token+代理ip(自行配置,实测可行)
变量: export jd_wdz_activityId="eb24d792fdcf4732be29030f9fc8e007"
Update: 2022/11/01 更新入会算法,内置船新入会本地算法
"""

import time, requests, sys, re, os, json, random
Expand Down Expand Up @@ -172,6 +173,9 @@ def getActivity():
}
try:
response = requests.request("GET", url, headers=headers)
if "活动未开始" in response.text or "活动已结束" in response.text:
print("⚠️活动已结束,下次早点来~")
sys.exit()
if response.status_code == 493:
print(response.status_code, "⚠️ip疑似黑了,休息一会再来撸~")
sys.exit()
Expand Down Expand Up @@ -376,21 +380,29 @@ def acceptInvite(inviterNick, inviterPin, inviterImg, pin, nickName, inviteeImg)

def bindWithVender(cookie, venderId):
try:
shopcard_url = f"https://shopmember.m.jd.com/shopcard/?venderId={venderId}&channel=401&returnUrl={quote_plus(activityUrl)}"
body = {"venderId": venderId, "bindByVerifyCodeFlag": 1,"registerExtend": {},"writeChildFlag":0, "channel": 401}
h5st = getH5st("bindWithVender", body)
url = f"https://api.m.jd.com/client.action?appid=jd_shop_member&functionId=bindWithVender&body={quote_plus(json.dumps(body, separators=(',', ':')))}&client=H5&clientVersion=9.2.0&uuid=88888&h5st={h5st}"
headers = {
'Host': 'api.m.jd.com',
'Cookie': cookie,
'Accept-Encoding': 'gzip, deflate, br',
shopcard_url0 = f"https://lzdz1-isv.isvjcloud.com/dingzhi/joinCommon/activity/7854908?activityId={activityId}&shareUuid={shareUuid}"
shopcard_url = f"https://shopmember.m.jd.com/shopcard/?venderId={venderId}&channel=401&returnUrl={quote_plus(shopcard_url0)}"
s.headers = {
'Connection': 'keep-alive',
'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'User-Agent': ua,
'Referer': shopcard_url
'Cookie': cookie,
'Host': 'api.m.jd.com',
'Referer': 'https://shopmember.m.jd.com/',
'Accept-Language': 'zh-Hans-CN;q=1 en-CN;q=0.9',
'Accept': '*/*'
}
s.params = {
'appid': 'jd_shop_member',
'functionId': 'bindWithVender',
'body': json.dumps({
'venderId': venderId,
'shopId': venderId,
'bindByVerifyCodeFlag': 1
}, separators=(',', ':'))
}
response = requests.get(url=url, headers=headers, timeout=30).text
res = json.loads(re.match(".*?({.*}).*", response, re.S).group(1))
res = s.post('https://api.m.jd.com/', verify=False, timeout=30).json()
if res['success']:
return res['message']
except Exception as e:
Expand Down
Loading

0 comments on commit 3f22aec

Please sign in to comment.