mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-09-03 22:02:45 +08:00
Compare commits
43 Commits
7c8dc4f847
...
3974a33844
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3974a33844 | ||
![]() |
2dc4b7d5c8 | ||
![]() |
e18570f6fb | ||
![]() |
30570be213 | ||
![]() |
dbb6fc90b8 | ||
![]() |
7607920650 | ||
![]() |
45028d66fc | ||
![]() |
2188446d1f | ||
![]() |
15d03a93de | ||
![]() |
b6582c52d6 | ||
![]() |
a00d98da06 | ||
![]() |
e7af99f7bc | ||
![]() |
443633bb5a | ||
![]() |
57014b2d98 | ||
![]() |
14f6b07114 | ||
![]() |
0a757af23d | ||
![]() |
01fa5539ce | ||
![]() |
80f7479e90 | ||
![]() |
64750129e6 | ||
![]() |
c0517d5aef | ||
![]() |
2ef501d115 | ||
![]() |
c29fc9518e | ||
![]() |
ebd15b65e4 | ||
![]() |
91575bd3eb | ||
![]() |
47f190adf6 | ||
![]() |
251f43a402 | ||
![]() |
15422263be | ||
![]() |
c4bd4030d6 | ||
![]() |
4740a2199f | ||
![]() |
4f7ef61815 | ||
![]() |
874696a627 | ||
![]() |
9b406d6697 | ||
![]() |
65b7ac0c47 | ||
![]() |
fc29ee3bcf | ||
![]() |
3824523f40 | ||
![]() |
2e5d7c71ec | ||
![]() |
547f5874b4 | ||
![]() |
fead10348d | ||
![]() |
552b9e4b02 | ||
![]() |
d5f6254a16 | ||
![]() |
82124cacc3 | ||
![]() |
bb995be6f6 | ||
![]() |
e77856d921 |
1
function/dyland.js
Normal file
1
function/dyland.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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
12
jd_10dou.js
Normal file
12
jd_10dou.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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
6
jd_daka_bean.js
Normal file
6
jd_daka_bean.js
Normal file
File diff suppressed because one or more lines are too long
15
jd_daycj.js
Normal file
15
jd_daycj.js
Normal file
File diff suppressed because one or more lines are too long
11
jd_dayf.js
Normal file
11
jd_dayf.js
Normal file
File diff suppressed because one or more lines are too long
14
jd_dayf2.js
Normal file
14
jd_dayf2.js
Normal file
File diff suppressed because one or more lines are too long
7
jd_dddraw.js
Normal file
7
jd_dddraw.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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
18
jd_dplh0617.js
Normal file
18
jd_dplh0617.js
Normal file
File diff suppressed because one or more lines are too long
19
jd_dplh0701.js
Normal file
19
jd_dplh0701.js
Normal file
File diff suppressed because one or more lines are too long
19
jd_dplh0714.js
Normal file
19
jd_dplh0714.js
Normal file
File diff suppressed because one or more lines are too long
16
jd_dwapp.js
16
jd_dwapp.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
7
jd_fdshkj.js
Normal file
7
jd_fdshkj.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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
7
jd_fs_sign.js
Normal file
7
jd_fs_sign.js
Normal file
File diff suppressed because one or more lines are too long
7
jd_green.js
Normal file
7
jd_green.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
7
jd_hlw_draw.js
Normal file
7
jd_hlw_draw.js
Normal file
File diff suppressed because one or more lines are too long
8
jd_joypark_leave.js
Normal file
8
jd_joypark_leave.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
14
jd_jrsign.js
14
jd_jrsign.js
File diff suppressed because one or more lines are too long
6
jd_jxzy_sign.js
Normal file
6
jd_jxzy_sign.js
Normal file
File diff suppressed because one or more lines are too long
15
jd_kd_dlcs.js
Normal file
15
jd_kd_dlcs.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
File diff suppressed because one or more lines are too long
7
jd_lmdraw.js
Normal file
7
jd_lmdraw.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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
11
jd_market_answer.js
Normal file
11
jd_market_answer.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
File diff suppressed because one or more lines are too long
7
jd_new_vote.js
Normal file
7
jd_new_vote.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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
14
jd_opencard_0620.js
Normal file
14
jd_opencard_0620.js
Normal file
File diff suppressed because one or more lines are too long
6
jd_plantBean_help.js
Normal file
6
jd_plantBean_help.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
15
jd_quanyi_sign.js
Normal file
15
jd_quanyi_sign.js
Normal file
File diff suppressed because one or more lines are too long
7
jd_sldraw.js
Normal file
7
jd_sldraw.js
Normal file
File diff suppressed because one or more lines are too long
7
jd_taskgBean.js
Normal file
7
jd_taskgBean.js
Normal file
File diff suppressed because one or more lines are too long
18
jd_tjfb.js
Normal file
18
jd_tjfb.js
Normal file
File diff suppressed because one or more lines are too long
20
jd_tjfb_help.js
Normal file
20
jd_tjfb_help.js
Normal file
File diff suppressed because one or more lines are too long
149
jd_try.js
149
jd_try.js
@ -115,7 +115,7 @@ let args_xh = {
|
||||
* C商品原价99元,试用价1元,如果下面设置为50,那么C商品将会被加入到待提交的试用组
|
||||
* 默认为0
|
||||
* */
|
||||
jdPrice: process.env.JD_TRY_PRICE * 1 || 20,
|
||||
jdPrice: process.env.JD_TRY_PRICE * 1 || 10,
|
||||
/*
|
||||
* 下面有一个function是可以获取tabId列表,名为try_tabList
|
||||
* 可设置环境变量:JD_TRY_TABID,用@进行分隔
|
||||
@ -138,7 +138,7 @@ let args_xh = {
|
||||
* C商品原价49元,现在试用价1元,如果下面设置为1,那C商品也会被添加到带提交试用组,因为1 = 1
|
||||
* 可设置环境变量:JD_TRY_TRIALPRICE,默认为0
|
||||
* */
|
||||
trialPrice: process.env.JD_TRY_TRIALPRICE * 1 || 0,
|
||||
trialPrice: process.env.JD_TRY_TRIALPRICE * 1 || 0.01,
|
||||
/*
|
||||
* 最小提供数量,例如试用商品只提供2份试用资格,当前设置为1,则会进行申请
|
||||
* 若只提供5分试用资格,当前设置为10,则不会申请
|
||||
@ -275,7 +275,7 @@ let args_xh = {
|
||||
}
|
||||
await try_apply(trialActivityTitleList[i], trialActivityIdList[i]);
|
||||
console.log(`间隔等待中,请等待15秒 \n`);
|
||||
await $.wait(150000);
|
||||
await $.wait(15000);
|
||||
}
|
||||
console.log('试用申请执行完毕...');
|
||||
$.giveupNum = 0;
|
||||
@ -594,19 +594,23 @@ async function initJsToken() {
|
||||
async function try_feedsList(tabId, page) {
|
||||
const sign = await h5stSign(
|
||||
{
|
||||
functionId: 'try_SpecFeedList',
|
||||
functionId: 'qryH5BabelFloors',
|
||||
appid: 'newtry',
|
||||
body: {
|
||||
tabId: String(tabId),
|
||||
page: Number(page),
|
||||
version: 2,
|
||||
source: 'default',
|
||||
client: 'outer',
|
||||
activityId: '3C751WNneAUaZ8Lw8xYN7cbSE8gm',
|
||||
pageId: '5457569',
|
||||
uuid: '',
|
||||
queryFloorsParam: {
|
||||
floorParams: { 115571575: { tabId: tabId, page: page, source: 'lottery', sessionId: 'b5a86af7e7524b50b38e66d1c96cc244' } },
|
||||
type: 2,
|
||||
},
|
||||
siteClient: 'apple',
|
||||
siteClientVersion: '12.4.1',
|
||||
},
|
||||
'x-api-eid-token': $.jsToken,
|
||||
},
|
||||
'35fa0',
|
||||
);
|
||||
'35fa0'
|
||||
)
|
||||
|
||||
try {
|
||||
const { data } = await api({
|
||||
@ -621,111 +625,126 @@ async function try_feedsList(tabId, page) {
|
||||
'x-rp-client': 'h5_1.0.0',
|
||||
},
|
||||
data: sign.qs,
|
||||
});
|
||||
})
|
||||
|
||||
let tempKeyword = ``;
|
||||
if (data.code === '0') {
|
||||
console.log(`第 ${size++} 次获取试用商品成功,tabId:${args_xh.tabId[$.nowTabIdIndex]} 的 第 ${page} 页`);
|
||||
console.log(`获取到商品 ${data.data.feedList.length} 条`);
|
||||
for (let item of data.data.feedList) {
|
||||
let tempKeyword = ``
|
||||
// 兼容两种结构
|
||||
let feedList, hasNext;
|
||||
if (data.data && data.data.feedList) {
|
||||
feedList = data.data.feedList;
|
||||
hasNext = data.data.hasNext;
|
||||
} else if (
|
||||
data.floorResponse &&
|
||||
data.floorResponse['115571575'] &&
|
||||
data.floorResponse['115571575'].providerData &&
|
||||
data.floorResponse['115571575'].providerData.data &&
|
||||
data.floorResponse['115571575'].providerData.data.feedsComponent
|
||||
) {
|
||||
feedList = data.floorResponse['115571575'].providerData.data.feedsComponent.feedList;
|
||||
hasNext = data.floorResponse['115571575'].providerData.data.feedsComponent.hasNext;
|
||||
}
|
||||
if (data.code === '0' && feedList) {
|
||||
console.log(`第 ${size++} 次获取试用商品成功,tabId:${args_xh.tabId[$.nowTabIdIndex]} 的 第 ${page} 页`)
|
||||
console.log(`获取到商品 ${feedList.length} 条`)
|
||||
for (let item of feedList) {
|
||||
if (item.applyNum === null) {
|
||||
args_xh.printLog ? console.log(`商品未到申请时间:${item.skuTitle}\n`) : '';
|
||||
continue;
|
||||
args_xh.printLog ? console.log(`商品未到申请时间:${item.skuTitle}\n`) : ''
|
||||
continue
|
||||
}
|
||||
if (trialActivityIdList.length >= args_xh.maxLength) {
|
||||
console.log('商品列表长度已满.结束获取');
|
||||
break;
|
||||
console.log('商品列表长度已满.结束获取')
|
||||
break
|
||||
}
|
||||
if (item.applyState === 1) {
|
||||
args_xh.printLog ? console.log(`商品已申请试用:${item.skuTitle}\n`) : '';
|
||||
continue;
|
||||
args_xh.printLog ? console.log(`商品已申请试用:${item.skuTitle}\n`) : ''
|
||||
continue
|
||||
}
|
||||
if (item.applyState !== null) {
|
||||
args_xh.printLog ? console.log(`商品状态异常,未找到skuTitle\n`) : '';
|
||||
continue;
|
||||
args_xh.printLog ? console.log(`商品状态异常,未找到skuTitle\n`) : ''
|
||||
continue
|
||||
}
|
||||
if (args_xh.passZhongCao) {
|
||||
$.isPush = true;
|
||||
$.isPush = true
|
||||
if (item.tagList.length !== 0) {
|
||||
for (let itemTag of item.tagList) {
|
||||
if (itemTag.tagType === 3) {
|
||||
args_xh.printLog ? console.log('商品被过滤,该商品是种草官专属') : '';
|
||||
$.isPush = false;
|
||||
break;
|
||||
args_xh.printLog ? console.log('商品被过滤,该商品是种草官专属') : ''
|
||||
$.isPush = false
|
||||
break
|
||||
} else if (itemTag.tagType === 5) {
|
||||
args_xh.printLog ? console.log('商品被跳过,该商品是付费试用!') : '';
|
||||
$.isPush = false;
|
||||
break;
|
||||
args_xh.printLog ? console.log('商品被跳过,该商品是付费试用!') : ''
|
||||
$.isPush = false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.skuTitle && $.isPush) {
|
||||
args_xh.printLog ? console.log(`检测 tabId:${args_xh.tabId[$.nowTabIdIndex]} 的 第 ${page} 页 第 ${$.nowItem++ + 1} 个商品\n${item.skuTitle}`) : '';
|
||||
args_xh.printLog ? console.log(`检测 tabId:${args_xh.tabId[$.nowTabIdIndex]} 的 第 ${page} 页 第 ${$.nowItem++ + 1} 个商品\n${item.skuTitle}`) : ''
|
||||
if (args_xh.whiteList) {
|
||||
if (args_xh.whiteListKeywords.some((fileter_word) => item.skuTitle.includes(fileter_word))) {
|
||||
args_xh.printLog ? console.log(`商品白名单通过,将加入试用组,trialActivityId为${item.trialActivityId}\n`) : '';
|
||||
trialActivityIdList.push(item.trialActivityId);
|
||||
trialActivityTitleList.push(item.skuTitle);
|
||||
args_xh.printLog ? console.log(`商品白名单通过,将加入试用组,trialActivityId为${item.trialActivityId}\n`) : ''
|
||||
trialActivityIdList.push(item.trialActivityId)
|
||||
trialActivityTitleList.push(item.skuTitle)
|
||||
}
|
||||
} else {
|
||||
tempKeyword = ``;
|
||||
tempKeyword = ``
|
||||
if (parseFloat(item.jdPrice) <= args_xh.jdPrice) {
|
||||
args_xh.printLog ? console.log(`商品被过滤,商品价格 ${item.jdPrice} < ${args_xh.jdPrice} \n`) : '';
|
||||
args_xh.printLog ? console.log(`商品被过滤,商品价格 ${item.jdPrice} < ${args_xh.jdPrice} \n`) : ''
|
||||
} else if (parseFloat(item.supplyNum) < args_xh.minSupplyNum && item.supplyNum !== null) {
|
||||
args_xh.printLog ? console.log(`商品被过滤,提供申请的份数小于预设申请的份数 \n`) : '';
|
||||
args_xh.printLog ? console.log(`商品被过滤,提供申请的份数小于预设申请的份数 \n`) : ''
|
||||
} else if (parseFloat(item.applyNum) > args_xh.applyNumFilter && item.applyNum !== null) {
|
||||
args_xh.printLog ? console.log(`商品被过滤,已申请人数大于预设的${args_xh.applyNumFilter}人 \n`) : '';
|
||||
args_xh.printLog ? console.log(`商品被过滤,已申请人数大于预设的${args_xh.applyNumFilter}人 \n`) : ''
|
||||
} else if (item.jdPrice === null) {
|
||||
args_xh.printLog ? console.log(`商品被过滤,商品无价,不能申请 \n`) : '';
|
||||
args_xh.printLog ? console.log(`商品被过滤,商品无价,不能申请 \n`) : ''
|
||||
} else if (parseFloat(item.trialPrice) > args_xh.trialPrice) {
|
||||
args_xh.printLog ? console.log(`商品被过滤,商品试用价大于预设试用价 \n`) : '';
|
||||
args_xh.printLog ? console.log(`商品被过滤,商品试用价大于预设试用价 \n`) : ''
|
||||
} else if (args_xh.titleFilters.some((fileter_word) => (item.skuTitle.includes(fileter_word) ? (tempKeyword = fileter_word) : ''))) {
|
||||
args_xh.printLog ? console.log(`商品被过滤,含有关键词 ${tempKeyword}\n`) : '';
|
||||
args_xh.printLog ? console.log(`商品被过滤,含有关键词 ${tempKeyword}\n`) : ''
|
||||
} else {
|
||||
args_xh.printLog ? console.log(`商品通过,加入试用组,trialActivityId为${item.trialActivityId}\n`) : '';
|
||||
args_xh.printLog ? console.log(`商品通过,加入试用组,trialActivityId为${item.trialActivityId}\n`) : ''
|
||||
if (trialActivityIdList.indexOf(item.trialActivityId) === -1) {
|
||||
trialActivityIdList.push(item.trialActivityId);
|
||||
trialActivityTitleList.push(item.skuTitle);
|
||||
trialActivityIdList.push(item.trialActivityId)
|
||||
trialActivityTitleList.push(item.skuTitle)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ($.isPush !== false) {
|
||||
console.error('skuTitle解析异常');
|
||||
return;
|
||||
console.error('skuTitle解析异常')
|
||||
return
|
||||
}
|
||||
}
|
||||
console.log(`当前试用组长度为:${trialActivityIdList.length}`);
|
||||
console.log(`下一页状态:${data.data.hasNext}`);
|
||||
if (data.data.hasNext === false) {
|
||||
console.log(`当前试用组长度为:${trialActivityIdList.length}`)
|
||||
console.log(`下一页状态:${hasNext}`)
|
||||
if (hasNext === false) {
|
||||
if ($.nowTabIdIndex < args_xh.tabId.length) {
|
||||
$.nowTabIdIndex++;
|
||||
$.nowPage = 1;
|
||||
$.nowItem = 1;
|
||||
$.retrynum = 0;
|
||||
$.nowTabIdIndex++
|
||||
$.nowPage = 1
|
||||
$.nowItem = 1
|
||||
$.retrynum = 0
|
||||
} else {
|
||||
// 这下是真的没了
|
||||
$.retrynum = 999;
|
||||
$.retrynum = 999
|
||||
}
|
||||
} else {
|
||||
$.nowPage++;
|
||||
$.retrynum = 0;
|
||||
$.nowPage++
|
||||
$.retrynum = 0
|
||||
}
|
||||
} else {
|
||||
console.log(`💩 获得试用列表失败: ${data.message}`);
|
||||
console.log(`💩 获得试用列表失败: ${data.message}`)
|
||||
}
|
||||
} catch (e) {
|
||||
if (e.message === `Request failed with status code 403`) {
|
||||
$.retrynum++;
|
||||
$.retrynum++
|
||||
if ($.retrynum === 4) {
|
||||
$.isForbidden = true;
|
||||
$.log('多次尝试失败,换个时间再试!');
|
||||
$.isForbidden = true
|
||||
$.log('多次尝试失败,换个时间再试!')
|
||||
} else {
|
||||
console.log(`403,第 ${$.retrynum} 次重试`);
|
||||
console.log(`403,第 ${$.retrynum} 次重试`)
|
||||
}
|
||||
} else {
|
||||
console.log(e.message);
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`);
|
||||
console.log(e.message)
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
13
jd_ttchb_draw.js
Normal file
13
jd_ttchb_draw.js
Normal file
File diff suppressed because one or more lines are too long
18
jd_ttthb_help.js
Normal file
18
jd_ttthb_help.js
Normal file
File diff suppressed because one or more lines are too long
7
jd_ttzd.js
Normal file
7
jd_ttzd.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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
8
jd_wduoyu.js
Normal file
8
jd_wduoyu.js
Normal file
File diff suppressed because one or more lines are too long
96
jd_wsck.py
96
jd_wsck.py
@ -42,8 +42,29 @@ def randomuserAgent():
|
||||
|
||||
|
||||
def get_proxy_api(proxy_url, max_retries=5, timeout=60, retry_delay=1):
|
||||
session = requests.Session()
|
||||
for retry in range(max_retries):
|
||||
res = get(url=proxy_url)
|
||||
if '@' in proxy_url:
|
||||
# 解析认证信息
|
||||
auth_part, url_part = proxy_url.split('@')
|
||||
protocol = auth_part.split('://')[0]
|
||||
auth_part = auth_part.split('://')[1]
|
||||
host = url_part
|
||||
|
||||
# 处理只有 token 的情况
|
||||
if ':' in auth_part:
|
||||
username, password = auth_part.split(':')
|
||||
session.auth = (username, password)
|
||||
else:
|
||||
# 只有 token 的情况,需要 base64 编码
|
||||
token = auth_part
|
||||
token_b64 = base64.b64encode(token.encode()).decode()
|
||||
session.headers.update({'Authorization': f'Basic {token_b64}'})
|
||||
|
||||
res = session.get(f"{protocol}://{host}", verify=False, timeout=timeout)
|
||||
else:
|
||||
res = session.get(proxy_url, verify=False, timeout=timeout)
|
||||
|
||||
printf(f"本次获取到的代理:{res.text}")
|
||||
proxy_ip_port = res.text.strip()
|
||||
proxy_address = f"http://{proxy_ip_port}"
|
||||
@ -242,7 +263,7 @@ def get_sign_diy(pin):
|
||||
|
||||
def getcookie_wskey(key):
|
||||
proxys = proxy_url
|
||||
if os.environ.get("WSKEY_PROXY_URL") is not None:
|
||||
if os.environ.get("DY_PROXY") is not None:
|
||||
proxys = get_proxy_api(proxy_url)
|
||||
|
||||
body = "body=%7B%22to%22%3A%22https%3A//plogin.m.jd.com/jd-mlogin/static/html/appjmp_blank.html%22%7D"
|
||||
@ -270,7 +291,7 @@ def getcookie_wskey(key):
|
||||
printf(f"【错误】{unquote(pin)}在获取token时:\n{error}")
|
||||
return pin, "False"
|
||||
randomuserAgent()
|
||||
if os.environ.get("WSKEY_PROXY_URL") is not None:
|
||||
if os.environ.get("DY_PROXY") is not None:
|
||||
proxys = get_proxy_api(proxy_url)
|
||||
continue
|
||||
|
||||
@ -280,7 +301,7 @@ def getcookie_wskey(key):
|
||||
printf(f"【警告】{unquote(pin)}在获取token时失败,等待5秒后重试")
|
||||
time.sleep(5)
|
||||
randomuserAgent()
|
||||
if os.environ.get("WSKEY_PROXY_URL") is not None:
|
||||
if os.environ.get("DY_PROXY") is not None:
|
||||
proxys = get_proxy_api(proxy_url)
|
||||
|
||||
if token=="xxx":
|
||||
@ -307,7 +328,7 @@ def getcookie_wskey(key):
|
||||
printf(f"【错误】{unquote(pin)}在获取cookie时:\n{error}")
|
||||
return "Error"
|
||||
randomuserAgent()
|
||||
if os.environ.get("WSKEY_PROXY_URL") is not None:
|
||||
if os.environ.get("DY_PROXY") is not None:
|
||||
proxys = get_proxy_api(proxy_url)
|
||||
continue
|
||||
|
||||
@ -424,34 +445,40 @@ def getRemark(pt_pin,token):
|
||||
|
||||
return strreturn
|
||||
|
||||
def get_latest_file(files):
|
||||
latest_file = None
|
||||
latest_mtime = 0
|
||||
for file in files:
|
||||
try:
|
||||
stats = os.stat(file)
|
||||
mtime = stats.st_mtime
|
||||
if mtime > latest_mtime:
|
||||
latest_mtime = mtime
|
||||
latest_file = file
|
||||
except FileNotFoundError:
|
||||
continue
|
||||
return latest_file
|
||||
|
||||
def main():
|
||||
printf("版本: 20230602")
|
||||
printf("说明: 如果用Wxpusher通知需配置WP_APP_TOKEN_ONE和WP_APP_MAIN_UID,其中WP_APP_MAIN_UID是你的Wxpusher UID")
|
||||
printf("隧道型代理池接口:export WSKEY_PROXY_TUNNRL='http://127.0.0.1:123456'")
|
||||
printf("拉取型代理API接口(数据格式:txt;提取数量:每次一个):export WSKEY_PROXY_URL='http://xxx.com/apiUrl'")
|
||||
printf("拉取型代理API接口(数据格式:txt;提取数量:每次一个):export DY_PROXY='http://xxx.com/apiUrl'")
|
||||
printf("没有代理可以自行注册,比如携趣,巨量,每日免费1000IP,完全够用")
|
||||
printf("====================================")
|
||||
config=""
|
||||
envtype=""
|
||||
global proxy_url
|
||||
proxy_url=os.environ.get("WSKEY_PROXY_URL") or os.environ.get("WSKEY_PROXY_TUNNRL") or None
|
||||
proxy_url=os.environ.get("DY_PROXY") or os.environ.get("WSKEY_PROXY_TUNNRL") or None
|
||||
iswxpusher=False
|
||||
counttime=0
|
||||
|
||||
if os.path.exists("/ql/config/auth.json"):
|
||||
config="/ql/config/auth.json"
|
||||
envtype="ql"
|
||||
if os.path.exists("/ql/data/db/keyv.sqlite"):
|
||||
config="/ql/data/db/keyv.sqlite"
|
||||
envtype="ql_latest"
|
||||
if os.path.exists("/ql/data/config/auth.json"):
|
||||
config="/ql/data/config/auth.json"
|
||||
envtype="ql"
|
||||
|
||||
if os.path.exists("/jd/config/auth.json"):
|
||||
config="/jd/config/auth.json"
|
||||
envtype="arcadia"
|
||||
|
||||
token_file_list = ['/ql/data/db/keyv.sqlite', '/ql/data/config/auth.json', '/ql/config/auth.json']
|
||||
|
||||
config = get_latest_file(token_file_list)
|
||||
envtype="ql"
|
||||
|
||||
if os.path.exists("/arcadia/config/auth.json"):
|
||||
config="/arcadia/config/auth.json"
|
||||
@ -473,7 +500,7 @@ def main():
|
||||
iswxpusher=False
|
||||
|
||||
if proxy_url is None:
|
||||
printf("没有配置代理,无法使用代理!\n请配置环境变量WSKEY_PROXY_TUNNRL或WSKEY_PROXY_URL\n")
|
||||
printf("没有配置代理,无法使用代理!\n请配置环境变量WSKEY_PROXY_TUNNRL或DY_PROXY\n")
|
||||
printf("====================================")
|
||||
else:
|
||||
printf(f"已配置代理: {proxy_url}\n")
|
||||
@ -484,8 +511,16 @@ def main():
|
||||
summary=""
|
||||
|
||||
if envtype == "ql":
|
||||
with open(config, "r", encoding="utf-8") as f1:
|
||||
token = json.load(f1)['token']
|
||||
if 'keyv' in config:
|
||||
with open(config, "r", encoding="latin1") as file:
|
||||
auth = file.read()
|
||||
matches = re.search(r'"token":"([^"]*)"(?!.*"token":)', auth)
|
||||
token = matches.group(1)
|
||||
else:
|
||||
with open(config, "r") as file:
|
||||
auth = file.read()
|
||||
auth = json.loads(auth)
|
||||
token = auth["token"]
|
||||
url = 'http://127.0.0.1:5600/api/envs'
|
||||
headers = {'Authorization': f'Bearer {token}'}
|
||||
body = {
|
||||
@ -501,20 +536,7 @@ def main():
|
||||
url = 'http://127.0.0.1:5678/openApi/count'
|
||||
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer ', 'api-token': f'{token}'}
|
||||
datas = get(url, headers=headers).json()["data"]["accountCount"]
|
||||
elif envtype == "ql_latest":
|
||||
with open(config, "r", encoding="latin1") as f1:
|
||||
content = f1.read()
|
||||
matches = re.search(r'token":"([^"]+)"', content)
|
||||
try:
|
||||
token = matches.group(1)
|
||||
except Exception as e:
|
||||
sys.exit(0)
|
||||
url = 'http://127.0.0.1:5600/api/envs'
|
||||
headers = {'Authorization': f'Bearer {token}'}
|
||||
body = {
|
||||
'searchValue': 'JD_WSCK',
|
||||
'Authorization': f'Bearer {token}'
|
||||
}
|
||||
|
||||
datas = get(url, params=body, headers=headers).json()['data']
|
||||
|
||||
|
||||
@ -524,7 +546,7 @@ def main():
|
||||
printf("\n错误:没有需要转换的JD_WSCK,退出脚本!")
|
||||
return
|
||||
|
||||
if envtype in ('ql','ql_latest'):
|
||||
if envtype in ('ql',''):
|
||||
for data in datas:
|
||||
randomuserAgent()
|
||||
if data['status']!=0:
|
||||
|
File diff suppressed because one or more lines are too long
7
jd_xinqi_draw.js
Normal file
7
jd_xinqi_draw.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
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user