This commit is contained in:
Faker 2022-08-10 02:40:51 +08:00
parent cce1758529
commit ea994fdaf3
12 changed files with 157 additions and 396 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,50 +1,17 @@
/* /*
cron 45 0 0,23 * * * jd_dpqd.js 店铺签到各类店铺签到有新的店铺直接添加token即可
店铺签到店铺Token默认从本地环境变量DPQDTK中获取若本地无则从远端获取 ============Quantumultx===============
[task_local]
Fix by HarbourJ #店铺签到
TG: https://t.me/HarbourToulu 15 2,14 * * * https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_shop_sign.js, tag=店铺签到, enabled=true
===========Loon============
环境变量: [Script]
DPQDTK: token1&token2 cron "15 2,14 * * *" script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_shop_sign.js,tag=店铺签到
仓库不再提供token ============Surge=============
店铺签到 = type=cron,cronexp="15 2,14 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_shop_sign.js
===========小火箭========
店铺签到 = type=cron,script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_shop_sign.jss, cronexpr="15 2,14 * * *", timeout=3600, enable=true
*/ */
let token = []
if (process.env.DPQDTK) {
if (process.env.DPQDTK.includes('\n')) {
token = [...process.env.DPQDTK.split('\n'),...token]
} else {
token = [...process.env.DPQDTK.split('&'),...token]
}
}
if (!token.length) {
console.log('无本地店铺签到token, 尝试获取远端店铺签到token')
token = [
'466E9758EF90135CC36DDE1D804FA682',
'8BFBEC50A0469627A70E706579855B25',
'30D17316E31067004ED239DE9F121B0D',
'D727A06C3B3DF203AF5D21510B771D07',
'BFB7666B6F4D0B84186E7D696A336AF5',
'A089EC2740E6586A7A19FB4F3680A596',
'91DF93C32D9AA63043391C00C14431EE',
'04CC7B1B2CBB41F9B38D0E2EAF5A9FA6',
'01C00A4AFCA19D25D8034E4802BA4F4D',
'82052AC19BA3734BF2F5E7E91B283537',
'0B1AFEE9351871A130FB9823F9C70F69',
'96F2392DACD1DC4603F3E090792C9AEC',
'D09126C24A62EA49DEDD538D4D85F6A7',
'8D650ABF6E6BE3C3C20715CA02434670',
'E6C5F271F81BE651D01372C6BB826446',
'5E75F128888B2002D54A69A92BCE64AB',
'FF584AB3FBCB3C7C4F75BE0ACFAD184C',
'BCBF4EE738A35FFC62745CB7FD5FFE12',
'19DB0FE23AA9DC4864A9375CB7526362',
'AF71DCCF9801F55C06D1EDB1E5D5C32A',
]
}
console.log(token)
const $ = new Env('店铺签到'); const $ = new Env('店铺签到');
const notify = $.isNode() ? require('./sendNotify') : ''; const notify = $.isNode() ? require('./sendNotify') : '';
//Node.js用户请在jdCookie.js处填写京东ck; //Node.js用户请在jdCookie.js处填写京东ck;
@ -57,6 +24,28 @@ let activityId=''
let vender='' let vender=''
let num=0 let num=0
let shopname='' let shopname=''
const token = [
"7B5E686A0CAF1C144620A3FFE04AFF1E",
"D6DE2273ED07EED57D079E51DE5598C6",
"A1577946DE409D3AC4B4FDCFF4681625",
"E0087463F85940305DCA705308208EBB",
"773D63918C47D32F33DDB2FB78C5820A",
"A4575EEAD847275FCB7FFD84D3E06653",
"F33A1D9D66CD2D5DDD1C4FDE085C4EC8",
"DA71409388CE531378225A6BBF96CDFE",
"47ACA3B503B829CA49AFC1A65093A549",
"FCE2BE8AD2AD8A8C98ED32D256EDD006",
"3ACBEC88453BD0AEC2B61FC7C59E5128",
"A6D7A29DB6C46B7D3F7CD6EC3AE110C6",
"F9E7DBB640BB2094C6A7755066DCE5CA",
"30D17316E31067004ED239DE9F121B0D",
"F7E1FFA5BF5930EAF5A015390451C5F6",
"D35923E942C11178C38BD29E783695B8",
"0711FD47931639CCEF919E64FF6DC89B",
"8CC487234D54778E2F1C738C79B397BA",
"500B9537712BD828EFC8C4D036B9752A",
"D082916926793D99220819F05914C94F"
]
if ($.isNode()) { if ($.isNode()) {
Object.keys(jdCookieNode).forEach((item) => { Object.keys(jdCookieNode).forEach((item) => {
@ -86,7 +75,7 @@ if ($.isNode()) {
$.isLogin = true; $.isLogin = true;
$.nickName = ''; $.nickName = '';
message = ''; message = '';
await TotalBean(); //await TotalBean();
console.log(`\n******开始【京东账号${$.index}${$.nickName || $.UserName}*********\n`); console.log(`\n******开始【京东账号${$.index}${$.nickName || $.UserName}*********\n`);
if (!$.isLogin) { if (!$.isLogin) {
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});

26
jd_fcwb_nolan.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

11
jd_moxigame.js Normal file

File diff suppressed because one or more lines are too long

15
jd_opencard_jss.js Normal file

File diff suppressed because one or more lines are too long

16
jd_txgzyl.js Normal file

File diff suppressed because one or more lines are too long

16
jd_wxCartKoi.js Normal file

File diff suppressed because one or more lines are too long

17
jd_wxCollectCard.js Normal file

File diff suppressed because one or more lines are too long

146
jd_xmf.js
View File

@ -19,7 +19,7 @@ cron "30 3,20 * * *" script-path=jd_xmf.js, tag=京东小魔方
============小火箭========= ============小火箭=========
京东小魔方 = type=cron,script-path=jd_xmf.js, cronexpr="30 3,20 * * *", timeout=3600, enable=true 京东小魔方 = type=cron,script-path=jd_xmf.js, cronexpr="30 3,20 * * *", timeout=3600, enable=true
*/ */
const $ = new Env('京东小魔方-LingFeng自用版'); const $ = new Env('京东小魔方');
const notify = $.isNode() ? require('./sendNotify') : ''; const notify = $.isNode() ? require('./sendNotify') : '';
//Node.js用户请在jdCookie.js处填写京东ck; //Node.js用户请在jdCookie.js处填写京东ck;
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
@ -27,34 +27,16 @@ const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
let cookiesArr = [], cookie = ''; let cookiesArr = [], cookie = '';
var timestamp = Math.round(new Date().getTime()).toString(); var timestamp = Math.round(new Date().getTime()).toString();
$.shareCodes = []; $.shareCodes = [];
let jdLogUrl = process.env.JD_LOG_URL ?? "" let jdLogUrl = process.env.JD_LOG_URL ?? "http://106.126.11.114:5889/log"
let logNums = process.env.LOG_NUMS ? Number(process.env.LOG_NUMS) : 100
let RabbitUrl = process.env.Rabbit_Url ?? ""; // logurl
let jdPandaToken = '';
let jdLogsArr=[];
jdPandaToken = $.isNode() ? (process.env.jdPandaToken ? process.env.jdPandaToken : `${jdPandaToken}`) : ($.getdata('jdPandaToken') ? $.getdata('jdPandaToken') : `${jdPandaToken}`);
// if (!jdPandaToken && !RabbitUrl){
// console.log(`请填写Panda获取的Token,变量是jdPandaToken 或者填写Rabbit获取的logurl变量是Rabbit_Url`)
// return;
// }
var logs;
!(async () => { !(async () => {
await requireConfig() await requireConfig()
if(jdLogUrl){
let res = await getJdLogs(jdLogUrl)
jdLogsArr = [...jdLogsArr,...(res || [])]
}
if (jdLogsArr.length == 0){
console.log(`提醒: log为空,脚本停止运行!`)
return
}
if (!cookiesArr[0]) { if (!cookiesArr[0]) {
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" }); $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
return; return;
} }
UUID = getUUID('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); UUID = getUUID('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
UA = `jdapp;iPhone;10.0.8;14.6;${UUID};network/wifi;JDEbook/openapp.jdreader;model/iPhone9,2;addressid/2214222493;appBuild/168841;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16E158;supportJDSHWK/1`;
for (let i = 0; i < cookiesArr.length; i++) { for (let i = 0; i < cookiesArr.length; i++) {
UA = `jdapp;iPhone;10.0.8;14.6;${UUID};network/wifi;JDEbook/openapp.jdreader;model/iPhone9,2;addressid/2214222493;appBuild/168841;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16E158;supportJDSHWK/1`;
if (cookiesArr[i]) { if (cookiesArr[i]) {
cookie = cookiesArr[i]; cookie = cookiesArr[i];
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
@ -73,16 +55,14 @@ var logs;
continue continue
} }
await main() await main()
await $.wait(1500)
} }
} }
})().catch((e) => { $.log('', `${$.name}, 失败! 原因: ${e}!`, '') }).finally(() => { $.done(); }) })().catch((e) => { $.log('', `${$.name}, 失败! 原因: ${e}!`, '') }).finally(() => { $.done(); })
async function main() { async function main() {
await getInteractionHomeInfo(); await getInteractionHomeInfo();
await $.wait(1500) await $.wait(500)
await queryInteractiveInfo($.projectId) await queryInteractiveInfo($.projectId)
await $.wait(1500)
if ($.taskList) { if ($.taskList) {
for (const vo of $.taskList) { for (const vo of $.taskList) {
if (vo.ext.extraType !== 'brandMemberList' && vo.ext.extraType !== 'assistTaskDetail') { if (vo.ext.extraType !== 'brandMemberList' && vo.ext.extraType !== 'assistTaskDetail') {
@ -99,24 +79,21 @@ async function main() {
} }
for (let vi of vo.ext.shoppingActivity ?? []) { for (let vi of vo.ext.shoppingActivity ?? []) {
if (vi.status === 1) { if (vi.status === 1) {
await $.wait(1500) await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.advId, 1)
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.advId, 1)
await $.wait(6000) await $.wait(6000)
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.advId, 0) await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.advId, 0)
} }
} }
for (let vi of vo.ext.browseShop ?? []) { for (let vi of vo.ext.browseShop ?? []) {
if (vi.status === 1) { if (vi.status === 1) {
await $.wait(1500) await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 1)
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 1)
await $.wait(6000) await $.wait(6000)
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 0) await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 0)
} }
} }
for (let vi of vo.ext.addCart ?? []) { for (let vi of vo.ext.addCart ?? []) {
if (vi.status === 1) { if (vi.status === 1) {
await $.wait(1500) await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 1)
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 1)
await $.wait(6000) await $.wait(6000)
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 0) await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 0)
} }
@ -134,8 +111,7 @@ async function main() {
async function doInteractiveAssignment(projectId, encryptAssignmentId, itemId, actionType) { async function doInteractiveAssignment(projectId, encryptAssignmentId, itemId, actionType) {
// logs = await getJinliLogs() // logs = await getJinliLogs()
// let random = logs["random"].toString(),log =logs["log"].toString() // let random = logs["random"].toString(),log =logs["log"].toString()
await $.wait(1500) await getLog();
await getLog();
let body = { "encryptProjectId": projectId, "encryptAssignmentId": encryptAssignmentId, "sourceCode": "acexinpin0823", "itemId": itemId, "actionType": actionType, "completionFlag": "", "ext": {},"extParam":{"businessData":{"random":`${random}`},"signStr":`${log}`,"sceneid":"XMFhPageh5"} } let body = { "encryptProjectId": projectId, "encryptAssignmentId": encryptAssignmentId, "sourceCode": "acexinpin0823", "itemId": itemId, "actionType": actionType, "completionFlag": "", "ext": {},"extParam":{"businessData":{"random":`${random}`},"signStr":`${log}`,"sceneid":"XMFhPageh5"} }
return new Promise(resolve => { return new Promise(resolve => {
$.post(taskPostUrl("doInteractiveAssignment", body), async (err, resp, data) => { $.post(taskPostUrl("doInteractiveAssignment", body), async (err, resp, data) => {
@ -222,7 +198,7 @@ function taskPostUrl(function_id, body) {
"Accept-Encoding": "gzip, deflate, br", "Accept-Encoding": "gzip, deflate, br",
"Connection": "keep-alive", "Connection": "keep-alive",
"Accept": "application/json, text/plain, */*", "Accept": "application/json, text/plain, */*",
"User-Agent": UA, "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88",
"Referer": "https://h5.m.jd.com/babelDiy/Zeus/2bf3XEEyWG11pQzPGkKpKX2GxJz2/index.html", "Referer": "https://h5.m.jd.com/babelDiy/Zeus/2bf3XEEyWG11pQzPGkKpKX2GxJz2/index.html",
"Cookie": cookie, "Cookie": cookie,
} }
@ -231,7 +207,7 @@ function taskPostUrl(function_id, body) {
function getJdLogs(url) { function getJdLogs(url) {
return new Promise(resolve => { return new Promise(resolve => {
const options = { const options = {
url: `${url}?${new Date()}&logNums=${logNums}`, "timeout": 10000, headers: { url: `${url}?${new Date()}`, "timeout": 10000, headers: {
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88" "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88"
} }
}; };
@ -261,115 +237,15 @@ function getJdLogs(url) {
}) })
}) })
} }
function getJinliLogs() {
if (jdPandaToken && RabbitUrl){
let nums = Math.floor(Math.random() * 9)+1;
if (nums<5){
console.info('随机从panda接口获取log!')
return pandaLogs();
}else {
console.info('随机从rabbit接口获取log!')
return rabbitLogs();
}
}
if(jdPandaToken && !RabbitUrl){
console.info('进入panda接口获取log!')
return pandaLogs();
}
if(RabbitUrl && !jdPandaToken){
console.info('进入rabbit接口获取log!')
return rabbitLogs();
}
return '';
}
function pandaLogs(){
var logs = '';
return new Promise((resolve) => {
let url = {
url: "https://api.jds.codes/jd/log",
followRedirect: false,
headers: {
'Accept': '*/*',
"accept-encoding": "gzip, deflate, br",
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + jdPandaToken
},
timeout: 30000
}
$.get(url, async(err, resp, data) => {
try {
data = JSON.parse(data);
if (data && data.code == 200) {
lnrequesttimes = data.request_times;
console.log("连接Panda服务成功当前Token使用次数为" + lnrequesttimes);
if (data.data)
logs = data.data || '';
//console.info(logs['random']+"----"+logs['log'])
if (logs != '')
resolve(logs);
else
console.log("签名获取失败,可能Token使用次数上限或被封.");
} else {
console.log("签名获取失败.");
}
}catch (e) {
$.logErr(e, resp);
}finally {
resolve(logs);
}
})
})
}
function rabbitLogs(){
var logs = '';
return new Promise((resolve) => {
let url = {
url:`${RabbitUrl}`,
followRedirect: false,
timeout: 30000
}
$.get(url, async(err, resp, data) => {
try {
data = JSON.parse(data);
if (data && data.status == 0) {
lnrequesttimes = data.request_times;
logs = {
random: data.random,
log: data.log
}
//console.info(logs['random']+"----"+logs['log'])
if (logs != '')
resolve(logs);
else
console.log("log获取失败.");
} else {
console.log("log获取失败.");
}
}catch (e) {
$.logErr(e, resp);
}finally {
resolve(logs);
}
})
})
}
async function requireConfig() { async function requireConfig() {
return new Promise(resolve => { return new Promise(resolve => {
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
const jdLogNode = $.isNode() ? require('./jdMsLogs.js') : '';
if ($.isNode()) { if ($.isNode()) {
Object.keys(jdCookieNode).forEach((item) => { Object.keys(jdCookieNode).forEach((item) => {
if (jdCookieNode[item]) { if (jdCookieNode[item]) {
cookiesArr.push(jdCookieNode[item]) cookiesArr.push(jdCookieNode[item])
} }
}) })
Object.keys(jdLogNode).forEach((item) => {
if (jdLogNode[item]) {
jdLogsArr.push(jdLogNode[item])
}
})
if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {
}; };
} else { } else {
@ -380,7 +256,7 @@ async function requireConfig() {
}) })
} }
async function getLog() { async function getLog() {
var cuid = jdLogsArr[Math.floor((Math.random()*jdLogsArr.length))]; var cuid = await getJdLogs(jdLogUrl);
log = cuid["log"]; log = cuid["log"];
random = cuid["random"]; random = cuid["random"];
} }