mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-04-23 02:48:44 +08:00
update
This commit is contained in:
parent
cce1758529
commit
ea994fdaf3
File diff suppressed because one or more lines are too long
81
jd_dpqd.js
81
jd_dpqd.js
@ -1,50 +1,17 @@
|
||||
/*
|
||||
cron 45 0 0,23 * * * jd_dpqd.js
|
||||
店铺签到,店铺Token默认从本地环境变量DPQDTK中获取,若本地无则从远端获取。
|
||||
|
||||
Fix by HarbourJ
|
||||
TG: https://t.me/HarbourToulu
|
||||
|
||||
环境变量:
|
||||
DPQDTK: token1&token2
|
||||
仓库不再提供token
|
||||
店铺签到,各类店铺签到,有新的店铺直接添加token即可
|
||||
============Quantumultx===============
|
||||
[task_local]
|
||||
#店铺签到
|
||||
15 2,14 * * * https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_shop_sign.js, tag=店铺签到, enabled=true
|
||||
===========Loon============
|
||||
[Script]
|
||||
cron "15 2,14 * * *" script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_shop_sign.js,tag=店铺签到
|
||||
============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 notify = $.isNode() ? require('./sendNotify') : '';
|
||||
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||
@ -57,6 +24,28 @@ let activityId=''
|
||||
let vender=''
|
||||
let num=0
|
||||
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()) {
|
||||
Object.keys(jdCookieNode).forEach((item) => {
|
||||
@ -86,7 +75,7 @@ if ($.isNode()) {
|
||||
$.isLogin = true;
|
||||
$.nickName = '';
|
||||
message = '';
|
||||
await TotalBean();
|
||||
//await TotalBean();
|
||||
console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
|
||||
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"});
|
||||
|
26
jd_fcwb_nolan.js
Normal file
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
217
jd_gold_sign.js
217
jd_gold_sign.js
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
11
jd_moxigame.js
Normal file
File diff suppressed because one or more lines are too long
15
jd_opencard_jss.js
Normal file
15
jd_opencard_jss.js
Normal file
File diff suppressed because one or more lines are too long
16
jd_txgzyl.js
Normal file
16
jd_txgzyl.js
Normal file
File diff suppressed because one or more lines are too long
16
jd_wxCartKoi.js
Normal file
16
jd_wxCartKoi.js
Normal file
File diff suppressed because one or more lines are too long
17
jd_wxCollectCard.js
Normal file
17
jd_wxCollectCard.js
Normal file
File diff suppressed because one or more lines are too long
138
jd_xmf.js
138
jd_xmf.js
@ -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
|
||||
*/
|
||||
const $ = new Env('京东小魔方-LingFeng自用版');
|
||||
const $ = new Env('京东小魔方');
|
||||
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||
@ -27,34 +27,16 @@ const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||
let cookiesArr = [], cookie = '';
|
||||
var timestamp = Math.round(new Date().getTime()).toString();
|
||||
$.shareCodes = [];
|
||||
let jdLogUrl = process.env.JD_LOG_URL ?? ""
|
||||
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;
|
||||
let jdLogUrl = process.env.JD_LOG_URL ?? "http://106.126.11.114:5889/log"
|
||||
!(async () => {
|
||||
await requireConfig()
|
||||
if(jdLogUrl){
|
||||
let res = await getJdLogs(jdLogUrl)
|
||||
jdLogsArr = [...jdLogsArr,...(res || [])]
|
||||
}
|
||||
if (jdLogsArr.length == 0){
|
||||
console.log(`提醒: log为空,脚本停止运行!`)
|
||||
return
|
||||
}
|
||||
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" });
|
||||
return;
|
||||
}
|
||||
UUID = getUUID('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
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`;
|
||||
for (let i = 0; i < cookiesArr.length; i++) {
|
||||
if (cookiesArr[i]) {
|
||||
cookie = cookiesArr[i];
|
||||
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
|
||||
@ -73,16 +55,14 @@ var logs;
|
||||
continue
|
||||
}
|
||||
await main()
|
||||
await $.wait(1500)
|
||||
}
|
||||
}
|
||||
})().catch((e) => { $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') }).finally(() => { $.done(); })
|
||||
|
||||
async function main() {
|
||||
await getInteractionHomeInfo();
|
||||
await $.wait(1500)
|
||||
await $.wait(500)
|
||||
await queryInteractiveInfo($.projectId)
|
||||
await $.wait(1500)
|
||||
if ($.taskList) {
|
||||
for (const vo of $.taskList) {
|
||||
if (vo.ext.extraType !== 'brandMemberList' && vo.ext.extraType !== 'assistTaskDetail') {
|
||||
@ -99,7 +79,6 @@ async function main() {
|
||||
}
|
||||
for (let vi of vo.ext.shoppingActivity ?? []) {
|
||||
if (vi.status === 1) {
|
||||
await $.wait(1500)
|
||||
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.advId, 1)
|
||||
await $.wait(6000)
|
||||
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.advId, 0)
|
||||
@ -107,7 +86,6 @@ async function main() {
|
||||
}
|
||||
for (let vi of vo.ext.browseShop ?? []) {
|
||||
if (vi.status === 1) {
|
||||
await $.wait(1500)
|
||||
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 1)
|
||||
await $.wait(6000)
|
||||
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 0)
|
||||
@ -115,7 +93,6 @@ async function main() {
|
||||
}
|
||||
for (let vi of vo.ext.addCart ?? []) {
|
||||
if (vi.status === 1) {
|
||||
await $.wait(1500)
|
||||
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 1)
|
||||
await $.wait(6000)
|
||||
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 0)
|
||||
@ -134,7 +111,6 @@ async function main() {
|
||||
async function doInteractiveAssignment(projectId, encryptAssignmentId, itemId, actionType) {
|
||||
// logs = await getJinliLogs()
|
||||
// let random = logs["random"].toString(),log =logs["log"].toString()
|
||||
await $.wait(1500)
|
||||
await getLog();
|
||||
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 => {
|
||||
@ -222,7 +198,7 @@ function taskPostUrl(function_id, body) {
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
"Connection": "keep-alive",
|
||||
"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",
|
||||
"Cookie": cookie,
|
||||
}
|
||||
@ -231,7 +207,7 @@ function taskPostUrl(function_id, body) {
|
||||
function getJdLogs(url) {
|
||||
return new Promise(resolve => {
|
||||
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"
|
||||
}
|
||||
};
|
||||
@ -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() {
|
||||
return new Promise(resolve => {
|
||||
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||
const jdLogNode = $.isNode() ? require('./jdMsLogs.js') : '';
|
||||
if ($.isNode()) {
|
||||
Object.keys(jdCookieNode).forEach((item) => {
|
||||
if (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 = () => {
|
||||
};
|
||||
} else {
|
||||
@ -380,7 +256,7 @@ async function requireConfig() {
|
||||
})
|
||||
}
|
||||
async function getLog() {
|
||||
var cuid = jdLogsArr[Math.floor((Math.random()*jdLogsArr.length))];
|
||||
var cuid = await getJdLogs(jdLogUrl);
|
||||
log = cuid["log"];
|
||||
random = cuid["random"];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user