mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-04-23 02:48:44 +08:00
update
This commit is contained in:
parent
092c743bde
commit
254cbd7d6e
File diff suppressed because one or more lines are too long
226
jd_dpqd.js
226
jd_dpqd.js
@ -1,52 +1,35 @@
|
||||
/*
|
||||
https://github.com/feverrun/my_scripts
|
||||
如果想自己设置token,则设置以下的变量
|
||||
export dpqd_token="token1&token2&token3..."
|
||||
|
||||
店铺签到,各类店铺签到,有新的店铺直接添加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
|
||||
店铺签到的定时可采取随机定时,每天运行一次即可
|
||||
cron "15 0,4 * * *" script-path=jd_dpqd.js,tag=店铺签到
|
||||
*/
|
||||
const $ = new Env('店铺签到');
|
||||
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||
//IOS等用户直接用NobyDa的jd cookie
|
||||
let cookiesArr = [], cookie = '', allMessage = '', message;
|
||||
const JD_API_HOST = 'https://api.m.jd.com/api?appid=interCenter_shopSign';
|
||||
|
||||
let activityId = ''
|
||||
let vender = ''
|
||||
let num = 0
|
||||
let shopname=''
|
||||
const token = [
|
||||
"3BC1D580BAE49639E856787D776BA6BA",
|
||||
"A1577946DE409D3AC4B4FDCFF4681625",
|
||||
"BDC952E78780604530F13CBCFB89336A",
|
||||
"773D63918C47D32F33DDB2FB78C5820A",
|
||||
"4AC542553E87DCA9C8AB72BC7D09F908",
|
||||
"DA71409388CE531378225A6BBF96CDFE",
|
||||
"2785F65AB43E89055A31BFFF8E23C5BD",
|
||||
"72C1EAAC014BAA48176CF4B86DC567B8",
|
||||
"30D17316E31067004ED239DE9F121B0D",
|
||||
"4E4B5F141AADE9638771B6226AD426D0",
|
||||
"6F79CE75B2D272EBC34718C6C07CB63B",
|
||||
"500B9537712BD828EFC8C4D036B9752A",
|
||||
"612AB059DEDF1AE49910BC575AEDF97B",
|
||||
"4854A3FC0F4E9CFD23D48BB36B0F98A9",
|
||||
"0903CFF8DCB8B5A701D911BEEBF285F3"
|
||||
]
|
||||
let token = []
|
||||
let tokens = [];
|
||||
let dpqd_token = ''
|
||||
|
||||
// const token = []
|
||||
if ($.isNode()) {
|
||||
Object.keys(jdCookieNode).forEach((item) => {
|
||||
cookiesArr.push(jdCookieNode[item])
|
||||
})
|
||||
if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
|
||||
dpqd_token = process.env.dpqd_token ? process.env.dpqd_token : '';
|
||||
if (dpqd_token != '') {
|
||||
tokens = dpqd_token.split('&');
|
||||
}
|
||||
} else {
|
||||
let cookiesData = $.getdata('CookiesJD') || "[]";
|
||||
cookiesData = jsonParse(cookiesData);
|
||||
@ -62,6 +45,36 @@ if ($.isNode()) {
|
||||
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
|
||||
return;
|
||||
}
|
||||
|
||||
// token = await getRemoteData();
|
||||
// token = token ? token : [];
|
||||
token = [
|
||||
"26CCFF752088E65E2075EC3C1EC7F16E",
|
||||
"53DE598FA62B714B94B07012B19AF9C3",
|
||||
"BDC952E78780604530F13CBCFB89336A",
|
||||
"773D63918C47D32F33DDB2FB78C5820A",
|
||||
"0C4CC6441DD7F155C8A4A1A119DF2880",
|
||||
"DA71409388CE531378225A6BBF96CDFE",
|
||||
"C1CB0B5488CFE4AE325D8E0C1C71DBF7",
|
||||
"72C1EAAC014BAA48176CF4B86DC567B8",
|
||||
"30D17316E31067004ED239DE9F121B0D",
|
||||
"4E4B5F141AADE9638771B6226AD426D0",
|
||||
"9ADA7B25C761104D8921B811E0EB8AEE",
|
||||
"500B9537712BD828EFC8C4D036B9752A",
|
||||
"612AB059DEDF1AE49910BC575AEDF97B",
|
||||
"4854A3FC0F4E9CFD23D48BB36B0F98A9",
|
||||
"1EED9BA54DCBE78B731281127EA76061",
|
||||
"A55381648D62BA21F9A5B4204A301F0B",
|
||||
"C4E40336212694316DF6812BD7DA3E2B",
|
||||
"0F4FD87223EEA285AA010C4B34A128DA",
|
||||
"D173595F46DFDD996EC3504FDE60F7EB",
|
||||
"07676202D4FAEBE3B5191071420ACCB4"
|
||||
];
|
||||
|
||||
token = dpqd_token ? tokens : token;
|
||||
|
||||
await $.wait(parseInt(Math.random(2500) + 250, 10));
|
||||
|
||||
for (let i = 0; i < cookiesArr.length; i++) {
|
||||
if (cookiesArr[i]) {
|
||||
cookie = cookiesArr[i];
|
||||
@ -70,18 +83,12 @@ if ($.isNode()) {
|
||||
$.isLogin = true;
|
||||
$.nickName = '';
|
||||
message = '';
|
||||
//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"});
|
||||
if ($.isNode()) {
|
||||
await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
await dpqd()
|
||||
await showMsg()
|
||||
await $.wait(1500)
|
||||
await $.wait(1000)
|
||||
}
|
||||
}
|
||||
if ($.isNode() && allMessage) {
|
||||
@ -99,10 +106,13 @@ if ($.isNode()) {
|
||||
async function dpqd() {
|
||||
for (var j = 0; j < token.length; j++) {
|
||||
num = j + 1
|
||||
if (token[j]=='') {continue}
|
||||
getUA()
|
||||
if (token[j] == '') {
|
||||
continue
|
||||
}
|
||||
await getvenderId(token[j])
|
||||
if (vender=='') {continue}
|
||||
if (vender == '') {
|
||||
continue
|
||||
}
|
||||
await getvenderName(vender)
|
||||
await getActivityInfo(token[j], vender)
|
||||
await signCollectGift(token[j], vender, activityId)
|
||||
@ -111,8 +121,9 @@ async function dpqd(){
|
||||
}
|
||||
|
||||
//获取店铺ID
|
||||
function getvenderId(token) {
|
||||
return new Promise(resolve => {
|
||||
async function getvenderId(token) {
|
||||
await $.wait(300);
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
url: `https://api.m.jd.com/api?appid=interCenter_shopSign&t=${Date.now()}&loginType=2&functionId=interact_center_shopSign_getActivityInfo&body={%22token%22:%22${token}%22,%22venderId%22:%22%22}&jsonp=jsonp1000`,
|
||||
headers: {
|
||||
@ -121,10 +132,10 @@ function getvenderId(token) {
|
||||
"accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"cookie": cookie,
|
||||
"referer": 'https://h5.m.jd.com/',
|
||||
"User-Agent": $.UA
|
||||
// "User-Agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40`
|
||||
"User-Agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40`
|
||||
}
|
||||
}
|
||||
await $.wait(400);
|
||||
$.get(options, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
@ -151,8 +162,9 @@ function getvenderId(token) {
|
||||
}
|
||||
|
||||
//获取店铺名称
|
||||
function getvenderName(venderId) {
|
||||
return new Promise(resolve => {
|
||||
async function getvenderName(venderId) {
|
||||
await $.wait(200);
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
url: `https://wq.jd.com/mshop/QueryShopMemberInfoJson?venderId=${venderId}`,
|
||||
headers: {
|
||||
@ -160,10 +172,10 @@ function getvenderName(venderId) {
|
||||
"accept-encoding": "gzip, deflate, br",
|
||||
"accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"cookie": cookie,
|
||||
"User-Agent": $.UA
|
||||
// "User-Agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40`
|
||||
"User-Agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40`
|
||||
}
|
||||
}
|
||||
await $.wait(600);
|
||||
$.get(options, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
@ -187,8 +199,9 @@ function getvenderName(venderId) {
|
||||
|
||||
|
||||
//获取店铺活动信息
|
||||
function getActivityInfo(token,venderId) {
|
||||
return new Promise(resolve => {
|
||||
async function getActivityInfo(token, venderId) {
|
||||
await $.wait(400);
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
url: `${JD_API_HOST}&t=${Date.now()}&loginType=2&functionId=interact_center_shopSign_getActivityInfo&body={%22token%22:%22${token}%22,%22venderId%22:${venderId}}&jsonp=jsonp1005`,
|
||||
headers: {
|
||||
@ -197,10 +210,10 @@ function getActivityInfo(token,venderId) {
|
||||
"accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"cookie": cookie,
|
||||
"referer": `https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token=${token}&sceneval=2&jxsid=16105853541009626903&cu=true&utm_source=kong&utm_medium=jingfen&utm_campaign=t_1001280291_&utm_term=fa3f8f38c56f44e2b4bfc2f37bce9713`,
|
||||
"User-Agent": $.UA
|
||||
// "User-Agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40`
|
||||
"User-Agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40`
|
||||
}
|
||||
}
|
||||
await $.wait(700);
|
||||
$.get(options, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
@ -231,8 +244,9 @@ function getActivityInfo(token,venderId) {
|
||||
}
|
||||
|
||||
//店铺签到
|
||||
function signCollectGift(token,venderId,activitytemp) {
|
||||
return new Promise(resolve => {
|
||||
async function signCollectGift(token, venderId, activitytemp) {
|
||||
await $.wait(500);
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
url: `${JD_API_HOST}&t=${Date.now()}&loginType=2&functionId=interact_center_shopSign_signCollectGift&body={%22token%22:%22${token}%22,%22venderId%22:688200,%22activityId%22:${activitytemp},%22type%22:56,%22actionType%22:7}&jsonp=jsonp1004`,
|
||||
headers: {
|
||||
@ -241,10 +255,10 @@ function signCollectGift(token,venderId,activitytemp) {
|
||||
"accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"cookie": cookie,
|
||||
"referer": `https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token=${token}&sceneval=2&jxsid=16105853541009626903&cu=true&utm_source=kong&utm_medium=jingfen&utm_campaign=t_1001280291_&utm_term=fa3f8f38c56f44e2b4bfc2f37bce9713`,
|
||||
"User-Agent": $.UA
|
||||
// "User-Agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40`
|
||||
"User-Agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40`
|
||||
}
|
||||
}
|
||||
await $.wait(800);
|
||||
$.get(options, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
@ -264,8 +278,9 @@ function signCollectGift(token,venderId,activitytemp) {
|
||||
}
|
||||
|
||||
//店铺获取签到信息
|
||||
function taskUrl(token,venderId) {
|
||||
return new Promise(resolve => {
|
||||
async function taskUrl(token, venderId) {
|
||||
await $.wait(300);
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
url: `${JD_API_HOST}&t=${Date.now()}&loginType=2&functionId=interact_center_shopSign_getSignRecord&body={%22token%22:%22${token}%22,%22venderId%22:${venderId},%22activityId%22:${activityId},%22type%22:56}&jsonp=jsonp1006`,
|
||||
headers: {
|
||||
@ -274,10 +289,10 @@ function taskUrl(token,venderId) {
|
||||
"accept-language": "zh-CN,zh;q=0.9",
|
||||
"cookie": cookie,
|
||||
"referer": `https://h5.m.jd.com/`,
|
||||
"User-Agent": $.UA
|
||||
// "user-agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40`
|
||||
"user-agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40`
|
||||
}
|
||||
}
|
||||
await $.wait(800);
|
||||
$.get(options, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
@ -305,51 +320,6 @@ async function showMsg() {
|
||||
}
|
||||
}
|
||||
|
||||
function TotalBean() {
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
"url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`,
|
||||
"headers": {
|
||||
"Accept": "application/json,text/plain, */*",
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
"Accept-Language": "zh-cn",
|
||||
"Connection": "keep-alive",
|
||||
"Cookie": cookie,
|
||||
"Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
|
||||
"User-Agent": `jdapp;android;9.3.5;10;3353234393134326-3673735303632613;network/wifi;model/MI 8;addressid/138719729;aid/3524914bc77506b1;oaid/274aeb3d01b03a22;osVer/29;appBuild/86390;psn/Mp0dlaZf4czQtfPNMEfpcYU9S/f2Vv4y|2255;psq/1;adk/;ads/;pap/JA2015_311210|9.3.5|ANDROID 10;osv/10;pv/2039.1;jdv/0|androidapp|t_335139774|appshare|QQfriends|1611211482018|1611211495;ref/com.jingdong.app.mall.home.JDHomeFragment;partner/jingdong;apprpd/Home_Main;eufv/1;jdSupportDarkMode/0;Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36`
|
||||
}
|
||||
}
|
||||
$.post(options, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`)
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
data = JSON.parse(data);
|
||||
if (data['retcode'] === 13) {
|
||||
$.isLogin = false; //cookie过期
|
||||
return
|
||||
}
|
||||
if (data['retcode'] === 0) {
|
||||
$.nickName = data['base'].nickname;
|
||||
} else {
|
||||
$.nickName = $.UserName
|
||||
}
|
||||
} else {
|
||||
console.log(`京东服务器返回空数据`)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp)
|
||||
} finally {
|
||||
resolve();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function jsonParse(str) {
|
||||
if (typeof str == "string") {
|
||||
try {
|
||||
@ -362,16 +332,38 @@ function jsonParse(str) {
|
||||
}
|
||||
}
|
||||
|
||||
function randomString(e) {
|
||||
e = e || 32;
|
||||
let t = "abcdef0123456789", a = t.length, n = "";
|
||||
for (i = 0; i < e; i++)
|
||||
n += t.charAt(Math.floor(Math.random() * a));
|
||||
return n
|
||||
function getRemoteData()
|
||||
{
|
||||
return new Promise(resolve => {
|
||||
const options = {
|
||||
url: `https://feverrun.coding.net/p/feverrun/d/cdn/git/raw/master/dpqd.json`,
|
||||
headers: {
|
||||
"accept": "application/json",
|
||||
"accept-encoding": "gzip, deflate, br",
|
||||
"accept-language": "zh-CN,zh;q=0.9",
|
||||
"user-agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40`
|
||||
},
|
||||
timeout: 30000,
|
||||
}
|
||||
|
||||
function getUA() {
|
||||
$.UA = `jdapp;iPhone;10.2.2;13.1.2;${randomString(40)};M/5.0;network/wifi;ADID/;model/iPhone8,1;addressid/2308460611;appBuild/167863;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 13_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1;`
|
||||
$.get(options, (err, resp, data) => {
|
||||
console.log(`data:${data}`);
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`\n${$.name}: API查询请求失败 ‼️‼️`)
|
||||
$.logErr(err);
|
||||
} else {
|
||||
data = data;
|
||||
if(typeof(data) == 'string') {
|
||||
data = JSON.parse(data)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp);
|
||||
} finally {
|
||||
resolve(data || []);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
|
229
jd_joy_joy_run.ts
Normal file
229
jd_joy_joy_run.ts
Normal file
@ -0,0 +1,229 @@
|
||||
/**
|
||||
汪汪乐园-跑步
|
||||
只能翻倍0.01能成功!
|
||||
export JD_JOY_PARK_RUN_ASSETS="0.08"
|
||||
32 * * * * jd_joy_joy_run.ts
|
||||
new Env('极速版汪汪赛跑')
|
||||
Modify By Dylan from HW
|
||||
**/
|
||||
|
||||
import {get, post, o2s, requireConfig, wait} from './TS_USER_AGENTS'
|
||||
import {H5ST} from "./function/h5st"
|
||||
import {existsSync, readFileSync} from "fs";
|
||||
import {getDate} from "date-fns";
|
||||
|
||||
let cookie: string = '', res: any = '', UserName: string = '', fp_448de: string = '' || process.env.FP_448DE, fp_b6ac3: string = '' || process.env.FP_B6AC3
|
||||
let assets: number = 0, captainId: string = '', h5stTool: H5ST = null
|
||||
|
||||
!(async () => {
|
||||
let cookiesArr: string[] = await requireConfig()
|
||||
let account: { pt_pin: string, joy_park_run: number }[] = []
|
||||
console.log('每周日18点组队分红!!')
|
||||
for (let [index, value] of cookiesArr.entries()) {
|
||||
cookie = value
|
||||
UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1])
|
||||
console.log(`\n开始【京东账号${index + 1}】${UserName}\n`)
|
||||
|
||||
|
||||
|
||||
assets = parseFloat(process.env.JD_JOY_PARK_RUN_ASSETS || '0.01')
|
||||
let rewardAmount: number = 0
|
||||
try {
|
||||
h5stTool = new H5ST('448de', 'jdltapp;', fp_448de)
|
||||
await h5stTool.__genAlgo()
|
||||
res = await team('runningMyPrize', {"linkId": "L-sOanK_5RJCz7I314FpnQ", "pageSize": 20, "time": null, "ids": null})
|
||||
let sum: number = 0, success: number = 0
|
||||
for (let t of res?.data?.detailVos || []) {
|
||||
if (t.amount > 0 && getDate(new Date(t.createTime)) === new Date().getDate()) {
|
||||
sum = add(sum, t.amount)
|
||||
success++
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
console.log('今日成功', success, '次')
|
||||
console.log('今日收益', sum.toFixed(2), '元')
|
||||
|
||||
res = await team('runningTeamInfo', {"linkId": "L-sOanK_5RJCz7I314FpnQ"})
|
||||
if (!captainId) {
|
||||
if (res.data.members.length === 0) {
|
||||
console.log('成为队长')
|
||||
captainId = res.data.captainId
|
||||
} else if (res.data.members.length !== 6) {
|
||||
console.log('队伍未满', res.data.members.length, '人')
|
||||
console.log('战队收益', res.data.teamSumPrize, '元')
|
||||
captainId = res.data.captainId
|
||||
} else {
|
||||
console.log('队伍已满', res.data.members.length, '人')
|
||||
console.log('战队收益', res.data.teamSumPrize, '元')
|
||||
}
|
||||
} else if (captainId && res.data.members.length === 0) {
|
||||
console.log('已有组队ID,未加入队伍')
|
||||
res = await team('runningJoinTeam', {"linkId": "L-sOanK_5RJCz7I314FpnQ", "captainId": captainId})
|
||||
if (res.code === 0) {
|
||||
console.log('组队成功')
|
||||
for (let member of res.data.members) {
|
||||
if (member.captain) {
|
||||
console.log('队长', member.nickName)
|
||||
break
|
||||
}
|
||||
}
|
||||
if (res.data.members.length === 6) {
|
||||
console.log('队伍已满')
|
||||
captainId = ''
|
||||
}
|
||||
} else {
|
||||
o2s(res, '组队失败')
|
||||
}
|
||||
} else {
|
||||
console.log('已组队', res.data.members.length, '人')
|
||||
console.log('战队收益', res.data.teamSumPrize, '元')
|
||||
}
|
||||
|
||||
|
||||
h5stTool = new H5ST('b6ac3', 'jdltapp;', fp_b6ac3)
|
||||
await h5stTool.__genAlgo()
|
||||
res = await runningPageHome()
|
||||
console.log('🧧总金额', res.data.runningHomeInfo.prizeValue, '元')
|
||||
|
||||
let energy: number = res.data.runningHomeInfo.energy
|
||||
console.log('💊 X', res.data.runningHomeInfo.energy, '个能量棒')
|
||||
await wait(2000)
|
||||
if (res.data.runningHomeInfo.nextRunningTime){
|
||||
console.log('⏳体力恢复中,还有', secondsToMinutes(res.data.runningHomeInfo.nextRunningTime / 1000))
|
||||
if (res.data.runningHomeInfo.nextRunningTime / 1000 < 300) {
|
||||
await wait(res.data.runningHomeInfo.nextRunningTime)
|
||||
res = await runningPageHome()
|
||||
console.log('体力恢复完成,开始跑步....')
|
||||
await wait(1000)
|
||||
} else {
|
||||
console.log('⏳等体力恢复在跑吧!');
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
console.log('体力已恢复,开始跑步....')
|
||||
}
|
||||
|
||||
await startRunning(res, assets)
|
||||
for (let i = 0; i < energy; i++) {
|
||||
console.log('💉消耗能量棒跑步....')
|
||||
res = await api('runningUseEnergyBar', {"linkId": "L-sOanK_5RJCz7I314FpnQ"})
|
||||
//console.log(res.errMsg)
|
||||
res = await runningPageHome()
|
||||
await startRunning(res, assets)
|
||||
await wait(1000)
|
||||
}
|
||||
res = await runningPageHome()
|
||||
console.log('🧧总金额', res.data.runningHomeInfo.prizeValue, '元')
|
||||
await wait(2000)
|
||||
} catch (e) {
|
||||
console.log('Error', e)
|
||||
await wait(3000)
|
||||
}
|
||||
}
|
||||
})()
|
||||
|
||||
async function startRunning(res: any, assets: number) {
|
||||
if (!res.data.runningHomeInfo.nextRunningTime) {
|
||||
console.log('终点目标', assets)
|
||||
for (let i = 0; i < 5; i++) {
|
||||
res = await api('runningOpenBox', {"linkId": "L-sOanK_5RJCz7I314FpnQ"})
|
||||
if (parseFloat(res.data.assets) >= assets) {
|
||||
let assets: number = parseFloat(res.data.assets)
|
||||
res = await api('runningPreserveAssets', {"linkId": "L-sOanK_5RJCz7I314FpnQ"})
|
||||
console.log('领取成功', assets)
|
||||
break
|
||||
} else {
|
||||
if (res.data.doubleSuccess) {
|
||||
console.log('翻倍成功', parseFloat(res.data.assets))
|
||||
await wait(10000)
|
||||
} else if (!res.data.doubleSuccess && !res.data.runningHomeInfo.runningFinish) {
|
||||
console.log('开始跑步', parseFloat(res.data.assets))
|
||||
await wait(10000)
|
||||
} else {
|
||||
console.log('翻倍失败')
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
await wait(3000)
|
||||
}
|
||||
|
||||
async function api(fn: string, body: object) {
|
||||
let timestamp: number = Date.now(), h5st: string = ''
|
||||
if (fn === 'runningOpenBox') {
|
||||
h5st = h5stTool.__genH5st({
|
||||
appid: "activities_platform",
|
||||
body: JSON.stringify(body),
|
||||
client: "ios",
|
||||
clientVersion: "3.1.0",
|
||||
functionId: "runningOpenBox",
|
||||
t: timestamp.toString()
|
||||
})
|
||||
}
|
||||
let params: string = `functionId=${fn}&body=${JSON.stringify(body)}&t=${timestamp}&appid=activities_platform&client=ios&clientVersion=3.1.0&cthr=1`
|
||||
h5st && (params += `&h5st=${h5st}`)
|
||||
return await post('https://api.m.jd.com/', params, {
|
||||
'authority': 'api.m.jd.com',
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'cookie': cookie,
|
||||
'origin': 'https://h5platform.jd.com',
|
||||
'referer': 'https://h5platform.jd.com/',
|
||||
'user-agent': 'jdltapp;'
|
||||
})
|
||||
}
|
||||
|
||||
async function runningPageHome() {
|
||||
return get(`https://api.m.jd.com/?functionId=runningPageHome&body=%7B%22linkId%22:%22L-sOanK_5RJCz7I314FpnQ%22,%22isFromJoyPark%22:true,%22joyLinkId%22:%22LsQNxL7iWDlXUs6cFl-AAg%22%7D&t=${Date.now()}&appid=activities_platform&client=ios&clientVersion=3.1.0`, {
|
||||
'Host': 'api.m.jd.com',
|
||||
'Origin': 'https://h5platform.jd.com',
|
||||
'User-Agent': 'jdltapp;',
|
||||
'Referer': 'https://h5platform.jd.com/',
|
||||
'Cookie': cookie
|
||||
})
|
||||
}
|
||||
|
||||
async function team(fn: string, body: object) {
|
||||
let timestamp: number = Date.now(), h5st: string
|
||||
h5st = h5stTool.__genH5st({
|
||||
appid: "activities_platform",
|
||||
body: JSON.stringify(body),
|
||||
client: "ios",
|
||||
clientVersion: "3.1.0",
|
||||
functionId: fn,
|
||||
t: timestamp.toString()
|
||||
})
|
||||
return await get(`https://api.m.jd.com/?functionId=${fn}&body=${encodeURIComponent(JSON.stringify(body))}&t=${timestamp}&appid=activities_platform&client=ios&clientVersion=3.1.0&cthr=1&h5st=${h5st}`, {
|
||||
'Host': 'api.m.jd.com',
|
||||
'User-Agent': 'jdltapp;',
|
||||
'Origin': 'https://h5platform.jd.com',
|
||||
'X-Requested-With': 'com.jd.jdlite',
|
||||
'Referer': 'https://h5platform.jd.com/',
|
||||
'Cookie': cookie
|
||||
})
|
||||
}
|
||||
|
||||
// 秒转时分秒
|
||||
function secondsToMinutes(seconds: number) {
|
||||
let minutes: number = Math.floor(seconds / 60)
|
||||
let second: number = Math.floor(seconds % 60)
|
||||
return `${minutes}分${second}秒`
|
||||
}
|
||||
|
||||
// 小数加法
|
||||
function add(num1: number, num2: number) {
|
||||
let r1: number, r2: number
|
||||
try {
|
||||
r1 = num1.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r1 = 0
|
||||
}
|
||||
try {
|
||||
r2 = num2.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r2 = 0
|
||||
}
|
||||
let m: number = Math.pow(10, Math.max(r1, r2))
|
||||
return (num1 * m + num2 * m) / m
|
||||
}
|
File diff suppressed because one or more lines are too long
24
jd_prodev.js
Normal file
24
jd_prodev.js
Normal file
File diff suppressed because one or more lines are too long
@ -1,15 +1,16 @@
|
||||
/*
|
||||
* 2022-07-20 修复获取试用列表风控问题;
|
||||
* 2022-08-12 修复申请试用风控,更换nolan接口
|
||||
* By https://github.com/6dylan6/jdpro/
|
||||
* 基于X1a0He版本修改
|
||||
* @Address: https://github.com/X1a0He/jd_scripts_fixed/blob/main/jd_try_xh.js
|
||||
* 如需运行请自行添加环境变量:JD_TRY,值填 true 即可运行
|
||||
* 上一作者说了每天最多300个商店,总上限为500个,jd_unsubscribe.js我已更新为批量取关版
|
||||
* 请提前取关至少250个商店确保京东试用脚本正常运行
|
||||
|
||||
如需运行请自行添加环境变量:JD_TRY="true" 即可运行
|
||||
脚本是否耗时只看args_xh.maxLength的大小(申请数量),默认50个,申请100个差不多15分钟
|
||||
上一作者说每天申请上限300个(自测,没有申请过上限),关注店铺上限500个
|
||||
关注店铺满了就无法继续申请,可用批量取关店铺取消关注
|
||||
|
||||
部分环境变量说明,详细请参考58行往下:
|
||||
export JD_TRY="true"是否允许,默认false
|
||||
export JD_TRY_PASSZC="false" #不过滤种草官类试用,默认true过滤
|
||||
export JD_TRY_MAXLENGTH="50" #商品数组的最大长度,默认50个
|
||||
export JD_TRY_PRICE="XX"#商品原价格,大于XX才申请,默认20
|
||||
@ -18,13 +19,13 @@ export JD_TRY_APPLYNUMFILTER="10000" #过滤大于设定值的已申请人数
|
||||
export JD_TRY_MINSUPPLYNUM="1" #最小提供数量
|
||||
export JD_TRY_SENDNUM="10" #每隔多少账号发送一次通知,默认为4
|
||||
export JD_TRY_UNIFIED="false" 默认采用不同试用组
|
||||
export JD_TRY_NUM="5" 最多跑多少个CK,默认10
|
||||
export JD_TRY_NUM="7" 最多跑多少个CK,默认10
|
||||
|
||||
定时自定义,能用多久随缘了!!!
|
||||
cron "1 1 1 1 1" jd_try.js
|
||||
*/
|
||||
|
||||
const $ = new Env('京东试用')
|
||||
const URL = 'https://api.m.jd.com/client.action'
|
||||
|
||||
let trialActivityIdList = []
|
||||
let trialActivityTitleList = []
|
||||
let notifyMsg = ''
|
||||
@ -40,19 +41,18 @@ $.getNum = 0;
|
||||
$.try = true;
|
||||
$.sentNum = 0;
|
||||
$.cookiesArr = []
|
||||
//默认的过滤关键词
|
||||
$.innerKeyWords =
|
||||
[
|
||||
"幼儿园", "教程", "英语", "辅导", "培训",
|
||||
"孩子", "小学", "成人用品", "套套", "情趣",
|
||||
"自慰", "阳具", "飞机杯", "男士用品", "女士用品",
|
||||
"内衣", "高潮", "避孕", "乳腺", "肛塞", "肛门",
|
||||
"宝宝", "芭比", "娃娃", "男用",
|
||||
"宝宝", "玩具", "芭比", "娃娃", "男用",
|
||||
"女用", "神油", "足力健", "老年", "老人",
|
||||
"宠物", "饲料", "丝袜", "黑丝", "磨脚",
|
||||
"脚皮", "除臭", "性感", "内裤", "跳蛋",
|
||||
"安全套", "龟头", "阴道", "阴部", "手机卡", "电话卡", "流量卡",
|
||||
"习题", "试卷",
|
||||
"玉坠","和田玉","习题","试卷","手机壳","钢化膜"
|
||||
]
|
||||
//下面很重要,遇到问题请把下面注释看一遍再来问
|
||||
let args_xh = {
|
||||
@ -187,8 +187,7 @@ let args_xh = {
|
||||
!(async () => {
|
||||
await $.wait(500)
|
||||
// 如果你要运行京东试用这个脚本,麻烦你把环境变量 JD_TRY 设置为 true
|
||||
if (process.env.JD_TRY && process.env.JD_TRY === 'true') {
|
||||
$.log('\n遇到问题请先看脚本内注释;解决不了可联系https://t.me/dylan_jdpro\n');
|
||||
if (1) {
|
||||
await requireConfig()
|
||||
if (!$.cookiesArr[0]) {
|
||||
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {
|
||||
@ -204,7 +203,7 @@ let args_xh = {
|
||||
$.index = i + 1;
|
||||
$.isLogin = true;
|
||||
$.nickName = '';
|
||||
await totalBean();
|
||||
//await totalBean();
|
||||
console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`);
|
||||
$.except = false;
|
||||
if(args_xh.except.includes($.UserName)){
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
58
jd_wxCollectionActivity2.js
Normal file
58
jd_wxCollectionActivity2.js
Normal file
File diff suppressed because one or more lines are too long
42
jd_wxShareActivity.js
Executable file
42
jd_wxShareActivity.js
Executable file
File diff suppressed because one or more lines are too long
8
jd_wxSignRed.js
Normal file
8
jd_wxSignRed.js
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user