mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-04-23 02:48:44 +08:00
update
This commit is contained in:
parent
9950cb2037
commit
d06e7f1f3f
15
jdCookie.py
15
jdCookie.py
@ -7,15 +7,14 @@
|
||||
|
||||
import os
|
||||
import time
|
||||
import logging
|
||||
logging.basicConfig(level=logging.INFO, format='%(message)s')
|
||||
logger = logging.getLogger()
|
||||
from functools import partial
|
||||
print = partial(print, flush=True)
|
||||
|
||||
|
||||
def get_cookies():
|
||||
CookieJDs = []
|
||||
if os.environ.get("JD_COOKIE"):
|
||||
logger.info("已获取并使用Env环境 Cookie")
|
||||
print("已获取并使用Env环境 Cookie")
|
||||
if '&' in os.environ["JD_COOKIE"]:
|
||||
CookieJDs = os.environ["JD_COOKIE"].split('&')
|
||||
elif '\n' in os.environ["JD_COOKIE"]:
|
||||
@ -37,13 +36,13 @@ def get_cookies():
|
||||
CookieJDs = sorted(set(CookieJDs), key=CookieJDs.index)
|
||||
# return CookieJDs
|
||||
else:
|
||||
logger.info("未获取到正确✅格式的京东账号Cookie")
|
||||
print("未获取到正确✅格式的京东账号Cookie")
|
||||
return
|
||||
|
||||
logger.info(f"====================共{len(CookieJDs)}个京东账号Cookie=========\n")
|
||||
logger.info(f"==================脚本执行- 北京时间(UTC+8):{time.strftime('%Y/%m/%d %H:%M:%S', time.localtime())}=====================\n")
|
||||
print(f"====================共{len(CookieJDs)}个京东账号Cookie=========\n")
|
||||
print(f"==================脚本执行- 北京时间(UTC+8):{time.strftime('%Y/%m/%d %H:%M:%S', time.localtime())}=====================\n")
|
||||
return CookieJDs
|
||||
|
||||
# if __name__ == "__main__":
|
||||
# get_cookies()
|
||||
# logger.info(os.environ.get("JD_COOKIE"))
|
||||
# print(os.environ.get("JD_COOKIE"))
|
||||
|
@ -23,9 +23,8 @@ from datetime import datetime
|
||||
import json
|
||||
import random
|
||||
from urllib.parse import quote_plus, unquote_plus
|
||||
import logging
|
||||
logging.basicConfig(level=logging.INFO, format='%(message)s')
|
||||
logger = logging.getLogger()
|
||||
from functools import partial
|
||||
print = partial(print, flush=True)
|
||||
import warnings
|
||||
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
||||
|
||||
@ -34,7 +33,7 @@ try:
|
||||
from jdCookie import get_cookies
|
||||
getCk = get_cookies()
|
||||
except:
|
||||
logger.info("请先下载依赖脚本,\n下载链接: https://raw.githubusercontent.com/shufflewzc/faker2/main/jdCookie.py")
|
||||
print("请先下载依赖脚本,\n下载链接: https://raw.githubusercontent.com/shufflewzc/faker2/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_pwd = os.environ.get("redis_pwd") if os.environ.get("redis_pwd") else ""
|
||||
@ -45,12 +44,13 @@ inviterNicks = [
|
||||
"pWGUWZJQ3actex0X2vQyLsjNhNaYFy2HteErE6izlhTf9nrGY7gBkCdGU4C6z%2FxD"
|
||||
]
|
||||
if "&" not in jinggengInviteJoin:
|
||||
logger.info("⚠️jinggengInviteJoin变量有误!退出程序!")
|
||||
print("⚠️jinggengInviteJoin变量有误!退出程序!")
|
||||
sys.exit()
|
||||
ac_id = jinggengInviteJoin.split("&")[0]
|
||||
user_id = jinggengInviteJoin.split("&")[1]
|
||||
inviterNick = random.choice(inviterNicks)
|
||||
activity_url = f"https://jinggeng-isv.isvjcloud.com/ql/front/showInviteJoin?id={ac_id}&user_id={user_id}&inviterNick={inviterNick}"
|
||||
print(f"【🛳活动入口】{activity_url}")
|
||||
|
||||
def redis_conn():
|
||||
try:
|
||||
@ -59,12 +59,12 @@ def redis_conn():
|
||||
pool = redis.ConnectionPool(host=redis_url, port=6379, decode_responses=True, socket_connect_timeout=5, password=redis_pwd)
|
||||
r = redis.Redis(connection_pool=pool)
|
||||
r.get('conn_test')
|
||||
logger.info('✅redis连接成功')
|
||||
print('✅redis连接成功')
|
||||
return r
|
||||
except:
|
||||
logger.info("⚠️redis连接异常")
|
||||
print("⚠️redis连接异常")
|
||||
except:
|
||||
logger.info("⚠️缺少redis依赖,请运行pip3 install redis")
|
||||
print("⚠️缺少redis依赖,请运行pip3 install redis")
|
||||
|
||||
def getToken(ck, r=None):
|
||||
try:
|
||||
@ -76,12 +76,12 @@ def getToken(ck, r=None):
|
||||
try:
|
||||
if r is not None:
|
||||
Token = r.get(f'{activityUrl.split("https://")[1].split("-")[0]}_{pt_pin}')
|
||||
# logger.info("Token过期时间", r.ttl(f'{activityUrl.split("https://")[1].split("-")[0]}_{pt_pin}'))
|
||||
# print("Token过期时间", r.ttl(f'{activityUrl.split("https://")[1].split("-")[0]}_{pt_pin}'))
|
||||
if Token is not None:
|
||||
logger.info(f"♻️获取缓存Token->: {Token}")
|
||||
print(f"♻️获取缓存Token->: {Token}")
|
||||
return Token
|
||||
else:
|
||||
logger.info("🈳去设置Token缓存-->")
|
||||
print("🈳去设置Token缓存-->")
|
||||
s.headers = {
|
||||
'Connection': 'keep-alive',
|
||||
'Accept-Encoding': 'gzip, deflate, br',
|
||||
@ -94,20 +94,20 @@ def getToken(ck, r=None):
|
||||
'Accept': '*/*'
|
||||
}
|
||||
sign_txt = sign({"url": f"{activityUrl}", "id": ""}, 'isvObfuscator')
|
||||
# logger.info(sign_txt)
|
||||
# print(sign_txt)
|
||||
f = s.post('https://api.m.jd.com/client.action', verify=False, timeout=30)
|
||||
if f.status_code != 200:
|
||||
logger.info(f.status_code)
|
||||
print(f.status_code)
|
||||
return
|
||||
else:
|
||||
if "参数异常" in f.text:
|
||||
return
|
||||
Token_new = f.json()['token']
|
||||
logger.info(f"Token->: {Token_new}")
|
||||
print(f"Token->: {Token_new}")
|
||||
if r.set(f'{activityUrl.split("https://")[1].split("-")[0]}_{pt_pin}', Token_new, ex=1800):
|
||||
logger.info("✅Token缓存设置成功")
|
||||
print("✅Token缓存设置成功")
|
||||
else:
|
||||
logger.info("❌Token缓存设置失败")
|
||||
print("❌Token缓存设置失败")
|
||||
return Token_new
|
||||
else:
|
||||
s.headers = {
|
||||
@ -122,16 +122,16 @@ def getToken(ck, r=None):
|
||||
'Accept': '*/*'
|
||||
}
|
||||
sign_txt = sign({"url": f"{activityUrl}", "id": ""}, 'isvObfuscator')
|
||||
# logger.info(sign_txt)
|
||||
# print(sign_txt)
|
||||
f = s.post('https://api.m.jd.com/client.action', verify=False, timeout=30)
|
||||
if f.status_code != 200:
|
||||
logger.info(f.status_code)
|
||||
print(f.status_code)
|
||||
return
|
||||
else:
|
||||
if "参数异常" in f.text:
|
||||
return
|
||||
Token = f.json()['token']
|
||||
logger.info(f"Token->: {Token}")
|
||||
print(f"Token->: {Token}")
|
||||
return Token
|
||||
except:
|
||||
return
|
||||
@ -194,7 +194,7 @@ def getActivity(index=1, isOpenCard=0, inviterCode=None, getIndex=0):
|
||||
response = requests.request("GET", url, headers=headers)
|
||||
html_text = response.text
|
||||
if response.status_code == 493:
|
||||
logger.info(response.status_code, "⚠️ip疑似黑了,休息一会再来撸~")
|
||||
print(response.status_code, "⚠️ip疑似黑了,休息一会再来撸~")
|
||||
sys.exit()
|
||||
# if response.cookies:
|
||||
cookies = response.cookies.get_dict()
|
||||
@ -219,7 +219,7 @@ def getActivity(index=1, isOpenCard=0, inviterCode=None, getIndex=0):
|
||||
shop_sid = soup.find('input', attrs={'id': 'shop_sid'})['value']
|
||||
inviteSuccNums = (soup.find('input', attrs={'id': 'helpLogs'})['value'])
|
||||
inviteSetting2s = eval(soup.find('input', attrs={'id': 'inviteSetting2'})['value'])
|
||||
logger.info(f"店铺名称: {shop_title} \n活动名称: {actName} \n店铺ID: {shop_sid}")
|
||||
print(f"店铺名称: {shop_title} \n活动名称: {actName} \n店铺ID: {shop_sid}")
|
||||
num1 = {'1': 'one', '2': 'two', '3': 'three', '4': 'four'}
|
||||
num2 = {'1': 'leveOneNum', '2': 'leveTwoNum', '3': 'leveThreeNum', '4': 'leveFourNum'}
|
||||
needInviteNums = []
|
||||
@ -238,16 +238,16 @@ def getActivity(index=1, isOpenCard=0, inviterCode=None, getIndex=0):
|
||||
denomination = inviteSetting2['denomination']
|
||||
awardId = inviteSetting2['id']
|
||||
# inviteSucc = soup.find('input', attrs={'id': 'inviteSucc'})['value']
|
||||
logger.info(f"奖品{b}: {equityName} 奖励: {denomination} 总数: {freezeQuantity}份 剩余: {availableQuantity}份 需要邀请: {leveNum}人")
|
||||
print(f"奖品{b}: {equityName} 奖励: {denomination} 总数: {freezeQuantity}份 剩余: {availableQuantity}份 需要邀请: {leveNum}人")
|
||||
if availableQuantity > 0:
|
||||
needInviteNums.append((leveNum, awardId, equityType))
|
||||
if len(needInviteNums) == 0:
|
||||
logger.info(f"⛈⛈⛈活动奖品全部发完啦!")
|
||||
print(f"⛈⛈⛈活动奖品全部发完啦!")
|
||||
sys.exit()
|
||||
return errorMsg, inviteSuccNums, needInviteNums
|
||||
return errorMsg0
|
||||
elif "活动已结束" in html_text:
|
||||
logger.info("😭活动已结束,下次早点来~")
|
||||
print("😭活动已结束,下次早点来~")
|
||||
sys.exit()
|
||||
else:
|
||||
return set_cookie
|
||||
@ -276,7 +276,7 @@ def setMixNick(token):
|
||||
refresh_cookies(response)
|
||||
return setMixNick0
|
||||
except Exception as e:
|
||||
logger.info(e)
|
||||
print(e)
|
||||
return
|
||||
|
||||
def recordActPvUvdata(token):
|
||||
@ -351,12 +351,12 @@ def bindWithVender(cookie):
|
||||
if res['success']:
|
||||
open_result = res['message']
|
||||
if "火爆" in open_result:
|
||||
logger.info(f"\t⛈⛈⛈{open_result}")
|
||||
print(f"\t⛈⛈⛈{open_result}")
|
||||
else:
|
||||
logger.info(f"\t🎉🎉🎉{open_result}")
|
||||
print(f"\t🎉🎉🎉{open_result}")
|
||||
return res['message']
|
||||
except Exception as e:
|
||||
logger.info(e)
|
||||
print(e)
|
||||
|
||||
def receiveInviteJoinAward(token, awardId):
|
||||
url = "https://jinggeng-isv.isvjcloud.com/ql/front/receiveInviteJoinAward"
|
||||
@ -382,9 +382,9 @@ def receiveInviteJoinAward(token, awardId):
|
||||
if msg['isSendSucc']:
|
||||
awardType = msg['drawAwardDto']['awardType'].replace('JD_BEAN', '京豆').replace('JD_POINT', '积分')
|
||||
awardDenomination = msg['drawAwardDto']['awardDenomination']
|
||||
logger.info(f"\t🎉🎉成功领取{awardDenomination}{awardType}")
|
||||
print(f"\t🎉🎉成功领取{awardDenomination}{awardType}")
|
||||
else:
|
||||
logger.info(f"\t🎉🎉{res['msg']}")
|
||||
print(f"\t🎉🎉{res['msg']}")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
@ -394,7 +394,7 @@ if __name__ == '__main__':
|
||||
if not cks:
|
||||
sys.exit()
|
||||
except:
|
||||
logger.info("未获取到有效COOKIE,退出程序!")
|
||||
print("未获取到有效COOKIE,退出程序!")
|
||||
sys.exit()
|
||||
global inviterCode, inviteSuccNums, activityUrl, needInviteNums, rewardIndex, firstCk
|
||||
inviteSuccNums = 0
|
||||
@ -408,7 +408,7 @@ if __name__ == '__main__':
|
||||
if num == 1:
|
||||
firstCk = cookie
|
||||
if num % 5 == 0:
|
||||
logger.info("⏰等待5s")
|
||||
print("⏰等待5s")
|
||||
time.sleep(5)
|
||||
global ua, activityCookie, token, getIndex
|
||||
getIndex = 0
|
||||
@ -418,8 +418,8 @@ if __name__ == '__main__':
|
||||
pt_pin = unquote_plus(pt_pin)
|
||||
except IndexError:
|
||||
pt_pin = f'用户{num}'
|
||||
logger.info(f'\n******开始【京东账号{num}】{pt_pin} *********\n')
|
||||
logger.info(datetime.now())
|
||||
print(f'\n******开始【京东账号{num}】{pt_pin} *********\n')
|
||||
print(datetime.now())
|
||||
token = ''
|
||||
activityCookie = ''
|
||||
activityCookie = getActivity(num, 0, inviterCode, 0)
|
||||
@ -427,54 +427,54 @@ if __name__ == '__main__':
|
||||
token = getToken(cookie, r)
|
||||
if token is None:
|
||||
if num == 1:
|
||||
logger.info(f"⚠️车头获取Token失败,退出本程序!")
|
||||
print(f"⚠️车头获取Token失败,退出本程序!")
|
||||
# sys.exit()
|
||||
os._exit()
|
||||
logger.info(f"⚠️获取Token失败!⏰等待3s")
|
||||
print(f"⚠️获取Token失败!⏰等待3s")
|
||||
time.sleep(3)
|
||||
continue
|
||||
except:
|
||||
logger.info(f"⚠️获取Token失败!⏰等待3s")
|
||||
print(f"⚠️获取Token失败!⏰等待3s")
|
||||
time.sleep(3)
|
||||
continue
|
||||
time.sleep(1.5)
|
||||
setMixNick0 = setMixNick(token)
|
||||
if setMixNick0 is None:
|
||||
if num == 1:
|
||||
logger.info(f"⚠️车头获取邀请码失败,退出本程序!")
|
||||
print(f"⚠️车头获取邀请码失败,退出本程序!")
|
||||
sys.exit()
|
||||
else:
|
||||
continue
|
||||
else:
|
||||
logger.info(f"邀请码->: {setMixNick0}")
|
||||
print(f"邀请码->: {setMixNick0}")
|
||||
time.sleep(1)
|
||||
logger.info(f"准备助力-->: {inviterCode}")
|
||||
print(f"准备助力-->: {inviterCode}")
|
||||
inviteSuccNum = getActivity(num, 0, inviterCode, 1)
|
||||
if num == 1:
|
||||
errorMsg0 = inviteSuccNum[0]
|
||||
if "跳开卡页面" not in errorMsg0:
|
||||
logger.info("无法助力自己")
|
||||
print("无法助力自己")
|
||||
inviteSuccNums0 = inviteSuccNum[1]
|
||||
needInviteNums = inviteSuccNum[2]
|
||||
inviteSuccNums = len(eval(inviteSuccNums0))
|
||||
logger.info(f"🛳已经邀请{inviteSuccNums}人")
|
||||
print(f"🛳已经邀请{inviteSuccNums}人")
|
||||
for i, needNum0 in enumerate(needInviteNums):
|
||||
needNum = needNum0[0]
|
||||
awardId = needNum0[1]
|
||||
if inviteSuccNums >= needNum:
|
||||
logger.info(f"🎉恭喜已完成第{i + 1}档邀请,快去领奖吧!")
|
||||
print(f"🎉恭喜已完成第{i + 1}档邀请,快去领奖吧!")
|
||||
time.sleep(1)
|
||||
recordActPvUvdata(token)
|
||||
checkTokenInSession(token)
|
||||
time.sleep(1)
|
||||
if equityType == "JD_GOODS":
|
||||
logger.info(f"\t🎉🎉成功获得实物奖励,请尽快前往领取:{activityUrl}")
|
||||
print(f"\t🎉🎉成功获得实物奖励,请尽快前往领取:{activityUrl}")
|
||||
else:
|
||||
receiveInviteJoinAward(token, awardId)
|
||||
rewardIndex += 1
|
||||
time.sleep(3)
|
||||
if i + 1 == len(needInviteNums):
|
||||
logger.info("🎉🎉🎉奖励全部领取完毕~")
|
||||
print("🎉🎉🎉奖励全部领取完毕~")
|
||||
sys.exit()
|
||||
time.sleep(1)
|
||||
inviterCode = setMixNick0
|
||||
@ -482,12 +482,12 @@ if __name__ == '__main__':
|
||||
continue
|
||||
else:
|
||||
errorMsg1 = inviteSuccNum
|
||||
# logger.info("num != 1", errorMsg1)
|
||||
# print("num != 1", errorMsg1)
|
||||
if "跳开卡页面" not in errorMsg1:
|
||||
if "已成功邀请您加入本店会员" in errorMsg1:
|
||||
logger.info("⛈已经是会员了,无法完成助力")
|
||||
print("⛈已经是会员了,无法完成助力")
|
||||
else:
|
||||
logger.info(f"🛳{errorMsg1}")
|
||||
print(f"🛳{errorMsg1}")
|
||||
time.sleep(1)
|
||||
continue
|
||||
time.sleep(1.5)
|
||||
@ -495,16 +495,16 @@ if __name__ == '__main__':
|
||||
checkTokenInSession(token)
|
||||
time.sleep(1)
|
||||
shopmember(cookie)
|
||||
logger.info("现在去开卡")
|
||||
print("现在去开卡")
|
||||
open_result = bindWithVender(cookie)
|
||||
if open_result is not None:
|
||||
if "火爆" in open_result:
|
||||
time.sleep(1.5)
|
||||
logger.info("\t尝试重新入会 第1次")
|
||||
print("\t尝试重新入会 第1次")
|
||||
open_result = bindWithVender(cookie)
|
||||
if "火爆" in open_result:
|
||||
time.sleep(1.5)
|
||||
logger.info("\t尝试重新入会 第2次")
|
||||
print("\t尝试重新入会 第2次")
|
||||
open_result = bindWithVender(cookie)
|
||||
time.sleep(1)
|
||||
if num == 1:
|
||||
@ -513,15 +513,15 @@ if __name__ == '__main__':
|
||||
time.sleep(2)
|
||||
recordActPvUvdata(token)
|
||||
checkTokenInSession(token)
|
||||
# logger.info(errorMsg2, '============================')
|
||||
# print(errorMsg2, '============================')
|
||||
if num == 1 and "开卡失败" in errorMsg2:
|
||||
logger.info(f"⚠️车头疑似火爆号,退出本程序!")
|
||||
print(f"⚠️车头疑似火爆号,退出本程序!")
|
||||
sys.exit()
|
||||
if "已成功邀请您加入本店会员" in errorMsg2:
|
||||
inviteSuccNums += 1
|
||||
logger.info(f"🛳已经邀请{inviteSuccNums}人")
|
||||
print(f"🛳已经邀请{inviteSuccNums}人")
|
||||
for i, needNum1 in enumerate(needInviteNums):
|
||||
# logger.info(i, needNum1)
|
||||
# print(i, needNum1)
|
||||
needNum = needNum1[0]
|
||||
awardId = needNum1[1]
|
||||
equityType = needNum1[2]
|
||||
@ -529,7 +529,7 @@ if __name__ == '__main__':
|
||||
if rewardIndex >= i + 1:
|
||||
time.sleep(1)
|
||||
continue
|
||||
logger.info(f"🎉恭喜已完成第{i + 1}档邀请,快去领奖吧!")
|
||||
print(f"🎉恭喜已完成第{i + 1}档邀请,快去领奖吧!")
|
||||
token = getToken(firstCk, r)
|
||||
activityCookie = getActivity(1, 0, inviterCode, 3)
|
||||
setMixNick(token)
|
||||
@ -537,13 +537,13 @@ if __name__ == '__main__':
|
||||
recordActPvUvdata(token)
|
||||
time.sleep(0.5)
|
||||
if equityType == "JD_GOODS":
|
||||
logger.info(f"\t🎉🎉成功获得实物奖励,请尽快前往领取:{activityUrl}")
|
||||
print(f"\t🎉🎉成功获得实物奖励,请尽快前往领取:{activityUrl}")
|
||||
else:
|
||||
receiveInviteJoinAward(token, awardId)
|
||||
rewardIndex += 1
|
||||
time.sleep(3)
|
||||
if i + 1 == len(needInviteNums):
|
||||
logger.info("🎉🎉🎉奖励全部领取完毕~")
|
||||
print("🎉🎉🎉奖励全部领取完毕~")
|
||||
sys.exit()
|
||||
if num == 1:
|
||||
inviterCode = setMixNick0
|
||||
|
254
jd_tanwei.js
Normal file
254
jd_tanwei.js
Normal file
File diff suppressed because one or more lines are too long
28
jd_try.js
28
jd_try.js
@ -1,16 +1,15 @@
|
||||
/*
|
||||
* 2022-07-20 修复获取试用列表风控问题;
|
||||
* 2022-08-12 修复申请试用风控,更换nolan接口
|
||||
* 如需运行请自行添加环境变量:JD_TRY,值填 true 即可运行
|
||||
* 上一作者说了每天最多300个商店,总上限为500个,jd_unsubscribe.js我已更新为批量取关版
|
||||
* 请提前取关至少250个商店确保京东试用脚本正常运行
|
||||
* By https://github.com/6dylan6/jdpro/
|
||||
* 基于X1a0He版本修改
|
||||
* @Address: https://github.com/X1a0He/jd_scripts_fixed/blob/main/jd_try_xh.js
|
||||
|
||||
如需运行请自行添加环境变量:JD_TRY="true" 即可运行
|
||||
脚本是否耗时只看args_xh.maxLength的大小(申请数量),默认50个,申请100个差不多15分钟
|
||||
上一作者说每天申请上限300个(自测,没有申请过上限),关注店铺上限500个
|
||||
关注店铺满了就无法继续申请,可用批量取关店铺取消关注
|
||||
|
||||
部分环境变量说明,详细请参考58行往下:
|
||||
export JD_TRY="true"是否允许,默认false
|
||||
export JD_TRY_PASSZC="false" #不过滤种草官类试用,默认true过滤
|
||||
export JD_TRY_MAXLENGTH="50" #商品数组的最大长度,默认50个
|
||||
export JD_TRY_PRICE="XX"#商品原价格,大于XX才申请,默认20
|
||||
@ -19,13 +18,13 @@ export JD_TRY_APPLYNUMFILTER="10000" #过滤大于设定值的已申请人数
|
||||
export JD_TRY_MINSUPPLYNUM="1" #最小提供数量
|
||||
export JD_TRY_SENDNUM="10" #每隔多少账号发送一次通知,默认为4
|
||||
export JD_TRY_UNIFIED="false" 默认采用不同试用组
|
||||
export JD_TRY_NUM="7" 最多跑多少个CK,默认10
|
||||
export JD_TRY_NUM="5" 最多跑多少个CK,默认10
|
||||
|
||||
cron "1 1 1 1 1" jd_try.js
|
||||
定时自定义,能用多久随缘了!!!
|
||||
*/
|
||||
|
||||
const $ = new Env('京东试用')
|
||||
const URL = 'https://api.m.jd.com/client.action'
|
||||
|
||||
let trialActivityIdList = []
|
||||
let trialActivityTitleList = []
|
||||
let notifyMsg = ''
|
||||
@ -41,18 +40,19 @@ $.getNum = 0;
|
||||
$.try = true;
|
||||
$.sentNum = 0;
|
||||
$.cookiesArr = []
|
||||
//默认的过滤关键词
|
||||
$.innerKeyWords =
|
||||
[
|
||||
"幼儿园", "教程", "英语", "辅导", "培训",
|
||||
"孩子", "小学", "成人用品", "套套", "情趣",
|
||||
"自慰", "阳具", "飞机杯", "男士用品", "女士用品",
|
||||
"内衣", "高潮", "避孕", "乳腺", "肛塞", "肛门",
|
||||
"宝宝", "玩具", "芭比", "娃娃", "男用",
|
||||
"宝宝", "芭比", "娃娃", "男用",
|
||||
"女用", "神油", "足力健", "老年", "老人",
|
||||
"宠物", "饲料", "丝袜", "黑丝", "磨脚",
|
||||
"脚皮", "除臭", "性感", "内裤", "跳蛋",
|
||||
"安全套", "龟头", "阴道", "阴部", "手机卡", "电话卡", "流量卡",
|
||||
"玉坠","和田玉","习题","试卷","手机壳","钢化膜"
|
||||
"习题", "试卷",
|
||||
]
|
||||
//下面很重要,遇到问题请把下面注释看一遍再来问
|
||||
let args_xh = {
|
||||
@ -187,7 +187,8 @@ let args_xh = {
|
||||
!(async () => {
|
||||
await $.wait(500)
|
||||
// 如果你要运行京东试用这个脚本,麻烦你把环境变量 JD_TRY 设置为 true
|
||||
if (1) {
|
||||
if (process.env.JD_TRY && process.env.JD_TRY === 'true') {
|
||||
$.log('\n遇到问题请先看脚本内注释;解决不了可联系https://t.me/dylan_jdpro\n');
|
||||
await requireConfig()
|
||||
if (!$.cookiesArr[0]) {
|
||||
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {
|
||||
@ -203,7 +204,7 @@ let args_xh = {
|
||||
$.index = i + 1;
|
||||
$.isLogin = true;
|
||||
$.nickName = '';
|
||||
//await totalBean();
|
||||
await totalBean();
|
||||
console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`);
|
||||
$.except = false;
|
||||
if (args_xh.except.includes($.UserName)) {
|
||||
@ -729,7 +730,8 @@ function geth5st(body) {
|
||||
}),
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
},
|
||||
timeout: 30000,
|
||||
},str='';
|
||||
return new Promise((resolve) => {
|
||||
$.post(opt, (err, resp, data) => {
|
||||
|
48
utils/jdCookie.py
Normal file
48
utils/jdCookie.py
Normal file
@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2022/7/6 23:00
|
||||
# @Author : HarbourJ
|
||||
# @TG : https://t.me/HarbourToulu
|
||||
# @File : jdCookie.py
|
||||
|
||||
import os
|
||||
import time
|
||||
from functools import partial
|
||||
print = partial(print, flush=True)
|
||||
|
||||
|
||||
def get_cookies():
|
||||
CookieJDs = []
|
||||
if os.environ.get("JD_COOKIE"):
|
||||
print("已获取并使用Env环境 Cookie")
|
||||
if '&' in os.environ["JD_COOKIE"]:
|
||||
CookieJDs = os.environ["JD_COOKIE"].split('&')
|
||||
elif '\n' in os.environ["JD_COOKIE"]:
|
||||
CookieJDs = os.environ["JD_COOKIE"].split('\n')
|
||||
else:
|
||||
CookieJDs = [os.environ["JD_COOKIE"]]
|
||||
# return CookieJDs
|
||||
else:
|
||||
if os.path.exists("JD_COOKIE.txt"):
|
||||
with open("JD_COOKIE.txt", 'r') as f:
|
||||
JD_COOKIEs = f.read().strip()
|
||||
if JD_COOKIEs:
|
||||
if '&' in JD_COOKIEs:
|
||||
CookieJDs = JD_COOKIEs.split('&')
|
||||
elif '\n' in JD_COOKIEs:
|
||||
CookieJDs = JD_COOKIEs.split('\n')
|
||||
else:
|
||||
CookieJDs = [JD_COOKIEs]
|
||||
CookieJDs = sorted(set(CookieJDs), key=CookieJDs.index)
|
||||
# return CookieJDs
|
||||
else:
|
||||
print("未获取到正确✅格式的京东账号Cookie")
|
||||
return
|
||||
|
||||
print(f"====================共{len(CookieJDs)}个京东账号Cookie=========\n")
|
||||
print(f"==================脚本执行- 北京时间(UTC+8):{time.strftime('%Y/%m/%d %H:%M:%S', time.localtime())}=====================\n")
|
||||
return CookieJDs
|
||||
|
||||
# if __name__ == "__main__":
|
||||
# get_cookies()
|
||||
# print(os.environ.get("JD_COOKIE"))
|
Loading…
Reference in New Issue
Block a user