This commit is contained in:
Faker
2022-03-07 16:05:23 +08:00
parent fae0e1ef98
commit aba43b2218
5 changed files with 2121 additions and 61 deletions

941
gua_opencard115.js Normal file

File diff suppressed because one or more lines are too long

786
gua_opencard117.js Normal file

File diff suppressed because one or more lines are too long

337
jd_ghnsjd.js Normal file

File diff suppressed because one or more lines are too long

View File

@@ -25,8 +25,8 @@ let message = '', allMessage = '';
//IOS等用户直接用NobyDa的jd cookie
let cookiesArr = [], cookie = '';
const JD_API_HOST = 'https://api.m.jd.com/client.action';
let appIdArr = ["1GFNRxq8","1GVFUx6g", "1E1xZy6s", "1GVJWyqg","1GFRRyqo"];
let appNameArr = ["新年宠粉","JOY年味之旅","PLUS生活特权", "虎娃迎福","过新潮年"];
let appIdArr = ['1EFRQwA','1FFVQyqw','1E1xZy6s'];
let appNameArr = ['疯狂砸金蛋','1111点心动','PLUS生活特权'];
let appId, appName;
$.shareCode = [];
if ($.isNode()) {
@@ -72,18 +72,13 @@ if ($.isNode()) {
if ($.isNode()) await notify.sendNotify($.name, allMessage);
$.msg($.name, '', allMessage)
}
let res = await getAuthorShareCode('')
let res = await getAuthorShareCode('https://raw.githubusercontent.com/Aaron-lv/updateTeam/master/shareCodes/wish.json')
if (!res) {
$.http.get({url: ''}).then((resp) => {}).catch((e) => console.log('刷新CDN异常', e));
$.http.get({url: 'https://purge.jsdelivr.net/gh/Aaron-lv/updateTeam@master/shareCodes/wish.json'}).then((resp) => {}).catch((e) => console.log('刷新CDN异常', e));
await $.wait(1000)
res = await getAuthorShareCode('')
res = await getAuthorShareCode('https://cdn.jsdelivr.net/gh/Aaron-lv/updateTeam@master/shareCodes/wish.json')
}
let res2 = await getAuthorShareCode('')
if (!res2) {
await $.wait(1000)
res2 = await getAuthorShareCode('')
}
$.shareCode = [...$.shareCode, ...(res || []), ...(res2 || [])]
$.shareCode = [...$.shareCode, ...(res || [])]
for (let i = 0; i < cookiesArr.length; i++) {
if (cookiesArr[i]) {
cookie = cookiesArr[i];

View File

@@ -14,7 +14,7 @@ const querystring = require('querystring');
const exec = require('child_process').exec;
const $ = new Env();
const timeout = 15000; //超时时间(单位毫秒)
console.log("加载sendNotify当前版本: 20220302");
console.log("加载sendNotify当前版本: 20220306");
// =======================================go-cqhttp通知设置区域===========================================
//gobot_url 填写请求地址http://127.0.0.1/send_private_msg
//gobot_token 填写在go-cqhttp文件设置的访问密钥
@@ -1972,57 +1972,58 @@ function BarkNotify(text, desp, params = {}) {
}
function tgBotNotify(text, desp) {
return new Promise((resolve) => {
return new Promise(resolve => {
if (TG_BOT_TOKEN && TG_USER_ID) {
const options = {
url: `https://${TG_API_HOST}/bot${TG_BOT_TOKEN}/sendMessage`,
body: `chat_id=${TG_USER_ID}&text=${text}\n\n${desp}&disable_web_page_preview=true`,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
json: {
chat_id: `${TG_USER_ID}`,
text: `${text}\n\n${desp}`,
disable_web_page_preview:true,
},
timeout,
};
headers: {
'Content-Type': 'application/json',
},
timeout
}
if (TG_PROXY_HOST && TG_PROXY_PORT) {
const tunnel = require('tunnel');
const tunnel = require("tunnel");
const agent = {
https: tunnel.httpsOverHttp({
proxy: {
host: TG_PROXY_HOST,
port: TG_PROXY_PORT * 1,
proxyAuth: TG_PROXY_AUTH,
},
}),
};
Object.assign(options, {
agent
});
proxyAuth: TG_PROXY_AUTH
}
})
}
Object.assign(options, {agent})
}
$.post(options, (err, resp, data) => {
try {
if (err) {
console.log('telegram发送通知消息失败\n');
console.log('telegram发送通知消息失败\n')
console.log(err);
} else {
data = JSON.parse(data);
if (data.ok) {
console.log('Telegram发送通知消息成功🎉。\n');
console.log('Telegram发送通知消息成功<EFBFBD>。\n')
} else if (data.error_code === 400) {
console.log('请主动给bot发送一条消息并检查接收用户ID是否正确。\n');
console.log('请主动给bot发送一条消息并检查接收用户ID是否正确。\n')
} else if (data.error_code === 401) {
console.log('Telegram bot token 填写错误。\n');
console.log('Telegram bot token 填写错误。\n')
}
}
} catch (e) {
$.logErr(e, resp);
}
finally {
} finally {
resolve(data);
}
});
})
} else {
resolve();
resolve()
}
});
})
}
function ddBotNotify(text, desp) {