mirror of
https://github.com/lan-tianxiang/clone_scripts.git
synced 2026-03-25 16:53:19 +08:00
更新于 07-15 21:06
This commit is contained in:
@@ -1,22 +1,24 @@
|
|||||||
/*
|
/*
|
||||||
口袋书店
|
口袋书店
|
||||||
|
更新时间:2021-06-26
|
||||||
|
加了一个码,修复需要手动打开的问题
|
||||||
活动入口:京东app首页-京东图书-右侧口袋书店
|
活动入口:京东app首页-京东图书-右侧口袋书店
|
||||||
已支持IOS双京东账号,Node.js支持N个京东账号
|
已支持IOS双京东账号,Node.js支持N个京东账号
|
||||||
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
||||||
============Quantumultx===============
|
============Quantumultx===============
|
||||||
[task_local]
|
[task_local]
|
||||||
#口袋书店
|
#口袋书店
|
||||||
1 8,12,18 * * * https://gitee.com/lxk0301/jd_scripts/raw/master/jd_bookshop.js, tag=口袋书店, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
|
1 8,12,18 * * * https://raw.githubusercontent.com/Wenmoux/scripts/wen/jd/chinnkarahoi_jd_bookshop.js, tag=口袋书店, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
|
||||||
|
|
||||||
================Loon==============
|
================Loon==============
|
||||||
[Script]
|
[Script]
|
||||||
cron "1 8,12,18 * * *" script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_bookshop.js,tag=口袋书店
|
cron "1 8,12,18 * * *" script-path= https://raw.githubusercontent.com/Wenmoux/scripts/wen/jd/chinnkarahoi_jd_bookshop.js,tag=口袋书店
|
||||||
|
|
||||||
===============Surge=================
|
===============Surge=================
|
||||||
口袋书店 = type=cron,cronexp="1 8,12,18 * * *",wake-system=1,timeout=3600,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_bookshop.js
|
口袋书店 = type=cron,cronexp="1 8,12,18 * * *",wake-system=1,timeout=3600,script-path= https://raw.githubusercontent.com/Wenmoux/scripts/wen/jd/chinnkarahoi_jd_bookshop.js
|
||||||
|
|
||||||
============小火箭=========
|
============小火箭=========
|
||||||
口袋书店 = type=cron,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_bookshop.js, cronexpr="1 8,12,18* * *", timeout=3600, enable=true
|
口袋书店 = type=cron,script-path= https://raw.githubusercontent.com/Wenmoux/scripts/wen/jd/chinnkarahoi_jd_bookshop.js, cronexpr="1 8,12,18* * *", timeout=3600, enable=true
|
||||||
*/
|
*/
|
||||||
const $ = new Env('口袋书店');
|
const $ = new Env('口袋书店');
|
||||||
const notify = $.isNode() ? require('./sendNotify') : '';
|
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||||
@@ -30,6 +32,8 @@ ADD_CART = $.isNode() ? (process.env.PURCHASE_SHOPS ? process.env.PURCHASE_SHOPS
|
|||||||
// 加入购物车开关,与东东小窝共享
|
// 加入购物车开关,与东东小窝共享
|
||||||
|
|
||||||
let inviteCodes = [
|
let inviteCodes = [
|
||||||
|
//'4dd98623868f4292b5432822389fe3e9@daf75e50044144c68b2aff47de57fe49@e341962809ae42c5b8d2d61995bbb5a4@77f08ad1aea04b73acd4542f7fd1dac6@fe5536751f89403d87bad635a87bd956',
|
||||||
|
//'4dd98623868f4292b5432822389fe3e9@daf75e50044144c68b2aff47de57fe49@e341962809ae42c5b8d2d61995bbb5a4@77f08ad1aea04b73acd4542f7fd1dac6@fe5536751f89403d87bad635a87bd956'
|
||||||
]
|
]
|
||||||
|
|
||||||
if ($.isNode()) {
|
if ($.isNode()) {
|
||||||
@@ -86,6 +90,7 @@ async function jdBeauty() {
|
|||||||
await getActCk()
|
await getActCk()
|
||||||
await getActInfo()
|
await getActInfo()
|
||||||
await getToken()
|
await getToken()
|
||||||
|
await accessLogWithAD()
|
||||||
await getUserInfo()
|
await getUserInfo()
|
||||||
await getActContent(false, shareUuid)
|
await getActContent(false, shareUuid)
|
||||||
if ($.exit) return
|
if ($.exit) return
|
||||||
@@ -103,7 +108,7 @@ async function jdBeauty() {
|
|||||||
}
|
}
|
||||||
if($.userInfo.storeGold) await chargeGold()
|
if($.userInfo.storeGold) await chargeGold()
|
||||||
await helpFriends()
|
await helpFriends()
|
||||||
await showMsg();
|
// await showMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function helpFriends() {
|
async function helpFriends() {
|
||||||
@@ -262,7 +267,35 @@ function getUserInfo() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 获得用户信息
|
||||||
|
function accessLogWithAD() {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
let body = `venderId=${ $.shopId}&code=99&pin=${encodeURIComponent($.token)}&activityId=${ACT_ID}&pageUrl=https%3A%2F%2Flzdz-isv.isvjcloud.com%2Fdingzhi%2Fbook%2Fdevelop%2Factivity%3FactivityId%3Ddz2010100034444201%26lng%3D107.146945%26lat%3D33.255267%26sid%3Dcad74d1c843bd47422ae20cadf6fe5aw%26un_area%3D27_2442_2444_31912&subType=app&adSource=`
|
||||||
|
$.post(taskPostUrl('common/accessLogWithAD', body), async (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
if (err) {
|
||||||
|
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||||
|
} else {
|
||||||
|
// if (safeGet(data)) {
|
||||||
|
if($.isNode())
|
||||||
|
for (let ck of resp['headers']['set-cookie']) {
|
||||||
|
cookie = `${cookie}; ${ck.split(";")[0]};`
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
for (let ck of resp['headers']['Set-Cookie'].split(',')) {
|
||||||
|
cookie = `${cookie}; ${ck.split(";")[0]};`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$.logErr(e, resp)
|
||||||
|
} finally {
|
||||||
|
resolve(data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
// 获得游戏信息
|
// 获得游戏信息
|
||||||
function getActContent(info = false, shareUuid = '') {
|
function getActContent(info = false, shareUuid = '') {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
@@ -272,6 +305,7 @@ function getActContent(info = false, shareUuid = '') {
|
|||||||
if (err) {
|
if (err) {
|
||||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||||
} else {
|
} else {
|
||||||
|
// console.log(data)
|
||||||
if (data && safeGet(data)) {
|
if (data && safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
if (data.data) {
|
if (data.data) {
|
||||||
@@ -666,12 +700,10 @@ function shareCodesFormat() {
|
|||||||
const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
|
const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
|
||||||
$.newShareCodes = inviteCodes[tempIndex].split('@');
|
$.newShareCodes = inviteCodes[tempIndex].split('@');
|
||||||
}
|
}
|
||||||
/*
|
// const readShareCodeRes = await readShareCode();
|
||||||
const readShareCodeRes = null //await readShareCode();
|
// if (readShareCodeRes && readShareCodeRes.code === 200) {
|
||||||
if (readShareCodeRes && readShareCodeRes.code === 200) {
|
// $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
|
||||||
$.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
|
// }
|
||||||
}
|
|
||||||
*/
|
|
||||||
console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`)
|
console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`)
|
||||||
resolve();
|
resolve();
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user