|
|
@@ -32,10 +32,11 @@ const GandartConstKey = {
|
|
|
CollectionCateLst: 'lkGandartCollectionCateLst',
|
|
|
FloatPriceIntaval: 'lkGandartFloatPriceIntaval',
|
|
|
IsCollectionWatchLocked: 'lkIsGandartCollectionWatchLocked',
|
|
|
+ PrivWalletListInUse: 'lkGandartPrivWalletListInUse',
|
|
|
};
|
|
|
|
|
|
let gandartToken = lk.getVal(GandartConstKey.Token, '');
|
|
|
-
|
|
|
+let gandartUserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1`;
|
|
|
const GCommonGandartHeads = {
|
|
|
'Accept': `application/json, text/plain, */*`,
|
|
|
'Origin': `https://www.gandart.com`,
|
|
|
@@ -43,12 +44,13 @@ const GCommonGandartHeads = {
|
|
|
'Content-Type': `application/x-www-form-urlencoded;charset=UTF-8`,
|
|
|
'Connection': `keep-alive`,
|
|
|
'Host': `api2.gandart.com`,
|
|
|
- 'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1`,
|
|
|
+ 'User-Agent': gandartUserAgent,
|
|
|
'Referer': `https://www.gandart.com/`,
|
|
|
'Accept-Language': `zh-CN,zh-Hans;q=0.9`,
|
|
|
'token': gandartToken
|
|
|
};
|
|
|
|
|
|
+let gandartWalletList = 'A,B,C';
|
|
|
if (!lk.isExecComm) {
|
|
|
if (!lk.isRequest()) {
|
|
|
all();
|
|
|
@@ -97,6 +99,7 @@ async function all() {
|
|
|
lk.prependNotifyInfo('⚠️请设置光予监控价格');
|
|
|
hasNeedSendNotify = true;
|
|
|
} else {
|
|
|
+ gandartWalletList = getCurWalletListInUse();
|
|
|
let itemLst = await refreshLstOnSale(castingId, price);
|
|
|
if (itemLst && itemLst.length > 0) {
|
|
|
hasNeedSendNotify = await checkToBuyAll(itemLst);
|
|
|
@@ -111,6 +114,15 @@ async function all() {
|
|
|
lk.done();
|
|
|
}
|
|
|
|
|
|
+function getCurWalletListInUse() {
|
|
|
+ let str = lk.getVal(GandartConstKey.PrivWalletListInUse);
|
|
|
+ let ret = 'A,B,C';
|
|
|
+ if (!lk.isEmpty(str)) {
|
|
|
+ ret = str;
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
async function refreshLstOnSale(castingId, price, pageSize = 15, page = 1) {
|
|
|
return new Promise((resolve, _reject) => {
|
|
|
try {
|
|
|
@@ -180,13 +192,29 @@ async function refreshLstOnSale(castingId, price, pageSize = 15, page = 1) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+function checkIsInPrivWalletList(item) {
|
|
|
+ let walletList = item.walletList;
|
|
|
+ for (let w of walletList) {
|
|
|
+ if (gandartWalletList.indexOf(w) > -1) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
async function checkToBuyAll(itemLst) {
|
|
|
let ret = false;
|
|
|
let count = Math.min(1, itemLst.length);
|
|
|
for (let i = 0; i < count; i++) {
|
|
|
- let succItem = await checkToBuyCollection(itemLst[i]);
|
|
|
- if (succItem) {
|
|
|
- ret = true;
|
|
|
+ const info = itemLst[i];
|
|
|
+ if (checkIsInPrivWalletList(info)) {
|
|
|
+ let succItem = await checkToBuyCollection(info);
|
|
|
+ if (succItem) {
|
|
|
+ ret = true;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ lk.log(`[${info.collectionName}#${info.viewSort}]排除在个人使用钱包(${gandartWalletList})范围内`);
|
|
|
}
|
|
|
}
|
|
|
return ret;
|