├── JS_USER_AGENTS.js ├── LICENSE ├── TS_JDHelloWorld.d.ts ├── TS_JDHelloWorld.js ├── TS_USER_AGENTS.js ├── TS_USER_AGENTS.ts ├── USER_AGENTS.js ├── archive ├── jd_88hb.js ├── jd_88hb.ts ├── jd_cfd_game.js ├── jd_cfd_game.ts ├── jd_cfd_shell.js ├── jd_cfd_shell.ts ├── jd_getShareCodes.js ├── jd_getShareCodes.ts ├── jd_version.js ├── jd_version.ts ├── jx_box.js ├── jx_box.ts ├── jx_nnfls.js └── jx_nnfls.ts ├── gulpconfig.json ├── gulpfile.js ├── iOS ├── Loon.conf ├── QX.json └── Surge.sgmodule ├── iOS_Cookie.js ├── jdCookie.js ├── jdDreamFactoryShareCodes.js ├── jdFactoryShareCodes.js ├── jdFruitShareCodes.js ├── jdPetShareCodes.js ├── jdPlantBeanShareCodes.js ├── jd_api_test.js ├── jd_api_test.ts ├── jd_bean_aggregation.js ├── jd_bean_box.js ├── jd_bean_box.ts ├── jd_bean_change.js ├── jd_bean_sign.js ├── jd_bean_sign.ts ├── jd_bookshop.js ├── jd_cash_help.js ├── jd_cash_help.ts ├── jd_cash_signin.js ├── jd_cash_signin.ts ├── jd_cfd.js ├── jd_cfd.ts ├── jd_checkCookie.js ├── jd_checkCookie.ts ├── jd_club_lottery.js ├── jd_cww.js ├── jd_cww.ts ├── jd_cww_help.js ├── jd_cww_help.ts ├── jd_deleteCart.js ├── jd_deleteCart.ts ├── jd_dreamFactory.js ├── jd_dreamFactory_help.js ├── jd_dwapp.js ├── jd_dwapp.ts ├── jd_family.js ├── jd_foodRunning.js ├── jd_foodRunning.ts ├── jd_fruit.js ├── jd_fruit_help.js ├── jd_fruit_help.ts ├── jd_fruit_without_help.js ├── jd_fruit_without_help.ts ├── jd_gold_creator.js ├── jd_hby.js ├── jd_hby.ts ├── jd_health.js ├── jd_health.ts ├── jd_health_collect.js ├── jd_health_collect.ts ├── jd_ifanli.js ├── jd_ifanli.ts ├── jd_jdfactory.js ├── jd_jdzz.js ├── jd_jdzz.ts ├── jd_jin_tie.js ├── jd_jinli_hongbao.js ├── jd_jinli_hongbao.ts ├── jd_joy_park_run.js ├── jd_joy_park_run.ts ├── jd_jxScore.js ├── jd_jxScore.ts ├── jd_jxgc.js ├── jd_jxgc.ts ├── jd_jxgc_stock.js ├── jd_jxgc_stock.ts ├── jd_jxmc.js ├── jd_jxmc.ts ├── jd_jxmc_getCoin.js ├── jd_jxmc_getCoin.ts ├── jd_jxmc_stock.js ├── jd_jxmc_stock.ts ├── jd_kd.js ├── jd_live.js ├── jd_makemoneyshop.js ├── jd_makemoneyshop.ts ├── jd_miniTask.js ├── jd_miniTask.ts ├── jd_moneyTree.js ├── jd_moneyTree.ts ├── jd_nzmh.js ├── jd_pet.js ├── jd_pigPet.js ├── jd_plantBean.js ├── jd_plantBean__help.js ├── jd_plantBean__help.ts ├── jd_ql_repo.js ├── jd_ql_repo.ts ├── jd_qq_pasture.js ├── jd_qq_pasture.ts ├── jd_queryRedpacket.js ├── jd_queryRedpacket.ts ├── jd_sgmh.js ├── jd_sgmh.ts ├── jd_speed_3.js ├── jd_speed_3.ts ├── jd_speed_coin.js ├── jd_speed_monitor.js ├── jd_speed_monitor.ts ├── jd_speed_sign.js ├── jd_speed_sign.ts ├── jd_speed_wabao.js ├── jd_speed_wabao.ts ├── jd_superMarket.js ├── jd_tewu.js ├── jd_tewu.ts ├── jd_track.js ├── jd_track.ts ├── jd_unsubscribe.js ├── jd_unsubscribe.ts ├── jd_wechat_sign.js ├── jd_wechat_sign.ts ├── jd_yili_cow.js ├── jd_yili_cow.ts ├── package.json ├── reset.sh ├── sendNotify.js ├── thread.py ├── tsconfig.json ├── utils ├── JDJRValidator_Pure.js ├── V3.js ├── V3.ts ├── account_demo.json ├── empty.json ├── exceptCookie.json ├── h5st.js ├── h5st.ts ├── h5st_pro.js ├── h5st_pro.ts ├── jdShareCodes.js ├── jd_appopen.js ├── jd_joy_getInvokeKey.js ├── jd_joy_getInvokeKey.ts ├── jd_joy_validate.js ├── jd_jxmc.js ├── pushplus.js ├── pushplus.ts ├── shareCodesTool.js ├── shareCodesTool.ts ├── sharecodes.json ├── sign_graphics_validate.js ├── validate_single.js └── vendors.683f5a61.js ├── z_jd_喂猪.js └── z_jd_喂猪.ts /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 JDHelloWorld 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /TS_JDHelloWorld.d.ts: -------------------------------------------------------------------------------- 1 | interface User { 2 | index: number; 3 | UserName: string; 4 | cookie: string; 5 | UserAgent: string; 6 | end?: boolean; 7 | } 8 | declare class JDHelloWorld { 9 | scriptName: string; 10 | cookiesArr: string[]; 11 | users: User[]; 12 | constructor(scriptName?: string); 13 | getCookie(): Promise; 14 | exceptCookie(filename?: string): string[]; 15 | get(url: string, headers?: any, params?: object): Promise; 16 | post(url: string, data: any, headers?: any, params?: object): Promise; 17 | wait(ms?: number): Promise; 18 | o2s(msg: string | object, title?: string): void; 19 | getShareCodePool(key: string, num: number): Promise; 20 | getshareCodeHW(key: string): Promise; 21 | getRandomWord(): string; 22 | getRandomNumberByRange(start: number, end: number): number; 23 | getRandomNumString(e: number): string; 24 | getEncStr(fn: string, body: { 25 | id?: number; 26 | taskType?: number; 27 | }): object; 28 | getSign(fn: string, body: object): Promise; 29 | getIosVer(): string; 30 | getFp(): Promise; 31 | body(body: object): Promise; 32 | run(son: { 33 | main: any; 34 | help?: any; 35 | tips?: any; 36 | }, help?: Function, tips?: Function): Promise; 37 | } 38 | export { User, JDHelloWorld }; 39 | -------------------------------------------------------------------------------- /archive/jd_88hb.js: -------------------------------------------------------------------------------- 1 | // /** 2 | // * 京喜->领88元红包 3 | // * CK1 HW.ts -> 内部 4 | // * CK2-n 内部 -> HW.ts 5 | // * cron: 5 0,6,16 * * * 6 | // */ 7 | // 8 | // import axios from "axios" 9 | // import {requestAlgo, geth5st} from "./utils/V3"; 10 | // import {requireConfig, wait, getshareCodeHW, randomString, randomWord, o2s} from "./TS_USER_AGENTS" 11 | // 12 | // const token = require('./utils/jd_jxmc.js').token 13 | // 14 | // let cookie: string = '', res: any = '', UserName: string, UA: string = '' 15 | // let shareCodesSelf: string[] = [], shareCodes: string[] = [], shareCodesHW: string[] = [], jxToken: any, data: any 16 | // 17 | // !(async () => { 18 | // let cookiesArr: any = await requireConfig() 19 | // for (let [index, value] of cookiesArr.entries()) { 20 | // cookie = value 21 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 22 | // console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 23 | // jxToken = await token(cookie) 24 | // await requestAlgo('e395f') 25 | // res = await api('GetUserInfo', 'activeId', {activeId: '529439'}) 26 | // o2s(res) 27 | // await wait(2000) 28 | // 29 | // let strUserPin: string = res.Data.strUserPin, dwHelpedTimes: number = res.Data.dwHelpedTimes 30 | // console.log('收到助力:', dwHelpedTimes) 31 | // console.log('助力码:', strUserPin) 32 | // shareCodesSelf.push(strUserPin) 33 | // 34 | // res = await api('JoinActive', 'phoneid,stepreward_jstoken,strPin,timestamp', {phoneid: jxToken.phoneid, stepreward_jstoken: jxToken.farm_jstoken, strPin: '', timestamp: jxToken.timestamp}) 35 | // res.iRet === 0 ? console.log('JoinActive: 成功') : console.log('JoinActive:', res.sErrMsg) 36 | // await wait(2000) 37 | // } 38 | // 39 | // console.log('内部助力码:', shareCodesSelf) 40 | // 41 | // for (let [index, value] of cookiesArr.entries()) { 42 | // await requestAlgo('e395f') 43 | // cookie = value 44 | // jxToken = await token(cookie) 45 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 46 | // res = await api('GetUserInfo', 'activeId', {activeId: '529439'}) 47 | // await wait(1000) 48 | // let strUserPin: string = res.Data.strUserPin 49 | // 50 | // if (shareCodesHW.length === 0) { 51 | // shareCodesHW = await getshareCodeHW('88hb') 52 | // } 53 | // if (index === 0) { 54 | // shareCodes = Array.from(new Set([...shareCodesHW, ...shareCodesSelf])) 55 | // } else { 56 | // shareCodes = Array.from(new Set([...shareCodesSelf, ...shareCodesHW])) 57 | // } 58 | // for (let code of shareCodes) { 59 | // if (code !== strUserPin) { 60 | // console.log(`账号 ${UserName} 去助力 ${code}`) 61 | // res = await api('EnrollFriend', 'phoneid,stepreward_jstoken,strPin,timestamp', { 62 | // phoneid: jxToken.phoneid, 63 | // stepreward_jstoken: jxToken.farm_jstoken, 64 | // strPin: code, 65 | // timestamp: jxToken.timestamp 66 | // }) 67 | // if (res.iRet === 0) { 68 | // console.log('成功') 69 | // } else if (res.iRet === 2015) { 70 | // console.log('上限') 71 | // break 72 | // } else if (res.iRet === 2016) { 73 | // console.log('火爆') 74 | // break 75 | // } else { 76 | // console.log('其他错误:', res) 77 | // } 78 | // await wait(5000) 79 | // } 80 | // } 81 | // } 82 | // 83 | // // 拆红包 84 | // for (let [index, value] of cookiesArr.entries()) { 85 | // await requestAlgo('e395f') 86 | // cookie = value 87 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 88 | // jxToken = await token(cookie) 89 | // console.log(`\n开始【京东账号${index + 1}】${UserName} 拆红包\n`) 90 | // 91 | // res = await api('GetUserInfo', 'activeId', {activeId: '529439'}) 92 | // let dwHelpedTimes: number = res.Data.dwHelpedTimes 93 | // await wait(2000) 94 | // 95 | // for (let t of res.Data.gradeConfig) { 96 | // if (dwHelpedTimes >= t.dwHelpTimes && t.dwIsHasDraw === 1) { 97 | // res = await api('DoGradeDraw', 'grade', {grade: t.dwGrade}) 98 | // if (res.iRet === 0) 99 | // console.log(`等级${t.dwGrade}红包打开成功`) 100 | // else { 101 | // console.log('其他错误', res.sErrMsg ?? JSON.stringify(res)) 102 | // break 103 | // } 104 | // await wait(15000) 105 | // } else { 106 | // console.log(`等级${t.dwGrade}红包已打开`) 107 | // } 108 | // } 109 | // } 110 | // })() 111 | // 112 | // async function api(fn: string, stk: string, params?: object) { 113 | // let timestamp: number = Date.now() 114 | // let url: string = `https://m.jingxi.com/cubeactive/steprewardv3/${fn}?activeId=529439&_stk=${stk}&_ste=1&userDraw=0&publishFlag=1&channel=7&_t=${timestamp}&_=${timestamp}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls` 115 | // UA = `jdpingou;iPhone;4.13.0;14.4.2;${randomString(40)};network/wifi;model/iPhone10,2;appBuild/100609;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/1;hasOCPay/0;supportBestPay/0;session/${Math.random() * 98 + 1};pap/JA2019_3111789;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148` 116 | // let t: { key: string, value: string } [] = [] 117 | // for (let [key, value] of Object.entries(params)) { 118 | // t.push({key, value}) 119 | // url += `&${key}=${value}` 120 | // } 121 | // let h5st = geth5st(t, 'e395f') 122 | // url += `&h5st=${encodeURIComponent(h5st)}` 123 | // try { 124 | // let {data}: any = await axios.get(url, { 125 | // headers: { 126 | // 'Host': 'm.jingxi.com', 127 | // 'User-Agent': UA, 128 | // 'Referer': 'https://st.jingxi.com/sns/202106/29/signinhb_new/index.html', 129 | // 'Cookie': cookie 130 | // } 131 | // }) 132 | // return JSON.parse(data.match(/jsonpCBK.?\((.*)/)![1]) 133 | // } catch (e: any) { 134 | // return {} 135 | // } 136 | // } 137 | -------------------------------------------------------------------------------- /archive/jd_88hb.ts: -------------------------------------------------------------------------------- 1 | // /** 2 | // * 京喜->领88元红包 3 | // * CK1 HW.ts -> 内部 4 | // * CK2-n 内部 -> HW.ts 5 | // * cron: 5 0,6,16 * * * 6 | // */ 7 | // 8 | // import axios from "axios" 9 | // import {requestAlgo, geth5st} from "./utils/V3"; 10 | // import {requireConfig, wait, getshareCodeHW, randomString, randomWord, o2s} from "./TS_USER_AGENTS" 11 | // 12 | // const token = require('./utils/jd_jxmc.js').token 13 | // 14 | // let cookie: string = '', res: any = '', UserName: string, UA: string = '' 15 | // let shareCodesSelf: string[] = [], shareCodes: string[] = [], shareCodesHW: string[] = [], jxToken: any, data: any 16 | // 17 | // !(async () => { 18 | // let cookiesArr: any = await requireConfig() 19 | // for (let [index, value] of cookiesArr.entries()) { 20 | // cookie = value 21 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 22 | // console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 23 | // jxToken = await token(cookie) 24 | // await requestAlgo('e395f') 25 | // res = await api('GetUserInfo', 'activeId', {activeId: '529439'}) 26 | // o2s(res) 27 | // await wait(2000) 28 | // 29 | // let strUserPin: string = res.Data.strUserPin, dwHelpedTimes: number = res.Data.dwHelpedTimes 30 | // console.log('收到助力:', dwHelpedTimes) 31 | // console.log('助力码:', strUserPin) 32 | // shareCodesSelf.push(strUserPin) 33 | // 34 | // res = await api('JoinActive', 'phoneid,stepreward_jstoken,strPin,timestamp', {phoneid: jxToken.phoneid, stepreward_jstoken: jxToken.farm_jstoken, strPin: '', timestamp: jxToken.timestamp}) 35 | // res.iRet === 0 ? console.log('JoinActive: 成功') : console.log('JoinActive:', res.sErrMsg) 36 | // await wait(2000) 37 | // } 38 | // 39 | // console.log('内部助力码:', shareCodesSelf) 40 | // 41 | // for (let [index, value] of cookiesArr.entries()) { 42 | // await requestAlgo('e395f') 43 | // cookie = value 44 | // jxToken = await token(cookie) 45 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 46 | // res = await api('GetUserInfo', 'activeId', {activeId: '529439'}) 47 | // await wait(1000) 48 | // let strUserPin: string = res.Data.strUserPin 49 | // 50 | // if (shareCodesHW.length === 0) { 51 | // shareCodesHW = await getshareCodeHW('88hb') 52 | // } 53 | // if (index === 0) { 54 | // shareCodes = Array.from(new Set([...shareCodesHW, ...shareCodesSelf])) 55 | // } else { 56 | // shareCodes = Array.from(new Set([...shareCodesSelf, ...shareCodesHW])) 57 | // } 58 | // for (let code of shareCodes) { 59 | // if (code !== strUserPin) { 60 | // console.log(`账号 ${UserName} 去助力 ${code}`) 61 | // res = await api('EnrollFriend', 'phoneid,stepreward_jstoken,strPin,timestamp', { 62 | // phoneid: jxToken.phoneid, 63 | // stepreward_jstoken: jxToken.farm_jstoken, 64 | // strPin: code, 65 | // timestamp: jxToken.timestamp 66 | // }) 67 | // if (res.iRet === 0) { 68 | // console.log('成功') 69 | // } else if (res.iRet === 2015) { 70 | // console.log('上限') 71 | // break 72 | // } else if (res.iRet === 2016) { 73 | // console.log('火爆') 74 | // break 75 | // } else { 76 | // console.log('其他错误:', res) 77 | // } 78 | // await wait(5000) 79 | // } 80 | // } 81 | // } 82 | // 83 | // // 拆红包 84 | // for (let [index, value] of cookiesArr.entries()) { 85 | // await requestAlgo('e395f') 86 | // cookie = value 87 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 88 | // jxToken = await token(cookie) 89 | // console.log(`\n开始【京东账号${index + 1}】${UserName} 拆红包\n`) 90 | // 91 | // res = await api('GetUserInfo', 'activeId', {activeId: '529439'}) 92 | // let dwHelpedTimes: number = res.Data.dwHelpedTimes 93 | // await wait(2000) 94 | // 95 | // for (let t of res.Data.gradeConfig) { 96 | // if (dwHelpedTimes >= t.dwHelpTimes && t.dwIsHasDraw === 1) { 97 | // res = await api('DoGradeDraw', 'grade', {grade: t.dwGrade}) 98 | // if (res.iRet === 0) 99 | // console.log(`等级${t.dwGrade}红包打开成功`) 100 | // else { 101 | // console.log('其他错误', res.sErrMsg ?? JSON.stringify(res)) 102 | // break 103 | // } 104 | // await wait(15000) 105 | // } else { 106 | // console.log(`等级${t.dwGrade}红包已打开`) 107 | // } 108 | // } 109 | // } 110 | // })() 111 | // 112 | // async function api(fn: string, stk: string, params?: object) { 113 | // let timestamp: number = Date.now() 114 | // let url: string = `https://m.jingxi.com/cubeactive/steprewardv3/${fn}?activeId=529439&_stk=${stk}&_ste=1&userDraw=0&publishFlag=1&channel=7&_t=${timestamp}&_=${timestamp}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls` 115 | // UA = `jdpingou;iPhone;4.13.0;14.4.2;${randomString(40)};network/wifi;model/iPhone10,2;appBuild/100609;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/1;hasOCPay/0;supportBestPay/0;session/${Math.random() * 98 + 1};pap/JA2019_3111789;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148` 116 | // let t: { key: string, value: string } [] = [] 117 | // for (let [key, value] of Object.entries(params)) { 118 | // t.push({key, value}) 119 | // url += `&${key}=${value}` 120 | // } 121 | // let h5st = geth5st(t, 'e395f') 122 | // url += `&h5st=${encodeURIComponent(h5st)}` 123 | // try { 124 | // let {data}: any = await axios.get(url, { 125 | // headers: { 126 | // 'Host': 'm.jingxi.com', 127 | // 'User-Agent': UA, 128 | // 'Referer': 'https://st.jingxi.com/sns/202106/29/signinhb_new/index.html', 129 | // 'Cookie': cookie 130 | // } 131 | // }) 132 | // return JSON.parse(data.match(/jsonpCBK.?\((.*)/)![1]) 133 | // } catch (e: any) { 134 | // return {} 135 | // } 136 | // } -------------------------------------------------------------------------------- /archive/jd_cfd_shell.js: -------------------------------------------------------------------------------- 1 | // /** 2 | // * 财富岛捡贝壳挂后台 3 | // * cron: 10 0 * * * 4 | // */ 5 | // 6 | // import axios from 'axios' 7 | // import {getCookie, wait, requestAlgo, h5st, randomWord} from './TS_USER_AGENTS' 8 | // 9 | // let cookie: string = '', res: any = '' 10 | // process.env.CFD_LOOP_DELAY ? console.log('设置延迟:', parseInt(process.env.CFD_LOOP_DELAY)) : console.log('设置延迟:10000~25000随机') 11 | // 12 | // let UserName: string, index: number 13 | // !(async () => { 14 | // await requestAlgo() 15 | // let cookiesArr: string[] = await getCookie() 16 | // 17 | // while (1) { 18 | // if (new Date().getHours() === 0 && new Date().getMinutes() < 10) 19 | // break 20 | // for (let i = 0; i < cookiesArr.length; i++) { 21 | // cookie = cookiesArr[i] 22 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 23 | // index = i + 1 24 | // console.log(`\n开始【京东账号${index}】${UserName}\n`) 25 | // try { 26 | // let shell: any = await speedUp('_cfd_t,bizCode,dwEnv,ptag,source,strZone') 27 | // if (shell?.Data?.NormShell) { 28 | // for (let s of shell.Data.NormShell) { 29 | // for (let j = 0; j < s.dwNum; j++) { 30 | // res = await speedUp('_cfd_t,bizCode,dwEnv,dwType,ptag,source,strZone', s.dwType) 31 | // if (res.iRet !== 0) { 32 | // console.log(res) 33 | // break 34 | // } 35 | // console.log('捡贝壳:', res.Data.strFirstDesc) 36 | // await wait(1500) 37 | // } 38 | // } 39 | // } 40 | // } catch (e) { 41 | // console.log(e) 42 | // } 43 | // } 44 | // await wait(60 * 10 * 1000) // 10min 45 | // } 46 | // })() 47 | // 48 | // async function speedUp(stk: string, dwType?: number) { 49 | // try { 50 | // let url: string = stk === '_cfd_t,bizCode,dwEnv,ptag,source,strZone' 51 | // ? `https://m.jingxi.com/jxbfd/story/queryshell?strZone=jxbfd&bizCode=jxbfd&source=jxbfd&dwEnv=7&_cfd_t=${Date.now()}&ptag=&_stk=_cfd_t%2CbizCode%2CdwEnv%2Cptag%2Csource%2CstrZone&_ste=1&_=${Date.now()}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls` 52 | // : `https://m.jingxi.com/jxbfd/story/pickshell?strZone=jxbfd&bizCode=jxbfd&source=jxbfd&dwEnv=7&_cfd_t=${Date.now()}&ptag=&dwType=${dwType}&_stk=_cfd_t%2CbizCode%2CdwEnv%2CdwType%2Cptag%2Csource%2CstrZone&_ste=1&_=${Date.now()}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls` 53 | // url = h5st(url, stk, {}) 54 | // let {data} = await axios.get(url, { 55 | // headers: { 56 | // 'Host': 'm.jingxi.com', 57 | // 'Referer': 'https://st.jingxi.com/', 58 | // 'User-Agent': 'jdpingou;', 59 | // 'Cookie': cookie 60 | // } 61 | // }) 62 | // return JSON.parse(data.match(/jsonpCBK.?\((.*)/)![1]) 63 | // } catch (e) { 64 | // return '' 65 | // } 66 | // } 67 | -------------------------------------------------------------------------------- /archive/jd_cfd_shell.ts: -------------------------------------------------------------------------------- 1 | // /** 2 | // * 财富岛捡贝壳挂后台 3 | // * cron: 10 0 * * * 4 | // */ 5 | // 6 | // import axios from 'axios' 7 | // import {getCookie, wait, requestAlgo, h5st, randomWord} from './TS_USER_AGENTS' 8 | // 9 | // let cookie: string = '', res: any = '' 10 | // process.env.CFD_LOOP_DELAY ? console.log('设置延迟:', parseInt(process.env.CFD_LOOP_DELAY)) : console.log('设置延迟:10000~25000随机') 11 | // 12 | // let UserName: string, index: number 13 | // !(async () => { 14 | // await requestAlgo() 15 | // let cookiesArr: string[] = await getCookie() 16 | // 17 | // while (1) { 18 | // if (new Date().getHours() === 0 && new Date().getMinutes() < 10) 19 | // break 20 | // for (let i = 0; i < cookiesArr.length; i++) { 21 | // cookie = cookiesArr[i] 22 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 23 | // index = i + 1 24 | // console.log(`\n开始【京东账号${index}】${UserName}\n`) 25 | // try { 26 | // let shell: any = await speedUp('_cfd_t,bizCode,dwEnv,ptag,source,strZone') 27 | // if (shell?.Data?.NormShell) { 28 | // for (let s of shell.Data.NormShell) { 29 | // for (let j = 0; j < s.dwNum; j++) { 30 | // res = await speedUp('_cfd_t,bizCode,dwEnv,dwType,ptag,source,strZone', s.dwType) 31 | // if (res.iRet !== 0) { 32 | // console.log(res) 33 | // break 34 | // } 35 | // console.log('捡贝壳:', res.Data.strFirstDesc) 36 | // await wait(1500) 37 | // } 38 | // } 39 | // } 40 | // } catch (e) { 41 | // console.log(e) 42 | // } 43 | // } 44 | // await wait(60 * 10 * 1000) // 10min 45 | // } 46 | // })() 47 | // 48 | // async function speedUp(stk: string, dwType?: number) { 49 | // try { 50 | // let url: string = stk === '_cfd_t,bizCode,dwEnv,ptag,source,strZone' 51 | // ? `https://m.jingxi.com/jxbfd/story/queryshell?strZone=jxbfd&bizCode=jxbfd&source=jxbfd&dwEnv=7&_cfd_t=${Date.now()}&ptag=&_stk=_cfd_t%2CbizCode%2CdwEnv%2Cptag%2Csource%2CstrZone&_ste=1&_=${Date.now()}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls` 52 | // : `https://m.jingxi.com/jxbfd/story/pickshell?strZone=jxbfd&bizCode=jxbfd&source=jxbfd&dwEnv=7&_cfd_t=${Date.now()}&ptag=&dwType=${dwType}&_stk=_cfd_t%2CbizCode%2CdwEnv%2CdwType%2Cptag%2Csource%2CstrZone&_ste=1&_=${Date.now()}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls` 53 | // url = h5st(url, stk, {}) 54 | // let {data} = await axios.get(url, { 55 | // headers: { 56 | // 'Host': 'm.jingxi.com', 57 | // 'Referer': 'https://st.jingxi.com/', 58 | // 'User-Agent': 'jdpingou;', 59 | // 'Cookie': cookie 60 | // } 61 | // }) 62 | // return JSON.parse(data.match(/jsonpCBK.?\((.*)/)![1]) 63 | // } catch (e) { 64 | // return '' 65 | // } 66 | // } -------------------------------------------------------------------------------- /archive/jd_getShareCodes.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * cron: 59 23 * * 0 3 | */ 4 | 5 | import {getCookie, wait} from "../TS_USER_AGENTS"; 6 | import {bean, farm, pet, factory, sgmh, jxfactory, health} from "../utils/shareCodesTool"; 7 | 8 | let cookie: string = '', UserName: string, index: number 9 | let beans: string = '', farms: string = '', healths: string = '', pets: string = '', factorys: string = '', jxfactorys: string = '', sgmhs: string = '', s: string = ''; 10 | !(async () => { 11 | let cookiesArr: string[] = await getCookie(); 12 | for (let i = 0; i < cookiesArr.length; i++) { 13 | cookie = cookiesArr[i]; 14 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 15 | index = i + 1; 16 | console.log(`\n开始【京东账号${index}】${UserName}\n`); 17 | s = await bean(cookie) 18 | s ? beans += s + '&' : '' 19 | console.log('种豆得豆:', s) 20 | s = await farm(cookie) 21 | s ? farms += s + '&' : '' 22 | console.log('东东农场:', s) 23 | s = await health(cookie) 24 | s ? healths += s + '&' : '' 25 | console.log('京东健康:', s) 26 | s = await pet(cookie) 27 | s ? pets += s + '&' : '' 28 | console.log('东东萌宠:', s) 29 | s = await factory(cookie) 30 | s ? factorys += s + '&' : '' 31 | console.log('东东工厂:', s) 32 | s = await jxfactory(cookie) 33 | s ? jxfactorys += s + '&' : '' 34 | console.log('京喜工厂:', s) 35 | s = await sgmh(cookie) 36 | s ? sgmhs += s + '&' : '' 37 | console.log('闪购盲盒:', s) 38 | await wait(5000) 39 | } 40 | console.log('/bean', beans.substring(0, beans.length - 1)) 41 | console.log('/farm', farms.substring(0, farms.length - 1)) 42 | console.log('/health', healths.substring(0, healths.length - 1)) 43 | console.log('/pet', pets.substring(0, pets.length - 1)) 44 | console.log('/factory', factorys.substring(0, factorys.length - 1)) 45 | console.log('/jxfactory', jxfactorys.substring(0, jxfactorys.length - 1)) 46 | console.log('/sgmh', sgmhs.substring(0, sgmhs.length - 1)) 47 | })() 48 | -------------------------------------------------------------------------------- /archive/jd_version.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * 仓库可更新提醒 4 | * 仅通知,不会自动更新 5 | */ 6 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 7 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 8 | return new (P || (P = Promise))(function (resolve, reject) { 9 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 10 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 11 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 12 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 13 | }); 14 | }; 15 | var __generator = (this && this.__generator) || function (thisArg, body) { 16 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 17 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 18 | function verb(n) { return function (v) { return step([n, v]); }; } 19 | function step(op) { 20 | if (f) throw new TypeError("Generator is already executing."); 21 | while (g && (g = 0, op[0] && (_ = 0)), _) try { 22 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 23 | if (y = 0, t) op = [op[0] & 2, t.value]; 24 | switch (op[0]) { 25 | case 0: case 1: t = op; break; 26 | case 4: _.label++; return { value: op[1], done: false }; 27 | case 5: _.label++; y = op[1]; op = [0]; continue; 28 | case 7: op = _.ops.pop(); _.trys.pop(); continue; 29 | default: 30 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 31 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 32 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 33 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 34 | if (t[2]) _.ops.pop(); 35 | _.trys.pop(); continue; 36 | } 37 | op = body.call(thisArg, _); 38 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 39 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 40 | } 41 | }; 42 | exports.__esModule = true; 43 | var axios_1 = require("axios"); 44 | var child_process_1 = require("child_process"); 45 | var sendNotify_1 = require("./sendNotify"); 46 | !(function () { return __awaiter(void 0, void 0, void 0, function () { 47 | var cwd, localVersion, remote; 48 | return __generator(this, function (_a) { 49 | switch (_a.label) { 50 | case 0: 51 | cwd = '.'; 52 | if (process.env.HOSTNAME === 'qinglong') { 53 | cwd = '/ql/repo/JDHelloWorld_jd_scripts'; 54 | } 55 | localVersion = (0, child_process_1.execSync)("git rev-parse HEAD", { cwd: cwd }).toString().trim(); 56 | console.log('local ', localVersion); 57 | return [4 /*yield*/, githubVersion()]; 58 | case 1: 59 | remote = _a.sent(); 60 | console.log('remote', remote); 61 | if (!(remote.version && remote.version !== localVersion)) return [3 /*break*/, 3]; 62 | return [4 /*yield*/, (0, sendNotify_1.sendNotify)('JDHelloWorld new commit', "\u6709\u65B0\u7248\u672C\u4E86\n".concat(remote.commit))]; 63 | case 2: 64 | _a.sent(); 65 | _a.label = 3; 66 | case 3: return [2 /*return*/]; 67 | } 68 | }); 69 | }); })(); 70 | function githubVersion() { 71 | return __awaiter(this, void 0, void 0, function () { 72 | var config, data, e_1; 73 | return __generator(this, function (_a) { 74 | switch (_a.label) { 75 | case 0: 76 | _a.trys.push([0, 2, , 3]); 77 | config = { timeout: 5000 }; 78 | if (process.env.ProxyUrl) { 79 | Object.assign(config, { 80 | proxy: { 81 | host: process.env.ProxyUrl.match(/https?:\/\/(.*):/)[1], 82 | port: parseInt(process.env.ProxyUrl.match(/https?:.*:(\d+)/)[1]) 83 | } 84 | }); 85 | } 86 | return [4 /*yield*/, axios_1["default"].get('https://github.com/JDHelloWorld/jd_scripts/commits/main', config)]; 87 | case 1: 88 | data = (_a.sent()).data; 89 | return [2 /*return*/, { 90 | version: data.match(/Permalink<\/a>/)[1], 91 | commit: data.match(/(.*)<\/a>/)[1] 92 | }]; 93 | case 2: 94 | e_1 = _a.sent(); 95 | return [2 /*return*/, { 96 | version: '', 97 | commit: '' 98 | }]; 99 | case 3: return [2 /*return*/]; 100 | } 101 | }); 102 | }); 103 | } 104 | -------------------------------------------------------------------------------- /archive/jd_version.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 仓库可更新提醒 3 | * 仅通知,不会自动更新 4 | */ 5 | 6 | import axios from "axios"; 7 | import {execSync} from "child_process"; 8 | import {sendNotify} from './sendNotify'; 9 | 10 | !(async () => { 11 | let cwd: string = '.' 12 | if (process.env.HOSTNAME === 'qinglong') { 13 | cwd = '/ql/repo/JDHelloWorld_jd_scripts' 14 | } 15 | let localVersion: string = execSync("git rev-parse HEAD", {cwd}).toString().trim() 16 | console.log('local ', localVersion) 17 | 18 | let remote: { version: string, commit: string } = await githubVersion() 19 | console.log('remote', remote) 20 | if (remote.version && remote.version !== localVersion) { 21 | await sendNotify('JDHelloWorld new commit', `有新版本了\n${remote.commit}`) 22 | } 23 | })() 24 | 25 | async function githubVersion() { 26 | try { 27 | // process.env.ProxyUrl = 'http://127.0.0.1:1080' 28 | let config: object = {timeout: 5000} 29 | if (process.env.ProxyUrl) { 30 | Object.assign(config, { 31 | proxy: { 32 | host: process.env.ProxyUrl.match(/https?:\/\/(.*):/)[1], 33 | port: parseInt(process.env.ProxyUrl.match(/https?:.*:(\d+)/)[1]) 34 | } 35 | }) 36 | } 37 | let {data} = await axios.get('https://github.com/JDHelloWorld/jd_scripts/commits/main', config) 38 | return { 39 | version: data.match(/Permalink<\/a>/)[1], 40 | commit: data.match(/(.*)<\/a>/)[1] 41 | } 42 | } catch (e) { 43 | return { 44 | version: '', 45 | commit: '' 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /archive/jx_box.js: -------------------------------------------------------------------------------- 1 | // /** 2 | // * 京喜-88红包-宝箱 3 | // * 做任务、开宝箱 4 | // * 每号可收20次助力,出1次助力 5 | // * cron: 5 0,6,12 * * * 6 | // * CK1默认优先助力HW.ts,其余助力CK1 7 | // * HW_Priority: boolean 8 | // * true HW.ts -> 内部 9 | // * false 内部 -> HW.ts 10 | // */ 11 | // 12 | // import axios from 'axios' 13 | // import {requireConfig, wait, requestAlgo, h5st, randomWord} from './TS_USER_AGENTS' 14 | // 15 | // let cookie: string = '', res: any = '', UserName: string, index: number 16 | // let shareCodeSelf: string[] = [], shareCode: string[] = [], shareCodeHW: string[] = ['bdf489af86e5021575040fffee407bc2', '92a46b6081a955fb4dcea1e56e590b3a', '638d77021a1dd4d74cad72d44afd9899', 'f4dc33716d2551e372fd44f5ac0baca8', 'c99659c47858f18fb34427fec4647f17', '34bf741e6bb01c53d879f58b2c1a9205'] 17 | // let HW_Priority: boolean = true 18 | // process.env.HW_Priority === 'false' ? HW_Priority = false : '' 19 | // 20 | // !(async () => { 21 | // await requestAlgo() 22 | // let cookiesArr: string[] = await requireConfig() 23 | // cookie = cookiesArr[0] 24 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 25 | // console.log(`\n开始【京东账号1 ${UserName}\n`) 26 | // 27 | // res = await api('query', 'signhb_source,smp,type', {}) 28 | // console.log('助力码:', res.smp) 29 | // shareCodeSelf.push(res.smp) 30 | // 31 | // console.log('内部助力:', shareCodeSelf) 32 | // for (let i = 0; i < cookiesArr.length; i++) { 33 | // let HW_Random = shareCodeHW[Math.floor(Math.random() * shareCodeHW.length)] 34 | // if (i === 0 && HW_Priority) { 35 | // shareCode = Array.from(new Set([HW_Random, ...shareCodeSelf])) 36 | // } else { 37 | // shareCode = Array.from(new Set([...shareCodeSelf, HW_Random])) 38 | // } 39 | // cookie = cookiesArr[i] 40 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 41 | // for (let code of shareCode) { 42 | // console.log(`${UserName} 去助力 ${code}`) 43 | // res = await api('query', 'signhb_source,smp,type', {signhb_source: 5, smp: code, type: 1}) 44 | // console.log('助力码:', res.smp) 45 | // await wait(2000) 46 | // if (res.autosign_sendhb !== '0' || res.todaysign === 1) 47 | // break 48 | // } 49 | // } 50 | // 51 | // for (let i = 0; i < cookiesArr.length; i++) { 52 | // cookie = cookiesArr[i] 53 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 54 | // index = i + 1 55 | // console.log(`\n开始【京东账号${index}】${UserName}\n`) 56 | // 57 | // try { 58 | // // 宝箱任务 59 | // res = await api('query', 'ispp,signhb_source,smp,tk,type', {signhb_source: 5, smp: '', ispp: 0, tk: '', type: 1}) 60 | // try { 61 | // console.log(res.invitesign) 62 | // console.log(parseFloat(res.invitesign.getmoney)) 63 | // } catch (e) { 64 | // console.log(res) 65 | // } 66 | // await wait(2000) 67 | // 68 | // res = await api('query', 'signhb_source,smp,type', {signhb_source: 5, smp: '', type: 1}) 69 | // for (let t of res.commontask || []) { 70 | // if (t.status === 1) { 71 | // console.log(t.taskname) 72 | // res = await api(`https://m.jingxi.com/fanxiantask/signhb/dotask?task=${t.task}&signhb_source=5&_=${Date.now()}&sceneval=2`, '') 73 | // if (res.ret === 0) { 74 | // console.log('任务完成,获得:', res.sendhb) 75 | // } else { 76 | // console.log('任务失败:', res.errmsg) 77 | // } 78 | // await wait(3000) 79 | // } 80 | // } 81 | // 82 | // // 开宝箱 83 | // res = await api('query', 'signhb_source,smp,type', {signhb_source: 5, smp: '', type: 1}) 84 | // if (res.baoxiang_left != 0) { 85 | // console.log(res.baoxiang_stage) 86 | // for (let t of res.baoxiang_stage) { 87 | // if (t.status === 1) { 88 | // res = await api(`https://m.jingxi.com/fanxiantask/signhb/bxdraw?_=${Date.now()}&sceneval=2`, '') 89 | // console.log('开宝箱,获得:', res.sendhb) 90 | // await wait(3000) 91 | // } 92 | // } 93 | // } 94 | // } catch (e: any) { 95 | // console.log(e) 96 | // } 97 | // await wait(3000) 98 | // } 99 | // })() 100 | // 101 | // interface Params { 102 | // signhb_source?: number, 103 | // type?: number, 104 | // smp?: string, 105 | // ispp?: number, 106 | // tk?: string 107 | // } 108 | // 109 | // async function api(fn: string, stk: string, params: Params = {}) { 110 | // let url = `https://m.jingxi.com/fanxiantask/signhb/${fn}?_stk=${encodeURIComponent(stk)}&_ste=1&_=${Date.now()}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls` 111 | // if (fn.match(/(dotask|bxdraw)/)) { 112 | // url = fn 113 | // } 114 | // url = h5st(url, stk, params, 10038) 115 | // let {data}: any = await axios.get(url, { 116 | // headers: { 117 | // 'Host': 'm.jingxi.com', 118 | // 'Accept': '*/*', 119 | // 'Connection': 'keep-alive', 120 | // 'User-Agent': 'jdpingou;', 121 | // 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', 122 | // 'Referer': 'https://st.jingxi.com/', 123 | // 'Cookie': cookie, 124 | // } 125 | // }) 126 | // return JSON.parse(data.match(/\((.*)/)![1]) 127 | // } 128 | -------------------------------------------------------------------------------- /archive/jx_box.ts: -------------------------------------------------------------------------------- 1 | // /** 2 | // * 京喜-88红包-宝箱 3 | // * 做任务、开宝箱 4 | // * 每号可收20次助力,出1次助力 5 | // * cron: 5 0,6,12 * * * 6 | // * CK1默认优先助力HW.ts,其余助力CK1 7 | // * HW_Priority: boolean 8 | // * true HW.ts -> 内部 9 | // * false 内部 -> HW.ts 10 | // */ 11 | // 12 | // import axios from 'axios' 13 | // import {requireConfig, wait, requestAlgo, h5st, randomWord} from './TS_USER_AGENTS' 14 | // 15 | // let cookie: string = '', res: any = '', UserName: string, index: number 16 | // let shareCodeSelf: string[] = [], shareCode: string[] = [], shareCodeHW: string[] = ['bdf489af86e5021575040fffee407bc2', '92a46b6081a955fb4dcea1e56e590b3a', '638d77021a1dd4d74cad72d44afd9899', 'f4dc33716d2551e372fd44f5ac0baca8', 'c99659c47858f18fb34427fec4647f17', '34bf741e6bb01c53d879f58b2c1a9205'] 17 | // let HW_Priority: boolean = true 18 | // process.env.HW_Priority === 'false' ? HW_Priority = false : '' 19 | // 20 | // !(async () => { 21 | // await requestAlgo() 22 | // let cookiesArr: string[] = await requireConfig() 23 | // cookie = cookiesArr[0] 24 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 25 | // console.log(`\n开始【京东账号1 ${UserName}\n`) 26 | // 27 | // res = await api('query', 'signhb_source,smp,type', {}) 28 | // console.log('助力码:', res.smp) 29 | // shareCodeSelf.push(res.smp) 30 | // 31 | // console.log('内部助力:', shareCodeSelf) 32 | // for (let i = 0; i < cookiesArr.length; i++) { 33 | // let HW_Random = shareCodeHW[Math.floor(Math.random() * shareCodeHW.length)] 34 | // if (i === 0 && HW_Priority) { 35 | // shareCode = Array.from(new Set([HW_Random, ...shareCodeSelf])) 36 | // } else { 37 | // shareCode = Array.from(new Set([...shareCodeSelf, HW_Random])) 38 | // } 39 | // cookie = cookiesArr[i] 40 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 41 | // for (let code of shareCode) { 42 | // console.log(`${UserName} 去助力 ${code}`) 43 | // res = await api('query', 'signhb_source,smp,type', {signhb_source: 5, smp: code, type: 1}) 44 | // console.log('助力码:', res.smp) 45 | // await wait(2000) 46 | // if (res.autosign_sendhb !== '0' || res.todaysign === 1) 47 | // break 48 | // } 49 | // } 50 | // 51 | // for (let i = 0; i < cookiesArr.length; i++) { 52 | // cookie = cookiesArr[i] 53 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 54 | // index = i + 1 55 | // console.log(`\n开始【京东账号${index}】${UserName}\n`) 56 | // 57 | // try { 58 | // // 宝箱任务 59 | // res = await api('query', 'ispp,signhb_source,smp,tk,type', {signhb_source: 5, smp: '', ispp: 0, tk: '', type: 1}) 60 | // try { 61 | // console.log(res.invitesign) 62 | // console.log(parseFloat(res.invitesign.getmoney)) 63 | // } catch (e) { 64 | // console.log(res) 65 | // } 66 | // await wait(2000) 67 | // 68 | // res = await api('query', 'signhb_source,smp,type', {signhb_source: 5, smp: '', type: 1}) 69 | // for (let t of res.commontask || []) { 70 | // if (t.status === 1) { 71 | // console.log(t.taskname) 72 | // res = await api(`https://m.jingxi.com/fanxiantask/signhb/dotask?task=${t.task}&signhb_source=5&_=${Date.now()}&sceneval=2`, '') 73 | // if (res.ret === 0) { 74 | // console.log('任务完成,获得:', res.sendhb) 75 | // } else { 76 | // console.log('任务失败:', res.errmsg) 77 | // } 78 | // await wait(3000) 79 | // } 80 | // } 81 | // 82 | // // 开宝箱 83 | // res = await api('query', 'signhb_source,smp,type', {signhb_source: 5, smp: '', type: 1}) 84 | // if (res.baoxiang_left != 0) { 85 | // console.log(res.baoxiang_stage) 86 | // for (let t of res.baoxiang_stage) { 87 | // if (t.status === 1) { 88 | // res = await api(`https://m.jingxi.com/fanxiantask/signhb/bxdraw?_=${Date.now()}&sceneval=2`, '') 89 | // console.log('开宝箱,获得:', res.sendhb) 90 | // await wait(3000) 91 | // } 92 | // } 93 | // } 94 | // } catch (e: any) { 95 | // console.log(e) 96 | // } 97 | // await wait(3000) 98 | // } 99 | // })() 100 | // 101 | // interface Params { 102 | // signhb_source?: number, 103 | // type?: number, 104 | // smp?: string, 105 | // ispp?: number, 106 | // tk?: string 107 | // } 108 | // 109 | // async function api(fn: string, stk: string, params: Params = {}) { 110 | // let url = `https://m.jingxi.com/fanxiantask/signhb/${fn}?_stk=${encodeURIComponent(stk)}&_ste=1&_=${Date.now()}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls` 111 | // if (fn.match(/(dotask|bxdraw)/)) { 112 | // url = fn 113 | // } 114 | // url = h5st(url, stk, params, 10038) 115 | // let {data}: any = await axios.get(url, { 116 | // headers: { 117 | // 'Host': 'm.jingxi.com', 118 | // 'Accept': '*/*', 119 | // 'Connection': 'keep-alive', 120 | // 'User-Agent': 'jdpingou;', 121 | // 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', 122 | // 'Referer': 'https://st.jingxi.com/', 123 | // 'Cookie': cookie, 124 | // } 125 | // }) 126 | // return JSON.parse(data.match(/\((.*)/)![1]) 127 | // } -------------------------------------------------------------------------------- /archive/jx_nnfls.js: -------------------------------------------------------------------------------- 1 | // /** 2 | // * 京喜-首页-牛牛福利 3 | // * 助力 内部 -> HW.ts 4 | // * 1 0,9,19,23 * * * 5 | // */ 6 | // 7 | // import axios from "axios" 8 | // import {getCookie, wait, h5st, o2s, getshareCodeHW} from "./TS_USER_AGENTS" 9 | // 10 | // let cookie: string = '', UserName: string, index: number, res: any = '' 11 | // let shareCodeSelf: string[] = [], shareCode: string[] = [], shareCodeHW: string[] = [] 12 | // 13 | // !(async () => { 14 | // let cookiesArr: string[] = await getCookie() 15 | // for (let i = 0; i < cookiesArr.length; i++) { 16 | // cookie = cookiesArr[i] 17 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 18 | // index = i + 1 19 | // console.log(`\n开始【京东账号${index}】${UserName}\n`) 20 | // 21 | // res = await api('sign/UserSignNew', 'sceneval,source', {source: ''}) 22 | // console.log('签到') 23 | // console.log('助力码', res.data.token) 24 | // shareCodeSelf.push(res.data.token) 25 | // let coin: number = res.data.pgAmountTotal 26 | // console.log('金币', coin) 27 | // 28 | // /* 29 | // res = await api('task/QueryUserTask', 'sceneval,taskType', {taskType: 0}) 30 | // let tasks: number[] = [] 31 | // if (res.datas) { 32 | // for (let t of res.datas) { 33 | // if (t.state !== 2) 34 | // tasks.push(t.taskid) 35 | // } 36 | // } else { 37 | // res = await api('task/QueryPgTaskCfg', 'sceneval', {}) 38 | // if (tasks.length === 0) { 39 | // for (let t of res.data.tasks) { 40 | // tasks.push(t.taskid) 41 | // } 42 | // } 43 | // } 44 | // console.log('tasks:', tasks) 45 | // await wait(2000) 46 | // 47 | // */ 48 | // 49 | // res = await api('task/QueryPgTaskCfg', 'sceneval', {}) 50 | // 51 | // for (let t of res.data.tasks) { 52 | // console.log(t.taskName) 53 | // res = await api('task/drawUserTask', 'sceneval,taskid', {taskid: t.taskId}) 54 | // await wait(t.param7 * 1000 + 1000) 55 | // res = await api('task/UserTaskFinish', 'sceneval,taskid', {taskid: t.taskId}) 56 | // o2s(res) 57 | // await wait(2000) 58 | // } 59 | // 60 | // res = await api('active/LuckyTwistUserInfo', 'sceneval', {}) 61 | // let surplusTimes: number = res.data.surplusTimes 62 | // console.log('剩余抽奖次数', surplusTimes) 63 | // for (let j = 0; j < surplusTimes && coin >= 10; j++) { 64 | // res = await api('active/LuckyTwistDraw', 'active,activedesc,sceneval', {active: 'rwjs_fk1111', activedesc: encodeURIComponent('幸运扭蛋机抽奖')}) 65 | // console.log('抽奖成功', res.data) 66 | // coin -= 10 67 | // await wait(5000) 68 | // } 69 | // await wait(2000) 70 | // } 71 | // 72 | // console.log('内部助力', shareCodeSelf) 73 | // for (let i = 0; i < cookiesArr.length; i++) { 74 | // if (shareCodeHW.length === 0) { 75 | // shareCodeHW = await getshareCodeHW('nnfls') 76 | // } 77 | // shareCode = Array.from(new Set([...shareCodeSelf, ...shareCodeHW])) 78 | // cookie = cookiesArr[i] 79 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 80 | // 81 | // for (let code of shareCode) { 82 | // console.log(`${UserName} 去助力 ${code}`) 83 | // res = await api('sign/helpSign', 'flag,sceneval,token', {flag: 0, token: code}) 84 | // await wait(3000) 85 | // res = await api('sign/helpSign', 'flag,sceneval,token', {flag: 1, token: code}) 86 | // console.log('助力结果', res.errMsg) 87 | // if (res.errMsg === 'help day limit') 88 | // break 89 | // await wait(2000) 90 | // } 91 | // } 92 | // })() 93 | // 94 | // async function api(fn: string, stk: string, params: any) { 95 | // let url = h5st(`https://m.jingxi.com/pgcenter/${fn}?sceneval=2&_stk=sceneval&_ste=1&_=${Date.now()}&sceneval=2`, stk, params, 10012) 96 | // let {data} = await axios.get(url, { 97 | // headers: { 98 | // 'Host': 'm.jingxi.com', 99 | // 'User-Agent': 'jdpingou;', 100 | // 'Referer': 'https://st.jingxi.com/pingou/taskcenter/index.html', 101 | // 'Cookie': cookie 102 | // } 103 | // }) 104 | // return data 105 | // } 106 | -------------------------------------------------------------------------------- /archive/jx_nnfls.ts: -------------------------------------------------------------------------------- 1 | // /** 2 | // * 京喜-首页-牛牛福利 3 | // * 助力 内部 -> HW.ts 4 | // * 1 0,9,19,23 * * * 5 | // */ 6 | // 7 | // import axios from "axios" 8 | // import {getCookie, wait, h5st, o2s, getshareCodeHW} from "./TS_USER_AGENTS" 9 | // 10 | // let cookie: string = '', UserName: string, index: number, res: any = '' 11 | // let shareCodeSelf: string[] = [], shareCode: string[] = [], shareCodeHW: string[] = [] 12 | // 13 | // !(async () => { 14 | // let cookiesArr: string[] = await getCookie() 15 | // for (let i = 0; i < cookiesArr.length; i++) { 16 | // cookie = cookiesArr[i] 17 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 18 | // index = i + 1 19 | // console.log(`\n开始【京东账号${index}】${UserName}\n`) 20 | // 21 | // res = await api('sign/UserSignNew', 'sceneval,source', {source: ''}) 22 | // console.log('签到') 23 | // console.log('助力码', res.data.token) 24 | // shareCodeSelf.push(res.data.token) 25 | // let coin: number = res.data.pgAmountTotal 26 | // console.log('金币', coin) 27 | // 28 | // /* 29 | // res = await api('task/QueryUserTask', 'sceneval,taskType', {taskType: 0}) 30 | // let tasks: number[] = [] 31 | // if (res.datas) { 32 | // for (let t of res.datas) { 33 | // if (t.state !== 2) 34 | // tasks.push(t.taskid) 35 | // } 36 | // } else { 37 | // res = await api('task/QueryPgTaskCfg', 'sceneval', {}) 38 | // if (tasks.length === 0) { 39 | // for (let t of res.data.tasks) { 40 | // tasks.push(t.taskid) 41 | // } 42 | // } 43 | // } 44 | // console.log('tasks:', tasks) 45 | // await wait(2000) 46 | // 47 | // */ 48 | // 49 | // res = await api('task/QueryPgTaskCfg', 'sceneval', {}) 50 | // 51 | // for (let t of res.data.tasks) { 52 | // console.log(t.taskName) 53 | // res = await api('task/drawUserTask', 'sceneval,taskid', {taskid: t.taskId}) 54 | // await wait(t.param7 * 1000 + 1000) 55 | // res = await api('task/UserTaskFinish', 'sceneval,taskid', {taskid: t.taskId}) 56 | // o2s(res) 57 | // await wait(2000) 58 | // } 59 | // 60 | // res = await api('active/LuckyTwistUserInfo', 'sceneval', {}) 61 | // let surplusTimes: number = res.data.surplusTimes 62 | // console.log('剩余抽奖次数', surplusTimes) 63 | // for (let j = 0; j < surplusTimes && coin >= 10; j++) { 64 | // res = await api('active/LuckyTwistDraw', 'active,activedesc,sceneval', {active: 'rwjs_fk1111', activedesc: encodeURIComponent('幸运扭蛋机抽奖')}) 65 | // console.log('抽奖成功', res.data) 66 | // coin -= 10 67 | // await wait(5000) 68 | // } 69 | // await wait(2000) 70 | // } 71 | // 72 | // console.log('内部助力', shareCodeSelf) 73 | // for (let i = 0; i < cookiesArr.length; i++) { 74 | // if (shareCodeHW.length === 0) { 75 | // shareCodeHW = await getshareCodeHW('nnfls') 76 | // } 77 | // shareCode = Array.from(new Set([...shareCodeSelf, ...shareCodeHW])) 78 | // cookie = cookiesArr[i] 79 | // UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 80 | // 81 | // for (let code of shareCode) { 82 | // console.log(`${UserName} 去助力 ${code}`) 83 | // res = await api('sign/helpSign', 'flag,sceneval,token', {flag: 0, token: code}) 84 | // await wait(3000) 85 | // res = await api('sign/helpSign', 'flag,sceneval,token', {flag: 1, token: code}) 86 | // console.log('助力结果', res.errMsg) 87 | // if (res.errMsg === 'help day limit') 88 | // break 89 | // await wait(2000) 90 | // } 91 | // } 92 | // })() 93 | // 94 | // async function api(fn: string, stk: string, params: any) { 95 | // let url = h5st(`https://m.jingxi.com/pgcenter/${fn}?sceneval=2&_stk=sceneval&_ste=1&_=${Date.now()}&sceneval=2`, stk, params, 10012) 96 | // let {data} = await axios.get(url, { 97 | // headers: { 98 | // 'Host': 'm.jingxi.com', 99 | // 'User-Agent': 'jdpingou;', 100 | // 'Referer': 'https://st.jingxi.com/pingou/taskcenter/index.html', 101 | // 'Cookie': cookie 102 | // } 103 | // }) 104 | // return data 105 | // } 106 | -------------------------------------------------------------------------------- /gulpconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "utils/h5st.js" 4 | ], 5 | "compilerOptions": { 6 | "noImplicitAny": true, 7 | "target": "es5", 8 | "allowJs": true, 9 | "downlevelIteration": true 10 | } 11 | } -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const ts = require('gulp-typescript'); 3 | const tsProject = ts.createProject('gulpconfig.json') 4 | 5 | gulp.task("default", () => { 6 | return tsProject.src().pipe(tsProject()).js.pipe(gulp.dest('./dist')); 7 | }) -------------------------------------------------------------------------------- /jdCookie.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const dotenv = require('dotenv') 3 | 4 | let CookieJDs = [] 5 | 6 | try { 7 | process.chdir(__dirname) 8 | fs.accessSync('.env', fs.constants.R_OK) 9 | dotenv.config() 10 | } catch (e) { 11 | } 12 | 13 | if (process.env.JD_COOKIE) { 14 | if (process.env.JD_COOKIE.indexOf('&') > -1) { 15 | CookieJDs = process.env.JD_COOKIE.split('&'); 16 | } else if (process.env.JD_COOKIE.indexOf('\n') > -1) { 17 | CookieJDs = process.env.JD_COOKIE.split('\n'); 18 | } else { 19 | CookieJDs = [process.env.JD_COOKIE]; 20 | } 21 | } 22 | if (JSON.stringify(process.env).indexOf('GITHUB') > -1) { 23 | process.exit(0); 24 | } 25 | CookieJDs = [...new Set(CookieJDs.filter(item => !!item))] 26 | if (!require.main.filename.includes('.ts')) { 27 | console.log(`\n====================共${CookieJDs.length}个京东账号Cookie=========\n`); 28 | console.log(`================== ${new Date().toLocaleString('zh-CN', {timeZone: 'Asia/Shanghai'})} =====================\n`) 29 | } 30 | for (let i = 0; i < CookieJDs.length; i++) { 31 | const index = (i + 1 === 1) ? '' : (i + 1); 32 | exports['CookieJD' + index] = CookieJDs[i].trim(); 33 | } 34 | -------------------------------------------------------------------------------- /jdDreamFactoryShareCodes.js: -------------------------------------------------------------------------------- 1 | /* 2 | 京喜工厂互助码 3 | 此文件为Node.js专用。其他用户请忽略 4 | 支持京东N个账号 5 | */ 6 | //云服务器腾讯云函数等NOde.js用户在此处填写东东萌宠的好友码。 7 | // 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 8 | // 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 9 | let shareCodes = [] 10 | 11 | if (process.env.DREAM_FACTORY_SHARE_CODES) { 12 | if (process.env.DREAM_FACTORY_SHARE_CODES.indexOf('&') > -1) { 13 | console.log(`您的互助码选择的是用&隔开\n`) 14 | shareCodes = process.env.DREAM_FACTORY_SHARE_CODES.split('&'); 15 | } else if (process.env.DREAM_FACTORY_SHARE_CODES.indexOf('\n') > -1) { 16 | console.log(`您的互助码选择的是用换行隔开\n`) 17 | shareCodes = process.env.DREAM_FACTORY_SHARE_CODES.split('\n'); 18 | } else { 19 | shareCodes = process.env.DREAM_FACTORY_SHARE_CODES.split(); 20 | } 21 | } else { 22 | console.log('DREAM_FACTORY_SHARE_CODES undefined') 23 | } 24 | for (let i = 0; i < shareCodes.length; i++) { 25 | const index = (i + 1 === 1) ? '' : (i + 1); 26 | exports['shareCodes' + index] = shareCodes[i]; 27 | } 28 | -------------------------------------------------------------------------------- /jdFactoryShareCodes.js: -------------------------------------------------------------------------------- 1 | /* 2 | 东东工厂互助码 3 | 此文件为Node.js专用。其他用户请忽略 4 | 支持京东N个账号 5 | */ 6 | //云服务器腾讯云函数等NOde.js用户在此处填写东东萌宠的好友码。 7 | // 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 8 | // 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 9 | let shareCodes = [] 10 | 11 | // 判断环境变量里面是否有东东工厂互助码 12 | if (process.env.DDFACTORY_SHARECODES) { 13 | if (process.env.DDFACTORY_SHARECODES.indexOf('&') > -1) { 14 | console.log(`您的互助码选择的是用&隔开\n`) 15 | shareCodes = process.env.DDFACTORY_SHARECODES.split('&'); 16 | } else if (process.env.DDFACTORY_SHARECODES.indexOf('\n') > -1) { 17 | console.log(`您的互助码选择的是用换行隔开\n`) 18 | shareCodes = process.env.DDFACTORY_SHARECODES.split('\n'); 19 | } else { 20 | shareCodes = process.env.DDFACTORY_SHARECODES.split(); 21 | } 22 | } else { 23 | console.log('DDFACTORY_SHARECODES undefined') 24 | } 25 | for (let i = 0; i < shareCodes.length; i++) { 26 | const index = (i + 1 === 1) ? '' : (i + 1); 27 | exports['shareCodes' + index] = shareCodes[i]; 28 | } -------------------------------------------------------------------------------- /jdFruitShareCodes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 东东农场互助码 3 | * 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 4 | * 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 5 | */ 6 | 7 | let FruitShareCodes = [] 8 | 9 | if (process.env.FRUITSHARECODES) { 10 | if (process.env.FRUITSHARECODES.indexOf('&') > -1) { 11 | console.log(`您的东东农场互助码选择的是用&隔开\n`) 12 | FruitShareCodes = process.env.FRUITSHARECODES.split('&'); 13 | } else if (process.env.FRUITSHARECODES.indexOf('\n') > -1) { 14 | console.log(`您的东东农场互助码选择的是用换行隔开\n`) 15 | FruitShareCodes = process.env.FRUITSHARECODES.split('\n'); 16 | } else { 17 | FruitShareCodes = process.env.FRUITSHARECODES.split(); 18 | } 19 | } else { 20 | console.log('FRUITSHARECODES undefined') 21 | } 22 | for (let i = 0; i < FruitShareCodes.length; i++) { 23 | const index = (i + 1 === 1) ? '' : (i + 1); 24 | exports['FruitShareCode' + index] = FruitShareCodes[i]; 25 | } -------------------------------------------------------------------------------- /jdPetShareCodes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 萌宠互助码 3 | * 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开 4 | * 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 5 | */ 6 | 7 | let PetShareCodes = [] 8 | 9 | if (process.env.PETSHARECODES) { 10 | if (process.env.PETSHARECODES.indexOf('&') > -1) { 11 | console.log(`您的东东萌宠互助码选择的是用&隔开\n`) 12 | PetShareCodes = process.env.PETSHARECODES.split('&'); 13 | } else if (process.env.PETSHARECODES.indexOf('\n') > -1) { 14 | console.log(`您的东东萌宠互助码选择的是用换行隔开\n`) 15 | PetShareCodes = process.env.PETSHARECODES.split('\n'); 16 | } else { 17 | PetShareCodes = process.env.PETSHARECODES.split(); 18 | } 19 | } else { 20 | console.log(`PETSHARECODES undefined`) 21 | } 22 | for (let i = 0; i < PetShareCodes.length; i++) { 23 | const index = (i + 1 === 1) ? '' : (i + 1); 24 | exports['PetShareCode' + index] = PetShareCodes[i]; 25 | } -------------------------------------------------------------------------------- /jdPlantBeanShareCodes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 京东种豆得豆互助码 3 | * 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 4 | * 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 5 | */ 6 | 7 | let PlantBeanShareCodes = [] 8 | 9 | if (process.env.PLANT_BEAN_SHARECODES) { 10 | if (process.env.PLANT_BEAN_SHARECODES.indexOf('&') > -1) { 11 | console.log(`您的种豆互助码选择的是用&隔开\n`) 12 | PlantBeanShareCodes = process.env.PLANT_BEAN_SHARECODES.split('&'); 13 | } else if (process.env.PLANT_BEAN_SHARECODES.indexOf('\n') > -1) { 14 | console.log(`您的种豆互助码选择的是用换行隔开\n`) 15 | PlantBeanShareCodes = process.env.PLANT_BEAN_SHARECODES.split('\n'); 16 | } else { 17 | PlantBeanShareCodes = process.env.PLANT_BEAN_SHARECODES.split(); 18 | } 19 | } else { 20 | console.log('PLANT_BEAN_SHARECODES undefined') 21 | } 22 | for (let i = 0; i < PlantBeanShareCodes.length; i++) { 23 | const index = (i + 1 === 1) ? '' : (i + 1); 24 | exports['PlantBeanShareCodes' + index] = PlantBeanShareCodes[i]; 25 | } 26 | -------------------------------------------------------------------------------- /jd_api_test.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 网络测试 3 | * 1、测试是否能访问助力池 4 | * 2、助力获取失败、没有统计到运行次数,很大可能因为访问api失败 5 | * 3、如果出现失败,自行更换设备dns 6 | */ 7 | 8 | import {format} from 'date-fns' 9 | import {getRandomNumberByRange, wait, get} from "./TS_USER_AGENTS" 10 | 11 | !(async () => { 12 | console.log(`\n==================脚本执行- 北京时间(UTC+8):${format(Date.now(), 'yyyy-MM-dd HH:mm:ss')}\n\n`) 13 | 14 | let cars: string[] = ['bean', 'farm', 'health', 'jxfactory', 'pet'] 15 | let db: string = cars[Math.floor(Math.random() * cars.length)] 16 | let num: number = getRandomNumberByRange(30, 50) 17 | console.log(`本次随机选择${db}获取${num}个随机助力码`) 18 | await car(db, num) 19 | 20 | for (let j = 0; j < cars.length; j++) { 21 | for (let i = 1; i < 3; i++) { 22 | let db: string = cars[j] 23 | await runTimes(db, i) 24 | await wait(getRandomNumberByRange(1000, 3000)) 25 | } 26 | } 27 | })() 28 | 29 | async function car(db: string, num: number) { 30 | try { 31 | let {data} = await get(`https://sharecodepool.cnmb.win/api/${db}/${num}`) 32 | console.log('获取助力池成功') 33 | console.log(data.length, data) 34 | } catch (e: any) { 35 | console.log(`获取助力池失败:`, e) 36 | } 37 | } 38 | 39 | async function runTimes(db, i) { 40 | try { 41 | await get(`https://sharecodepool.cnmb.win/api/runTimes0917?activityId=${db}&sharecode=123`) 42 | console.log(`${db}上报测试成功 ${i}`) 43 | } catch (e: any) { 44 | console.log(`${db}上报测试失败 ${i}`, e) 45 | } 46 | } -------------------------------------------------------------------------------- /jd_bean_aggregation.js: -------------------------------------------------------------------------------- 1 | /** 2 | * select name, bean from bean_change where date=today and amount > 0 group by name order by amount desc 3 | */ 4 | 5 | const {JDHelloWorld} = require("./TS_JDHelloWorld") 6 | const {getDate} = require("date-fns"); 7 | const ConsoleGrid = require("console-grid"); 8 | 9 | class Aggregate_Bean extends JDHelloWorld { 10 | constructor() { 11 | super(); 12 | } 13 | 14 | async init() { 15 | await this.run(new Aggregate_Bean()) 16 | } 17 | 18 | async main(user) { 19 | let p = 1, arr = [], aggregation = {}, flag = true, sum = 0, len = 0 20 | while (p && flag) { 21 | try { 22 | let res = await this.post('https://api.m.jd.com/client.action?functionId=getJingBeanBalanceDetail', 23 | `body=${encodeURIComponent(JSON.stringify({"pageSize": "20", "page": p.toString()}))}&appid=ld`, { 24 | 'Host': 'api.m.jd.com', 25 | 'Content-Type': 'application/x-www-form-urlencoded', 26 | 'User-Agent': "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 27 | 'Cookie': user.cookie, 28 | }) 29 | let today = getDate(new Date()) 30 | // console.log(p, res['detailList'].length) 31 | for (let t of res['detailList']) { 32 | let amount = parseInt(t.amount), date = getDate(new Date(t.date)) 33 | if (date !== today) { 34 | flag = false 35 | break 36 | } 37 | if (amount > 0) { 38 | sum += amount 39 | t['eventMassage'].length > len ? len = t['eventMassage'].length : null 40 | if (t['eventMassage'] in aggregation) { 41 | aggregation[t['eventMassage']] += amount 42 | } else { 43 | aggregation[t['eventMassage']] = amount 44 | } 45 | } 46 | } 47 | await this.wait(2000) 48 | if (p < 20) { 49 | p++ 50 | } else { 51 | break 52 | } 53 | } catch (e) { 54 | console.log('error', e) 55 | await this.wait(2000) 56 | break 57 | } 58 | } 59 | for (let k in aggregation) { 60 | arr.push({ 61 | 'name': k, 62 | 'amount': aggregation[k] 63 | }) 64 | } 65 | arr.sort((a, b) => { 66 | return b.amount - a.amount 67 | }) 68 | arr = [...arr, {name: '合计', amount: sum}] 69 | const consoleGrid = new ConsoleGrid(); 70 | const data = { 71 | columns: [{ 72 | id: "name", 73 | name: `Name`, 74 | type: "string", 75 | maxWidth: len * 2 + 3, 76 | }, { 77 | id: "amount", 78 | type: "number", 79 | name: "Amount", 80 | minWidth: 5, 81 | align: "right" 82 | }], 83 | rows: arr 84 | }; 85 | consoleGrid.render(data); 86 | } 87 | } 88 | 89 | new Aggregate_Bean().init().then() 90 | -------------------------------------------------------------------------------- /jd_bean_box.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 领京豆-任务 3 | * 助力:内部 -> HW 4 | * cron: 1 0,9,12,18 * * * 5 | */ 6 | 7 | import axios from 'axios' 8 | import USER_AGENT, {get, randomNumString, getCookie, wait} from './TS_USER_AGENTS' 9 | 10 | let cookie: string = '', res: any = '', UserName: string, index: number, uuid: string 11 | 12 | !(async () => { 13 | let cookiesArr: string[] = await getCookie() 14 | for (let i = 0; i < cookiesArr.length; i++) { 15 | cookie = cookiesArr[i] 16 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 17 | index = i + 1 18 | console.log(`\n开始【京东账号${index}】${UserName}\n`) 19 | 20 | let headers: object = { 21 | 'Host': 'api.m.jd.com', 22 | 'Origin': 'https://h5.m.jd.com', 23 | 'User-Agent': USER_AGENT, 24 | 'Referer': 'https://h5.m.jd.com/', 25 | 'Cookie': cookie 26 | } 27 | res = await get('https://api.m.jd.com/client.action?functionId=initForTurntableFarm&body=%7B%22version%22%3A4%2C%22channel%22%3A1%7D&appid=wh5', headers) 28 | let times: number = res.remainLotteryTimes 29 | console.log('剩余抽奖机会:', times) 30 | for (let j = 0; j < times; j++) { 31 | console.log('开始抽奖...') 32 | res = await get('https://api.m.jd.com/client.action?functionId=lotteryForTurntableFarm&body=%7B%22type%22%3A1%2C%22version%22%3A4%2C%22channel%22%3A1%7D&appid=wh5', headers) 33 | if (res.code === '0') { 34 | if (res.type === 'thanks') { 35 | console.log('抽奖成功,获得:狗屁') 36 | } else { 37 | console.log('抽奖成功,获得:', res.type) 38 | } 39 | } else { 40 | console.log('抽奖失败', res) 41 | } 42 | await wait(5000) 43 | } 44 | 45 | uuid = randomNumString(40) 46 | for (let j = 0; j < 2; j++) { 47 | console.log(`Round:${j + 1}`) 48 | res = await api('beanTaskList', {"viewChannel": "AppHome"}) 49 | try { 50 | for (let t of res.data.taskInfos) { 51 | if (t.status === 1) { 52 | console.log(t.taskName) 53 | res = await api('beanDoTask', { 54 | "actionType": t.taskType === 3 ? 0 : 1, 55 | "taskToken": t.subTaskVOS[0].taskToken 56 | }) 57 | res.data?.bizMsg ? console.log(res.data.bizMsg) : console.log(res) 58 | await wait(t.waitDuration * 1000 || 2000) 59 | 60 | if (t.taskType !== 3) { 61 | res = await api('beanDoTask', { 62 | "actionType": 0, 63 | "taskToken": t.subTaskVOS[0].taskToken 64 | }) 65 | if (res.data?.bizMsg) 66 | console.log(res.data.bizMsg) 67 | } 68 | await wait(1000) 69 | } 70 | } 71 | } catch (e) { 72 | console.log('Error!', e) 73 | } 74 | await wait(2000) 75 | } 76 | } 77 | })() 78 | 79 | async function api(fn: string, body: object) { 80 | let {data}: any = await axios.post(`https://api.m.jd.com/client.action?functionId=${fn}`, 81 | `body=${encodeURIComponent(JSON.stringify(body))}&appid=ld&client=apple&clientVersion=10.0.8&uuid=${uuid}&openudid=${uuid}`, { 82 | headers: { 83 | 'Host': 'api.m.jd.com', 84 | 'content-type': 'application/x-www-form-urlencoded', 85 | 'referer': '', 86 | 'user-agent': 'JD4iPhone/167863%20(iPhone;%20iOS;%20Scale/3.00)', 87 | 'Cookie': cookie 88 | } 89 | }) 90 | return data 91 | } 92 | -------------------------------------------------------------------------------- /jd_bean_sign.js: -------------------------------------------------------------------------------- 1 | // import {User, JDHelloWorld} from "./TS_JDHelloWorld" 2 | // 3 | // class Jd_bean_sign extends JDHelloWorld { 4 | // user: User 5 | // iosVer: string 6 | // 7 | // constructor() { 8 | // super(); 9 | // } 10 | // 11 | // async init() { 12 | // await this.run(this) 13 | // } 14 | // 15 | // async main(user: User) { 16 | // try { 17 | // this.user = user 18 | // this.user.UserAgent = `jdapp;iPhone;11.3.0;` 19 | // let res: any = await this.get(`https://api.m.jd.com/client.action`, { 20 | // 'Host': 'api.m.jd.com', 21 | // 'referer': 'https://h5.m.jd.com/', 22 | // 'user-agent': this.user.UserAgent, 23 | // 'accept-language': 'zh-CN,zh-Hans;q=0.9', 24 | // 'cookie': this.user.cookie 25 | // }, { 26 | // 'functionId': 'signBeanAct', 27 | // 'body': '{"fp":"-1","shshshfp":"-1","shshshfpa":"-1","referUrl":"-1","userAgent":"-1","jda":"-1","rnVersion":"3.9"}', 28 | // 'appid': 'ld', 29 | // 'client': 'apple', 30 | // 'clientVersion': '11.3.0', 31 | // 'networkType': 'wifi', 32 | // 'osVersion': this.iosVer, 33 | // 'uuid': '', 34 | // 'openudid': '', 35 | // 'jsonp': `jsonp_${Date.now()}_${this.getRandomNumberByRange(18888, 88888)}` 36 | // }) 37 | // res = JSON.parse(res.match(/\((.*)\)/)[1]) 38 | // res.code === '0' 39 | // ? console.log(res.data.dailyAward.title, parseInt(res.data.dailyAward.beanAward.beanCount)) 40 | // : console.log(res.errorMessage) 41 | // } catch (e) { 42 | // console.log(e.message) 43 | // await this.wait(5000) 44 | // } 45 | // } 46 | // } 47 | // 48 | // new Jd_bean_sign().init().then() 49 | -------------------------------------------------------------------------------- /jd_bean_sign.ts: -------------------------------------------------------------------------------- 1 | // import {User, JDHelloWorld} from "./TS_JDHelloWorld" 2 | // 3 | // class Jd_bean_sign extends JDHelloWorld { 4 | // user: User 5 | // iosVer: string 6 | // 7 | // constructor() { 8 | // super(); 9 | // } 10 | // 11 | // async init() { 12 | // await this.run(this) 13 | // } 14 | // 15 | // async main(user: User) { 16 | // try { 17 | // this.user = user 18 | // this.user.UserAgent = `jdapp;iPhone;11.3.0;` 19 | // let res: any = await this.get(`https://api.m.jd.com/client.action`, { 20 | // 'Host': 'api.m.jd.com', 21 | // 'referer': 'https://h5.m.jd.com/', 22 | // 'user-agent': this.user.UserAgent, 23 | // 'accept-language': 'zh-CN,zh-Hans;q=0.9', 24 | // 'cookie': this.user.cookie 25 | // }, { 26 | // 'functionId': 'signBeanAct', 27 | // 'body': '{"fp":"-1","shshshfp":"-1","shshshfpa":"-1","referUrl":"-1","userAgent":"-1","jda":"-1","rnVersion":"3.9"}', 28 | // 'appid': 'ld', 29 | // 'client': 'apple', 30 | // 'clientVersion': '11.3.0', 31 | // 'networkType': 'wifi', 32 | // 'osVersion': this.iosVer, 33 | // 'uuid': '', 34 | // 'openudid': '', 35 | // 'jsonp': `jsonp_${Date.now()}_${this.getRandomNumberByRange(18888, 88888)}` 36 | // }) 37 | // res = JSON.parse(res.match(/\((.*)\)/)[1]) 38 | // res.code === '0' 39 | // ? console.log(res.data.dailyAward.title, parseInt(res.data.dailyAward.beanAward.beanCount)) 40 | // : console.log(res.errorMessage) 41 | // } catch (e) { 42 | // console.log(e.message) 43 | // await this.wait(5000) 44 | // } 45 | // } 46 | // } 47 | // 48 | // new Jd_bean_sign().init().then() -------------------------------------------------------------------------------- /jd_cash_help.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 小程序-领现金-1.5 3 | * cron: 15 14,15,19 * * * 4 | */ 5 | 6 | import {User, JDHelloWorld} from "./TS_JDHelloWorld" 7 | 8 | interface CODE { 9 | inviteCode: string, 10 | shareDate: string 11 | } 12 | 13 | class Jd_cash_help extends JDHelloWorld { 14 | user: User 15 | shareCodeSelf: CODE[] = [] 16 | 17 | constructor() { 18 | super(); 19 | } 20 | 21 | async init() { 22 | await this.run(this) 23 | } 24 | 25 | async api(fn: string, body: object) { 26 | await this.wait(1000) 27 | return await this.post('https://api.m.jd.com/client.action', new URLSearchParams({ 28 | 'functionId': fn, 29 | 'body': JSON.stringify(body), 30 | 'appid': 'CashRewardMiniH5Env', 31 | 'loginType': '2', 32 | 'loginWQBiz': 'interact' 33 | }), { 34 | 'Host': 'api.m.jd.com', 35 | "Referer": "https://servicewechat.com/wx91d27dbf599dff74/621/page-frame.html", 36 | 'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS ${this.getIosVer()} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E217 MicroMessenger/6.8.0(0x16080000) NetType/WIFI Language/en Branch/Br_trunk MiniProgramEnv/Mac`, 37 | 'Cookie': this.user.cookie 38 | }) 39 | } 40 | 41 | async main(user: User) { 42 | this.user = user 43 | let res: any 44 | try { 45 | res = await this.api('cash_mob_home', {"isLTRedPacket": "1"}) 46 | for (let t of res.data.result.taskInfos) { 47 | if (t.doTimes !== t.times) { 48 | console.log(t.name) 49 | res = await this.api('cash_doTask', {"type": t.type, "taskInfo": t.desc}) 50 | console.log(res.data.result.totalMoney) 51 | res = await this.api('cash_mob_home', {"isLTRedPacket": "1"}) 52 | } 53 | } 54 | this.o2s(res) 55 | 56 | if (new Date().getHours() >= 11 && new Date().getHours() < 22) { 57 | res = await this.api('cash_join_limited_redpacket', {"id": 5, "level": 3}) 58 | res.data.bizCode === 0 ? console.log('开启成功') : console.log(res.data.bizMsg) 59 | 60 | res = await this.api('cash_mob_home', {"isLTRedPacket": "1"}) 61 | if (res.data.result.inviteCode && res.data.result.shareDate) { 62 | this.shareCodeSelf.push({ 63 | inviteCode: res.data.result.inviteCode, 64 | shareDate: res.data.result.shareDate 65 | }) 66 | console.log('助力码', res.data.result.inviteCode, res.data.result.shareDate) 67 | } 68 | } else { 69 | console.log('不在时间范围') 70 | } 71 | } catch (e) { 72 | console.log('error', e.message) 73 | } 74 | } 75 | 76 | async help(users: User[]) { 77 | let shareCodeHW: any = [], shareCode: CODE[] = [], full: string[] = [] 78 | this.o2s(this.shareCodeSelf, '内部助力') 79 | let res: any 80 | 81 | for (let user of users) { 82 | try { 83 | this.user = user 84 | if (shareCodeHW.length === 0) { 85 | shareCodeHW = await this.getshareCodeHW('cash') 86 | } 87 | if (user.index === 0) { 88 | shareCode = [...shareCodeHW, ...this.shareCodeSelf] 89 | } else { 90 | shareCode = [...this.shareCodeSelf, ...shareCodeHW] 91 | } 92 | 93 | for (let code of shareCode) { 94 | console.log(`账号${user.index + 1} ${user.UserName} 去助力 ${code.inviteCode}`) 95 | if (full.includes(code.inviteCode)) { 96 | console.log('full contains') 97 | continue 98 | } 99 | res = await this.api('redpack_limited_assist', {"inviteCode": code.inviteCode, "shareDate": code.shareDate}) 100 | console.log(res.data?.result?.limitTimeAssist?.tips) 101 | if (res.data?.result?.limitTimeAssist?.tips === '您来晚啦,您的好友已经领到全部奖励了') 102 | full.push(code.inviteCode) 103 | if (res.data?.result?.limitTimeAssist?.assistCode === '207') { 104 | break 105 | } 106 | } 107 | } catch (e) { 108 | console.log('error', e.message) 109 | } 110 | } 111 | 112 | for (let user of users) { 113 | try { 114 | this.user = user 115 | console.log(`账号${user.index + 1} ${user.UserName}`) 116 | for (let i = 1; i < 5; i++) { 117 | res = await this.api('cash_open_limited_redpacket', {"node": i}) 118 | // this.o2s(res) 119 | console.log(res.data.bizMsg) 120 | if (res.data.bizMsg === '无资格') 121 | break 122 | } 123 | } catch (e) { 124 | console.log('error', e.message) 125 | } 126 | } 127 | } 128 | } 129 | 130 | new Jd_cash_help().init().then() -------------------------------------------------------------------------------- /jd_cash_signin.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 京东-领现金 3 | * cron: 30 7,10 * * * 4 | */ 5 | 6 | import {User, JDHelloWorld} from "./TS_JDHelloWorld"; 7 | 8 | class Jd_cash_signin extends JDHelloWorld { 9 | user: User 10 | 11 | constructor() { 12 | super(); 13 | } 14 | 15 | async init() { 16 | await this.run(this) 17 | } 18 | 19 | async api(fn: string, body: object) { 20 | let sign = await this.getSign(fn, body) 21 | return await this.post(`https://api.m.jd.com/client.action?functionId=${fn}`, sign, { 22 | 'Host': 'api.m.jd.com', 23 | 'Cookie': this.user.cookie, 24 | 'user-agent': this.user.UserAgent, 25 | }) 26 | } 27 | 28 | async main(user: User) { 29 | this.user = user 30 | let res: any = await this.api('cash_homePage', {}) 31 | if (res.data.result.signedStatus !== 1) { 32 | console.log('今日未签到') 33 | await this.api('cash_sign', {"remind": 0, "inviteCode": "", "type": 0, "breakReward": 0}) 34 | await this.wait(1000) 35 | console.log('签到成功') 36 | } else { 37 | console.log('今日已签到') 38 | } 39 | 40 | res = await this.api('cash_homePage', {}) 41 | let type: number[] = [2, 4, 31, 16, 3, 5, 17, 21], data: any 42 | let otherTaskNum = res.data.result.taskInfos.filter(item => !type.includes(item.type)).length 43 | let taskNum = res.data.result.taskInfos.filter(item => type.includes(item.type)).length 44 | console.log(taskNum, otherTaskNum) 45 | 46 | for (let i = 0; i < 10; i++) { 47 | res = await this.api('cash_homePage', {}) 48 | if (res.data.result.taskInfos.filter(item => type.includes(item.type) && item.doTimes === item.times).length === taskNum) { 49 | console.log('任务全部完成') 50 | break 51 | } 52 | 53 | for (let t of res?.data?.result?.taskInfos || []) { 54 | if (t.doTimes < t.times && t.type !== 7) { 55 | console.log(t.name) 56 | data = await this.api('cash_doTask', {"type": t.type, "taskInfo": t.desc}) 57 | await this.wait(t.duration * 1000 || 1000) 58 | if (data.data.bizCode === 0) { 59 | console.log('任务完成', data.data.result.totalMoney ?? '') 60 | break 61 | } else { 62 | console.log('任务失败', JSON.stringify(data)) 63 | break 64 | } 65 | } 66 | } 67 | await this.wait(2000) 68 | } 69 | } 70 | } 71 | 72 | new Jd_cash_signin().init().then() -------------------------------------------------------------------------------- /jd_cfd.ts: -------------------------------------------------------------------------------- 1 | import {JDHelloWorld, User} from "./TS_JDHelloWorld"; 2 | import {H5ST} from "./utils/h5st_3.1"; 3 | import {getJxToken, wait} from "./TS_USER_AGENTS"; 4 | 5 | class Cfd extends JDHelloWorld { 6 | user: User 7 | shareCodeSelf: string[] = [] 8 | h5stTool: H5ST 9 | token: { strPgtimestamp: string, strPhoneID: string, strPgUUNum: string } 10 | _ombfd: string 11 | 12 | constructor() { 13 | super(); 14 | } 15 | 16 | async init() { 17 | await this.run(this) 18 | } 19 | 20 | async api(fn: string, obj: any = {}) { 21 | let timestamp: number = Date.now() 22 | let body = { 23 | 'strZone': 'jxbfd', 24 | 'bizCode': 'jxbfd', 25 | 'source': 'jxbfd', 26 | 'strDeviceId': this.token.strPhoneID, 27 | 'dwEnv': '7', 28 | '_cfd_t': timestamp.toString(), 29 | 'ptag': '', 30 | '_ste': '1', 31 | '_': timestamp.toString(), 32 | 'sceneval': '2', 33 | 'g_login_type': '1', 34 | 'callback': `jsonpCBK${this.getRandomWord()}`, 35 | 'g_ty': 'ls', 36 | 'appCode': 'msd1188198', 37 | } 38 | Object.assign(body, obj) 39 | this._ombfd ? body['_imbfd'] = this._ombfd : '' 40 | if (body['_stk'].includes('_imbfd') && (!this._ombfd || !body['_imbfd'])) { 41 | console.log('h5st body 缺少 _imbfd') 42 | process.exit(0) 43 | } 44 | let h5stBody = {} 45 | for (let key of body['_stk'].split(',').sort()) { 46 | h5stBody[key] = body[key] 47 | } 48 | body['h5st'] = await this.h5stTool.__genH5st(h5stBody) 49 | let params: string = '' 50 | for (let key of Object.keys(body)) { 51 | params += `${key}=${body[key]}&` 52 | } 53 | let data: any = await this.get(`https://m.jingxi.com/jxbfd/${fn}?${params}`, { 54 | 'Host': 'm.jingxi.com', 55 | 'User-Agent': this.user.UserAgent, 56 | 'Referer': 'https://st.jingxi.com/', 57 | 'cookie': this.user.cookie 58 | }) 59 | data = JSON.parse(data.match(/jsonpCBK.?.?\(([\w\W]*)\)/)[1]) 60 | this._ombfd = data._ombfd || '' 61 | return data 62 | } 63 | 64 | async main(user: User) { 65 | this.user = user 66 | this.user.cookie += '; cid=4;' 67 | this.user.UserAgent = `jdpingou;Mozilla/5.0 (iPhone; CPU iPhone OS ${this.getIosVer()} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;` 68 | this.token = getJxToken(this.user.cookie) 69 | let res: any, data: any 70 | 71 | this.h5stTool = new H5ST('92a36', this.user.UserAgent, process.env.FP_92A36 ?? "", 'https://st.jingxi.com/fortune_island/index2.html', 'https://st.jingxi.com', this.user.UserName) 72 | await this.h5stTool.__genAlgo() 73 | 74 | res = await this.api('user/QueryUserInfo', { 75 | _stk: '_cfd_t,bizCode,ddwTaskId,dwEnv,dwIsReJoin,ptag,source,strDeviceId,strMarkList,strPgUUNum,strPgtimestamp,strPhoneID,strShareId,strVersion,strZone', 76 | 'ddwTaskId': '', 77 | 'strShareId': '', 78 | 'strMarkList': 'guider_step,collect_coin_auth,guider_medal,guider_over_flag,build_food_full,build_sea_full,build_shop_full,build_fun_full,medal_guider_show,guide_guider_show,guide_receive_vistor,daily_task,guider_daily_task,cfd_has_show_selef_point,choose_goods_has_show,daily_task_win,new_user_task_win,guider_new_user_task,guider_daily_task_icon,guider_nn_task_icon,tool_layer,new_ask_friend_m', 79 | 'strPgtimestamp': this.token.strPgtimestamp, 80 | 'strPhoneID': this.token.strPhoneID, 81 | 'strPgUUNum': this.token.strPgUUNum, 82 | 'strVersion': '1.0.1', 83 | 'dwIsReJoin': '0', 84 | }) 85 | await this.wait(1000) 86 | 87 | for (let xb of res.XbStatus.XBDetail) { 88 | if (xb.dwRemainCnt && Date.now() > xb.ddwColdEndTm * 1000) { 89 | data = await this.api('user/TreasureHunt', { 90 | _stk: '_cfd_t,_imbfd,bizCode,dwEnv,ptag,source,strDeviceId,strIndex,strZone', 91 | strIndex: xb.strIndex 92 | }) 93 | console.log('寻宝', xb.strIndex, data.AwardInfo.ddwValue) 94 | await this.wait(5000) 95 | } 96 | } 97 | 98 | // 背包 99 | res = await this.api('story/querystorageroom', { 100 | _stk: '_cfd_t,_imbfd,bizCode,dwEnv,ptag,source,strDeviceId,strZone', 101 | }) 102 | for (let t of res.Data.Office) { 103 | data = await this.api('story/sellgoods', { 104 | _stk: '_cfd_t,_imbfd,bizCode,dwEnv,dwSceneId,ptag,source,strDeviceId,strTypeCnt,strZone', 105 | dwSceneId: '1', 106 | strTypeCnt: `${t.dwType}:${t.dwCount}`, 107 | }) 108 | console.log('卖贝壳', data.Data.ddwCoin) 109 | await this.wait(2000) 110 | } 111 | 112 | // 贝壳 113 | res = await this.api('story/queryshell', { 114 | _stk: '_cfd_t,_imbfd,bizCode,dwEnv,ptag,source,strDeviceId,strZone', 115 | }) 116 | await this.wait(1000) 117 | for (let pick of res.Data.NormShell) { 118 | for (; pick.dwNum; pick.dwNum--) { 119 | data = await this.api('story/pickshell', { 120 | _stk: '_cfd_t,_imbfd,bizCode,dwEnv,dwType,ptag,source,strDeviceId,strZone', 121 | dwType: pick.dwType 122 | }) 123 | console.log(data.Data.strFirstDesc) 124 | await this.wait(2000) 125 | } 126 | } 127 | 128 | for (let strBuildIndex of ['fun', 'shop', 'sea', 'food']) { 129 | data = await this.api('user/CollectCoin', { 130 | _stk: '_cfd_t,_imbfd,bizCode,dwEnv,dwType,ptag,source,strBuildIndex,strDeviceId,strZone', 131 | dwType: '1', 132 | strBuildIndex: strBuildIndex 133 | }) 134 | console.log(`${strBuildIndex}收金币:`, data.ddwCoin) 135 | await wait(2000) 136 | } 137 | } 138 | } 139 | 140 | new Cfd().init().then() -------------------------------------------------------------------------------- /jd_checkCookie.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __extends = (this && this.__extends) || (function () { 3 | var extendStatics = function (d, b) { 4 | extendStatics = Object.setPrototypeOf || 5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 6 | function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 7 | return extendStatics(d, b); 8 | }; 9 | return function (d, b) { 10 | if (typeof b !== "function" && b !== null) 11 | throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 12 | extendStatics(d, b); 13 | function __() { this.constructor = d; } 14 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 15 | }; 16 | })(); 17 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 18 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 19 | return new (P || (P = Promise))(function (resolve, reject) { 20 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 21 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 22 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 23 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 24 | }); 25 | }; 26 | var __generator = (this && this.__generator) || function (thisArg, body) { 27 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 28 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 29 | function verb(n) { return function (v) { return step([n, v]); }; } 30 | function step(op) { 31 | if (f) throw new TypeError("Generator is already executing."); 32 | while (g && (g = 0, op[0] && (_ = 0)), _) try { 33 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 34 | if (y = 0, t) op = [op[0] & 2, t.value]; 35 | switch (op[0]) { 36 | case 0: case 1: t = op; break; 37 | case 4: _.label++; return { value: op[1], done: false }; 38 | case 5: _.label++; y = op[1]; op = [0]; continue; 39 | case 7: op = _.ops.pop(); _.trys.pop(); continue; 40 | default: 41 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 42 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 43 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 44 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 45 | if (t[2]) _.ops.pop(); 46 | _.trys.pop(); continue; 47 | } 48 | op = body.call(thisArg, _); 49 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 50 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 51 | } 52 | }; 53 | exports.__esModule = true; 54 | var TS_JDHelloWorld_1 = require("./TS_JDHelloWorld"); 55 | var Check_cookie = /** @class */ (function (_super) { 56 | __extends(Check_cookie, _super); 57 | function Check_cookie() { 58 | return _super.call(this, "Cookie检测") || this; 59 | } 60 | Check_cookie.prototype.init = function () { 61 | return __awaiter(this, void 0, void 0, function () { 62 | return __generator(this, function (_a) { 63 | switch (_a.label) { 64 | case 0: return [4 /*yield*/, this.run(this)]; 65 | case 1: 66 | _a.sent(); 67 | return [2 /*return*/]; 68 | } 69 | }); 70 | }); 71 | }; 72 | Check_cookie.prototype.main = function (user) { 73 | return __awaiter(this, void 0, void 0, function () { 74 | var res; 75 | return __generator(this, function (_a) { 76 | switch (_a.label) { 77 | case 0: return [4 /*yield*/, this.get("https://plogin.m.jd.com/cgi-bin/ml/islogin", { 78 | 'user-agent': user.UserAgent, 79 | 'cookie': user.cookie 80 | })]; 81 | case 1: 82 | res = _a.sent(); 83 | if (res.islogin === '1') { 84 | console.log('✅'); 85 | } 86 | else { 87 | console.log('❌'); 88 | return [2 /*return*/, { msg: "Cookie\u8FC7\u671F \u8D26\u53F7".concat(user.index + 1, " ").concat(user.UserName) }]; 89 | } 90 | return [2 /*return*/]; 91 | } 92 | }); 93 | }); 94 | }; 95 | return Check_cookie; 96 | }(TS_JDHelloWorld_1.JDHelloWorld)); 97 | new Check_cookie().init().then(); 98 | -------------------------------------------------------------------------------- /jd_checkCookie.ts: -------------------------------------------------------------------------------- 1 | import {User, JDHelloWorld} from './TS_JDHelloWorld' 2 | 3 | class Check_cookie extends JDHelloWorld { 4 | constructor() { 5 | super("Cookie检测"); 6 | } 7 | 8 | async init() { 9 | await this.run(this) 10 | } 11 | 12 | async main(user: User) { 13 | let res: any = await this.get(`https://plogin.m.jd.com/cgi-bin/ml/islogin`, { 14 | 'user-agent': user.UserAgent, 15 | 'cookie': user.cookie 16 | }) 17 | if (res.islogin === '1') { 18 | console.log('✅') 19 | } else { 20 | console.log('❌') 21 | return {msg: `Cookie过期 账号${user.index + 1} ${user.UserName}`} 22 | } 23 | } 24 | } 25 | 26 | new Check_cookie().init().then() 27 | -------------------------------------------------------------------------------- /jd_cww_help.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 宠汪汪-助力 3 | * cron: 15 8,12 * * * 4 | */ 5 | 6 | import {User, JDHelloWorld} from "./TS_JDHelloWorld" 7 | import {H5ST} from "./utils/h5st_pro"; 8 | 9 | class Jd_cww_help extends JDHelloWorld { 10 | user: User 11 | h5stTool: H5ST 12 | shareCodeSelf: string[] = [] 13 | fp: any = undefined 14 | 15 | constructor() { 16 | super(); 17 | } 18 | 19 | async init() { 20 | await this.run(this) 21 | } 22 | 23 | async api(fn: string, body: object) { 24 | let timestamp: string = Date.now().toString(); 25 | let h5st: string = await this.h5stTool.__genH5st({ 26 | 'appid': 'choujiangyingyong', 27 | 'body': JSON.stringify(body), 28 | 'client': 'macOS 12.6.0', 29 | 'clientVersion': '3.5.5', 30 | 'functionId': fn, 31 | 't': timestamp.toString() 32 | }) 33 | let url: string = `https://api.m.jd.com/api?client=macOS%2012.6.0&clientVersion=3.5.5&appid=choujiangyingyong&t=${timestamp}&functionId=${fn}&body=${encodeURIComponent(JSON.stringify(body))}&h5st=${h5st}` 34 | return await this.get(url, { 35 | 'Host': 'api.m.jd.com', 36 | 'User-Agent': this.user.UserAgent, 37 | 'Referer': 'https://servicewechat.com/wxccb5c536b0ecd1bf/854/page-frame.html', 38 | 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', 39 | 'Content-Type': 'application/json', 40 | 'Cookie': this.user.cookie 41 | }) 42 | } 43 | 44 | async main(user: User) { 45 | console.log(user.index) 46 | } 47 | 48 | async help(users: User[]) { 49 | let full: string[] = [] 50 | this.fp = await this.getFp() 51 | for (let user of users) { 52 | this.user = user 53 | this.user.UserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS ${this.getIosVer()} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E217 MicroMessenger/6.8.0(0x16080000) NetType/WIFI Language/en Branch/Br_trunk MiniProgramEnv/Mac` 54 | let res: any 55 | 56 | this.h5stTool = new H5ST('538b4', this.user.UserAgent, this.fp, "https://h5.m.jd.com/babelDiy/Zeus/2wuqXrZrhygTQzYA7VufBEpj4amH/index.html", "https://h5.m.jd.com/") 57 | await this.h5stTool.__genAlgo() 58 | 59 | for (let code of users) { 60 | if (user.UserName === code.UserName || full.includes(code.UserName)) continue 61 | console.log(`账号${user.index + 1} ${user.UserName} 去助力 ${code.UserName}`) 62 | res = await this.api('helpFriend', {"friendPin": code.UserName, "reqSource": "weapp"}) 63 | await this.wait(2000) 64 | console.log(res.errorCode) 65 | 66 | if (res.errorCode === 'invite_full') full.push(code.UserName) 67 | if (res.errorCode === 'help_full') break 68 | } 69 | } 70 | } 71 | } 72 | 73 | new Jd_cww_help().init().then() -------------------------------------------------------------------------------- /jd_deleteCart.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * export DELETE_CART_WHITELIST="name1&name2" 3 | */ 4 | 5 | import {User, JDHelloWorld} from "./TS_JDHelloWorld"; 6 | 7 | class Jd_deleteCart extends JDHelloWorld { 8 | constructor() { 9 | super(); 10 | } 11 | 12 | async init() { 13 | await this.run(this) 14 | } 15 | 16 | async main(user: User) { 17 | let whiteList: string[] = process.env.DELETE_CART_WHITELIST 18 | ? process.env.DELETE_CART_WHITELIST.split('&') 19 | : [] 20 | let res: any = await this.get('https://p.m.jd.com/cart/cart.action?fromnav=1', { 21 | 'Host': 'p.m.jd.com', 22 | 'User-Agent': user.UserAgent, 23 | 'Referer': 'https://m.jd.com/', 24 | cookie: user.cookie 25 | }) 26 | res = JSON.parse(res.match(/window\.cartData = ([^;]*)/)[1]) 27 | 28 | let venderCart = res.cart.venderCart, areaId: string = res.addrInfo.areaId 29 | for (let vender of venderCart) { 30 | let postBody: string = '' 31 | for (let sortedItem of vender.sortedItems) { 32 | let pid: string = sortedItem.polyItem?.promotion?.pid 33 | for (let p of sortedItem.polyItem.products) { 34 | let commlist: string = p.mainSku.id, name: string = p.mainSku.name, skuUuid: string = p.skuUuid 35 | let pass: boolean = whiteList.some(item => name.includes(item)) 36 | if (!pass) { 37 | pid 38 | ? postBody += `${commlist},,1,${commlist},11,${pid},0,skuUuid:${skuUuid}@@useUuid:0$` 39 | : postBody += `${commlist},,1,${commlist},1,,0,skuUuid:${skuUuid}@@useUuid:0$`; 40 | } 41 | console.log(pass, name) 42 | } 43 | } 44 | if (postBody) { 45 | res = await this.post('https://api.m.jd.com/client.action/deal/mshopcart/rmvcmdy/m?sceneval=2&g_login_type=1&g_ty=ajax', 46 | `body={"tenantCode":"jgm","bizModelCode":"1","bizModeClientType":"M","externalLoginType":1,"platform":3,"pingouchannel":0,"commlist":${JSON.stringify(postBody)},"type":0,"checked":0,"locationid":"${areaId}","templete":1,"reg":1,"scene":0,"version":"20190418","traceid":"","sceneval":2}&loginType=2&loginWQBiz=golden-trade&appid=m_core&platform=3&functionId=deal_mshopcart_rmvcmdy_m&uuid=${this.getRandomNumString(17)}&osVersion=&screen=jdm&d_brand=&d_model=&lang=zh_CN`, { 47 | 'Host': 'api.m.jd.com', 48 | 'Cookie': user.cookie, 49 | 'accept': 'application/json', 50 | 'content-type': 'application/x-www-form-urlencoded', 51 | 'origin': 'https://p.m.jd.com', 52 | 'user-agent': user.UserAgent, 53 | 'referer': 'https://p.m.jd.com/' 54 | }) 55 | res.errId === '0' ? console.log('删除成功✅') : console.log(res.errMsg) 56 | await this.wait(2000) 57 | } 58 | } 59 | } 60 | } 61 | 62 | new Jd_deleteCart().init().then() -------------------------------------------------------------------------------- /jd_dwapp.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 京东-生活积分 3 | */ 4 | 5 | import {User, JDHelloWorld} from "./TS_JDHelloWorld" 6 | 7 | class Jd_dwapp extends JDHelloWorld { 8 | cookie: string 9 | 10 | constructor() { 11 | super(); 12 | } 13 | 14 | async init() { 15 | await this.run(this) 16 | } 17 | 18 | async api(fn: string, body: object = {}) { 19 | if (['dwList', 'dwRecord', 'dwReceive'].includes(fn)) 20 | fn = `task/${fn}` 21 | body = this.getEncStr(fn, body) 22 | await this.wait(2000) 23 | return await this.post(`https://dwapp.jd.com/user/${fn}`, JSON.stringify(body), { 24 | 'Host': 'dwapp.jd.com', 25 | 'Cookie': this.cookie, 26 | 'content-type': 'application/json', 27 | 'origin': 'https://prodev.m.jd.com', 28 | 'user-agent': 'jdapp;', 29 | 'referer': 'https://prodev.m.jd.com/' 30 | }) 31 | } 32 | 33 | async main(user: User) { 34 | this.cookie = user.cookie 35 | let res: any 36 | res = await this.api('dwSignInfo') 37 | 38 | if (res.data.signInfo.signStatus === 0) { 39 | res = await this.api('dwSign') 40 | console.log('签到成功', res.data.signInfo.signNum) 41 | } else { 42 | console.log('已签到') 43 | } 44 | 45 | res = await this.api('dwList') 46 | for (let t of res.data) { 47 | if (t.viewStatus === 0) { 48 | res = await this.api('dwRecord', {id: t.id, "taskType": t.taskType, "agentNum": "m", "followChannelStatus": "",}) 49 | console.log(res.msg) 50 | res = await this.api('dwReceive', {id: t.id}) 51 | console.log(res?.data?.giveScoreNum) 52 | } 53 | } 54 | 55 | res = await this.api('dwList') 56 | for (let t of res.data) { 57 | if (t.viewStatus === 2) { 58 | res = await this.api('dwReceive', {id: t.id}) 59 | console.log(res?.data?.giveScoreNum) 60 | } 61 | } 62 | } 63 | } 64 | 65 | new Jd_dwapp().init().then() -------------------------------------------------------------------------------- /jd_hby.ts: -------------------------------------------------------------------------------- 1 | import {User, JDHelloWorld} from "./TS_JDHelloWorld"; 2 | 3 | class Jd_hby extends JDHelloWorld { 4 | user: User 5 | 6 | constructor() { 7 | super(); 8 | } 9 | 10 | async init() { 11 | await this.run(this) 12 | } 13 | 14 | async api(fn: string, body: object) { 15 | return await this.post(`https://api.m.jd.com/client.action`, 16 | `functionId=${fn}&appid=publicUseApi&body=${JSON.stringify(body)}&client=wh5&clientVersion=1.0.0&t=${Date.now()}`, { 17 | 'Host': 'api.m.jd.com', 18 | 'Origin': 'https://prodev.m.jd.com', 19 | 'User-Agent': this.user.UserAgent, 20 | 'Referer': 'https://prodev.m.jd.com/mall/active/Z3vEHkfuXaJaooFypUoajSruJ8b/index.html', 21 | 'Cookie': this.user.cookie 22 | }) 23 | } 24 | 25 | async main(user: User) { 26 | this.user = user 27 | let res: any 28 | res = await this.api('hby_lottery', { 29 | "babelProjectId": "01393628", 30 | "babelPageId": "4138116", 31 | "latitude": "0.000000", 32 | "longitude": "0.000000", 33 | "activityNo": "pT6Lw6fcTxnsJDGXiJnvD", 34 | "click": "1" 35 | }) 36 | await this.wait(1000) 37 | console.log(res.data.result.hbInfo.discount * 1) 38 | res = await this.api('hby_share', {"sceneId": res.data.result.sceneId, "activityNo": "pT6Lw6fcTxnsJDGXiJnvD"}) 39 | console.log(res.data.bizMsg) 40 | await this.wait(1000) 41 | res = await this.api('hby_lottery', { 42 | "babelProjectId": "01393628", 43 | "babelPageId": "4138116", 44 | "latitude": "0.000000", 45 | "longitude": "0.000000", 46 | "activityNo": "pT6Lw6fcTxnsJDGXiJnvD", 47 | "click": "1" 48 | }) 49 | console.log(res.data.result.hbInfo.discount * 1) 50 | 51 | } 52 | } 53 | 54 | new Jd_hby().init().then() -------------------------------------------------------------------------------- /jd_health.ts: -------------------------------------------------------------------------------- 1 | import {User, JDHelloWorld} from "./TS_JDHelloWorld"; 2 | 3 | class Health extends JDHelloWorld { 4 | user: User 5 | shareCodeSelf: string[] = [] 6 | shareCodePool: string [] = [] 7 | 8 | constructor() { 9 | super(); 10 | } 11 | 12 | async init() { 13 | await this.run(new Health, this.help) 14 | } 15 | 16 | async api(fn: string, body: object) { 17 | return await this.post('https://api.m.jd.com/', `functionId=${fn}&body=${encodeURIComponent(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0&uuid=`, { 18 | 'Host': 'api.m.jd.com', 19 | 'Origin': 'https://h5.m.jd.com', 20 | 'User-Agent': this.user.UserAgent, 21 | 'Referer': 'https://h5.m.jd.com/', 22 | 'Content-Type': 'application/x-www-form-urlencoded', 23 | 'Cookie': this.user.cookie 24 | }) 25 | } 26 | 27 | async runTimes(code: string) { 28 | try { 29 | let data = await this.get(`https://sharecodepool.cnmb.win/api/runTimes0917?activityId=health&sharecode=${code}`) 30 | console.log(data) 31 | } catch (e) { 32 | await this.wait(5000) 33 | } 34 | } 35 | 36 | async main(user: User) { 37 | this.user = user 38 | let res: any 39 | res = await this.api('jdhealth_getHomeData', {}) 40 | if (!res.data?.result) { 41 | return 42 | } 43 | if (res.data.result.popupInfo.continuousSignInfo) { 44 | res = await this.api('jdhealth_collectScore', {"taskToken": res.data.result.popupInfo.continuousSignInfo.signInTaskToken, "taskId": res.data.result.continuousSignTaskId, "actionType": "0"}) 45 | if (res.data.bizCode === 0) { 46 | console.log('签到成功', res.data.result.acquiredScore) 47 | } 48 | } 49 | for (let i = 0; i < 3; i++) { 50 | res = await this.api('jdhealth_getTaskDetail', {"buildingId": "", "taskId": "", "channelId": 1}) 51 | try { 52 | for (let t of res.data.result.taskVos) { 53 | if (t.status === 1 || t.status === 3) { 54 | console.log(t.taskName) 55 | if (t.taskName.includes('打卡') && t.threeMealInfoVos[0].status === 1) { 56 | let data: any = await this.api('jdhealth_collectScore', {"taskToken": t.threeMealInfoVos[0].taskToken, "taskId": t.taskId, "actionType": 0}) 57 | if (res.data.bizCode === 0) 58 | console.log('打卡成功', parseInt(data.data.result.score)) 59 | else 60 | console.log('打卡失败', data.data.bizMsg) 61 | await this.wait(3000) 62 | } 63 | 64 | for (let tp of t.productInfoVos || t.followShopVo || t.shoppingActivityVos || []) { 65 | if (tp.status === 1) { 66 | console.log('\t', tp.skuName || tp.shopName || tp.title) 67 | if (t.waitDuration) { 68 | res = await this.api('jdhealth_collectScore', {"taskToken": tp.taskToken, "taskId": t.taskId, "actionType": 1}) 69 | console.log('\t', res.data.bizMsg) 70 | await this.wait(t.waitDuration * 1000 + 1000) 71 | } 72 | res = await this.api('jdhealth_collectScore', {"taskToken": tp.taskToken, "taskId": t.taskId, "actionType": 0}) 73 | if (res.data.bizMsg.includes('做完')) { 74 | console.log(res.data.bizMsg) 75 | break 76 | } else { 77 | console.log(res.data.bizMsg, parseInt(res.data.result.score)) 78 | await this.wait(3000) 79 | } 80 | } 81 | } 82 | await this.wait(3000) 83 | } 84 | } 85 | } catch (e) { 86 | console.log('Error', e) 87 | } 88 | await this.wait(10000) 89 | } 90 | } 91 | 92 | async help(users: User[]) { 93 | let res: any 94 | for (let user of users) { 95 | this.user = user 96 | console.log(`\n开始【京东账号${user.index + 1}】${user.UserName}\n`) 97 | res = await this.api('jdhealth_getTaskDetail', {"buildingId": "", "taskId": 6, "channelId": 1}) 98 | try { 99 | let code: string = res.data.result.taskVos[0].assistTaskDetailVo.taskToken 100 | console.log('助力码', code) 101 | this.shareCodeSelf.push(code) 102 | await this.runTimes(code) 103 | } catch (e) { 104 | } 105 | } 106 | this.o2s(this.shareCodeSelf, '内部助力码') 107 | 108 | for (let user of users) { 109 | this.user = user 110 | this.shareCodePool = await this.getShareCodePool('health', 1) 111 | let shareCode: string[] = Array.from(new Set([...this.shareCodeSelf, ...this.shareCodePool])), full: string[] = [] 112 | 113 | for (let code of shareCode) { 114 | if (full.includes(code)) 115 | continue 116 | console.log(`账号${user.index + 1} ${user.UserName} 去助力 ${code}`) 117 | res = await this.api('jdhealth_collectScore', {"taskToken": code, "taskId": "6", "actionType": 0}) 118 | try { 119 | if (res.data.bizMsg === '助力失败丨啊哦您今日的爱心值已爆棚,明天继续吧') { 120 | break 121 | } else if (res.data.bizMsg === '助力失败丨助力已满员!谢谢你哦~') { 122 | full.push(code) 123 | } else { 124 | console.log(res.data.bizMsg) 125 | } 126 | } catch (e) { 127 | this.o2s(res, 'jdhealth_collectScore catch') 128 | } finally { 129 | await this.wait(3000) 130 | } 131 | } 132 | } 133 | } 134 | } 135 | 136 | new Health().init().then() 137 | -------------------------------------------------------------------------------- /jd_health_collect.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * 健康能量收集 4 | * cron: 5-45/20 * * * * 5 | */ 6 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 7 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 8 | return new (P || (P = Promise))(function (resolve, reject) { 9 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 10 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 11 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 12 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 13 | }); 14 | }; 15 | var __generator = (this && this.__generator) || function (thisArg, body) { 16 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 17 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 18 | function verb(n) { return function (v) { return step([n, v]); }; } 19 | function step(op) { 20 | if (f) throw new TypeError("Generator is already executing."); 21 | while (g && (g = 0, op[0] && (_ = 0)), _) try { 22 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 23 | if (y = 0, t) op = [op[0] & 2, t.value]; 24 | switch (op[0]) { 25 | case 0: case 1: t = op; break; 26 | case 4: _.label++; return { value: op[1], done: false }; 27 | case 5: _.label++; y = op[1]; op = [0]; continue; 28 | case 7: op = _.ops.pop(); _.trys.pop(); continue; 29 | default: 30 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 31 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 32 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 33 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 34 | if (t[2]) _.ops.pop(); 35 | _.trys.pop(); continue; 36 | } 37 | op = body.call(thisArg, _); 38 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 39 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 40 | } 41 | }; 42 | exports.__esModule = true; 43 | var axios_1 = require("axios"); 44 | var path = require("path"); 45 | var TS_USER_AGENTS_1 = require("./TS_USER_AGENTS"); 46 | var cookie = '', UserName, res = ''; 47 | !(function () { return __awaiter(void 0, void 0, void 0, function () { 48 | var cookiesArr, except, _i, _a, _b, index, value; 49 | return __generator(this, function (_c) { 50 | switch (_c.label) { 51 | case 0: return [4 /*yield*/, (0, TS_USER_AGENTS_1.getCookie)()]; 52 | case 1: 53 | cookiesArr = _c.sent(); 54 | except = (0, TS_USER_AGENTS_1.exceptCookie)(path.basename(__filename)); 55 | _i = 0, _a = cookiesArr.entries(); 56 | _c.label = 2; 57 | case 2: 58 | if (!(_i < _a.length)) return [3 /*break*/, 6]; 59 | _b = _a[_i], index = _b[0], value = _b[1]; 60 | cookie = value; 61 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)[1]); 62 | console.log("\n\u5F00\u59CB\u3010\u4EAC\u4E1C\u8D26\u53F7".concat(index + 1, "\u3011").concat(UserName, "\n")); 63 | if (except.includes(encodeURIComponent(UserName))) { 64 | console.log('已设置跳过'); 65 | return [3 /*break*/, 5]; 66 | } 67 | return [4 /*yield*/, api('jdhealth_collectProduceScore', {})]; 68 | case 3: 69 | res = _c.sent(); 70 | (0, TS_USER_AGENTS_1.o2s)(res); 71 | return [4 /*yield*/, (0, TS_USER_AGENTS_1.wait)(1000)]; 72 | case 4: 73 | _c.sent(); 74 | _c.label = 5; 75 | case 5: 76 | _i++; 77 | return [3 /*break*/, 2]; 78 | case 6: return [2 /*return*/]; 79 | } 80 | }); 81 | }); })(); 82 | function api(fn, body) { 83 | return __awaiter(this, void 0, void 0, function () { 84 | var data; 85 | return __generator(this, function (_a) { 86 | switch (_a.label) { 87 | case 0: return [4 /*yield*/, axios_1["default"].post('https://api.m.jd.com/', "functionId=".concat(fn, "&body=").concat(encodeURIComponent(JSON.stringify(body)), "&client=wh5&clientVersion=1.0.0&uuid="), { 88 | headers: { 89 | 'Host': 'api.m.jd.com', 90 | 'Origin': 'https://h5.m.jd.com', 91 | 'User-Agent': TS_USER_AGENTS_1["default"], 92 | 'Referer': 'https://h5.m.jd.com/', 93 | 'Content-Type': 'application/x-www-form-urlencoded', 94 | 'Cookie': cookie 95 | } 96 | })]; 97 | case 1: 98 | data = (_a.sent()).data; 99 | return [2 /*return*/, data]; 100 | } 101 | }); 102 | }); 103 | } 104 | -------------------------------------------------------------------------------- /jd_health_collect.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 健康能量收集 3 | * cron: 5-45/20 * * * * 4 | */ 5 | 6 | import axios from "axios"; 7 | import * as path from "path" 8 | import USER_AGENT, {getCookie, exceptCookie, wait, o2s} from "./TS_USER_AGENTS" 9 | 10 | let cookie: string = '', UserName: string, res: any = '' 11 | 12 | !(async () => { 13 | let cookiesArr: string[] = await getCookie() 14 | let except: string[] = exceptCookie(path.basename(__filename)) 15 | 16 | for (let [index, value] of cookiesArr.entries()) { 17 | cookie = value 18 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 19 | console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 20 | 21 | if (except.includes(encodeURIComponent(UserName))) { 22 | console.log('已设置跳过') 23 | continue 24 | } 25 | 26 | res = await api('jdhealth_collectProduceScore', {}) 27 | o2s(res) 28 | 29 | await wait(1000) 30 | } 31 | })() 32 | 33 | async function api(fn: string, body: object) { 34 | let {data} = await axios.post('https://api.m.jd.com/', `functionId=${fn}&body=${encodeURIComponent(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0&uuid=`, { 35 | headers: { 36 | 'Host': 'api.m.jd.com', 37 | 'Origin': 'https://h5.m.jd.com', 38 | 'User-Agent': USER_AGENT, 39 | 'Referer': 'https://h5.m.jd.com/', 40 | 'Content-Type': 'application/x-www-form-urlencoded', 41 | 'Cookie': cookie 42 | } 43 | }) 44 | return data 45 | } -------------------------------------------------------------------------------- /jd_ifanli.ts: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import {o2s, getCookie, wait} from './TS_USER_AGENTS' 3 | 4 | 5 | let cookie: string = '', res: any = '' 6 | 7 | !(async () => { 8 | let cookiesArr: string[] = await getCookie() 9 | for (let [index, value] of cookiesArr.entries()) { 10 | cookie = value 11 | let UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 12 | console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 13 | 14 | res = await api('getTaskFinishCount') 15 | await wait(1000) 16 | let finishCount: number = res.content.content.finishCount, maxTaskCount: number = res.content.content.maxTaskCount 17 | console.log(finishCount, '/', maxTaskCount) 18 | 19 | for (let i = finishCount; i < maxTaskCount; i++) { 20 | let tasks = await api('getTaskList') 21 | tasks = tasks.content 22 | tasks = tasks.sort(compare('rewardBeans')) 23 | await wait(3000) 24 | 25 | for (let t of tasks) { 26 | if (t.statusName !== '活动结束' && t.status !== 2) { 27 | res = await taskApi('saveTaskRecord', {"taskId": null, "taskType": 2, "businessId": null}) 28 | o2s(res) 29 | await wait(t.watchTime * 1000 + 500) 30 | res = await taskApi('saveTaskRecord', {taskId: t.taskId, taskType: t.taskType, businessId: t.businessId, uid: res.content.uid, tt: res.content.tt}) 31 | o2s(res) 32 | await wait(2000) 33 | } 34 | } 35 | } 36 | } 37 | })() 38 | 39 | async function api(fn: string) { 40 | let {data} = await axios.get(`https://ifanli.m.jd.com/rebateapi/task/${fn}`, { 41 | headers: { 42 | "Host": "ifanli.m.jd.com", 43 | 'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1', 44 | 'referer': 'https://ifanli.m.jd.com/rebate/earnBean.html?paltform=null', 45 | "Cookie": cookie, 46 | "Content-Type": "application/json;charset=UTF-8" 47 | } 48 | }) 49 | return data 50 | } 51 | 52 | async function taskApi(fn: string, body: object) { 53 | let {data} = await axios.post(`https://ifanli.m.jd.com/rebateapi/task/${fn}`, JSON.stringify(body), { 54 | headers: { 55 | 'authority': 'ifanli.m.jd.com', 56 | 'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1', 57 | 'referer': 'https://ifanli.m.jd.com/rebate/earnBean.html?paltform=null', 58 | 'cookie': cookie 59 | } 60 | }) 61 | return data 62 | } 63 | 64 | function compare(property) { 65 | return function (a, b) { 66 | let value1 = a[property]; 67 | let value2 = b[property]; 68 | return value2 - value1; 69 | } 70 | } -------------------------------------------------------------------------------- /jd_jdzz.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 小程序-赚赚 3 | * cron: 30 9 * * * 4 | */ 5 | 6 | import {JDHelloWorld, User} from "./TS_JDHelloWorld"; 7 | 8 | class Jdzz extends JDHelloWorld { 9 | constructor() { 10 | super(); 11 | } 12 | 13 | async init() { 14 | await this.run(new Jdzz()) 15 | } 16 | 17 | async main(user: User) { 18 | let headers: object = { 19 | 'Host': 'api.m.jd.com', 20 | 'wqreferer': 'https://wq.jd.com/wxapp/pages/hd-interaction/task/index', 21 | 'User-Agent': 'MQQBrowser/26 Mozilla/5.0 (Linux; U; Android 2.3.7; zh-cn; MB200 Build/GRJ22; CyanogenMod-7) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1', 22 | 'Referer': 'https://servicewechat.com/wx8830763b00c18ac3/115/page-frame.html', 23 | 'Content-Type': 'application/json', 24 | 'Cookie': user.cookie 25 | } 26 | let res: any = await this.get(`https://api.m.jd.com/client.action?functionId=interactTaskIndex&body=%7B%22mpVersion%22%3A%223.4.0%22%7D&appid=wh5&loginWQBiz=interact&g_ty=ls&g_tk=${this.getRandomNumString(9)}`, headers) 27 | console.log(res.data.cashExpected) 28 | 29 | for (let t of res.data.taskDetailResList) { 30 | if (t.status === 1) { 31 | console.log(t.taskName) 32 | let taskItem: object = {...t, "fullTaskName": `${t.taskName} (0/1)`, "btnText": "去完成"} 33 | res = await this.get(`https://api.m.jd.com/client.action?functionId=doInteractTask&body=${encodeURIComponent(JSON.stringify({"taskId": t.taskId, "taskItem": taskItem, "actionType": 0, "taskToken": t.taskToken, "mpVersion": "3.4.0"}))}&appid=wh5&loginWQBiz=interact&g_ty=ls&g_tk=${this.getRandomNumString(9)}`, headers) 34 | console.log(res.message) 35 | await this.wait(2000) 36 | } 37 | } 38 | } 39 | } 40 | 41 | new Jdzz().init().then() 42 | -------------------------------------------------------------------------------- /jd_jinli_hongbao.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 京东-锦鲤红包 3 | * cron: 2 0,1,6 * * * 4 | * CK app_open 1 优先助力HW.ts 5 | */ 6 | 7 | import {get, getshareCodeHW, o2s, getCookie, wait} from "./TS_USER_AGENTS" 8 | import axios from "axios"; 9 | 10 | let cookie: string, cookiesArr: string[] = [], res: any, UserName: string 11 | let shareCodesSelf: string[] = [], shareCodes: string[] = [], shareCodesHW: string[] = [], fullCode: string[] = [], random: string = '', log: string = '' 12 | 13 | !(async () => { 14 | let all = (await getCookie()).filter(item => { 15 | return item.includes('app_open') 16 | }) 17 | cookiesArr = all.slice(0, 1) 18 | await join() 19 | await help() 20 | 21 | cookiesArr = all.slice(0, 9) 22 | if ([0, 1].includes(new Date().getHours())) { 23 | await join() 24 | } 25 | await getShareCodeSelf() 26 | await help() 27 | })() 28 | 29 | async function join() { 30 | for (let [index, value] of cookiesArr.entries()) { 31 | try { 32 | cookie = value 33 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 34 | console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 35 | for (let i = 0; i < 3; i++) { 36 | try { 37 | await getLog() 38 | res = await api('h5launch', {followShop: 0, random: random, log: log, sceneid: 'JLHBhPageh5'}) 39 | console.log('活动初始化:', res.data.result.statusDesc) 40 | if (res.rtn_code === 0) { 41 | break 42 | } 43 | } catch (e) { 44 | console.log('join error', res?.rtn_code) 45 | await wait(5000) 46 | } 47 | } 48 | } catch (e) { 49 | console.log(e) 50 | } 51 | await wait(5000) 52 | } 53 | } 54 | 55 | async function help() { 56 | for (let [index, value] of cookiesArr.entries()) { 57 | try { 58 | cookie = value 59 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 60 | if (shareCodesHW.length === 0) { 61 | shareCodesHW = await getshareCodeHW('jlhb') 62 | } 63 | if (cookiesArr.length === 1) { 64 | shareCodes = Array.from(new Set([...shareCodesHW, ...shareCodesSelf])) 65 | } else { 66 | shareCodes = Array.from(new Set([...shareCodesSelf, ...shareCodesHW])) 67 | } 68 | 69 | let me: string = await getShareCodeSelf(true), remain: boolean = true 70 | for (let code of shareCodes) { 71 | if (!remain) break 72 | let success: boolean = false 73 | if (!fullCode.includes(code) && code !== me) { 74 | console.log(`账号${index + 1} ${UserName} 去助力 ${code} ${shareCodesSelf.includes(code) ? '*内部*' : ''}`) 75 | for (let i = 0; i < 5; i++) { 76 | if (success) break 77 | await getLog() 78 | res = await api('jinli_h5assist', {"redPacketId": code, "followShop": 0, random: random, log: log, sceneid: 'JLHBhPageh5'}) 79 | if (res.rtn_code !== 0) { 80 | console.log('help error', res.rtn_code) 81 | await wait(5000) 82 | } else { 83 | success = true 84 | if (res.data.result.status === 0) { 85 | console.log('助力成功:', parseFloat(res.data.result.assistReward.discount)) 86 | await wait(45000) 87 | remain = false 88 | break 89 | } else if (res.data.result.status === 3) { 90 | console.log('今日助力次数已满') 91 | remain = false 92 | await wait(45000) 93 | break 94 | } else { 95 | console.log('助力结果:', res.data.result.statusDesc) 96 | if (res.data.result.statusDesc === '啊偶,TA的助力已满,开启自己的红包活动吧~') { 97 | fullCode.push(code) 98 | } 99 | await wait(45000) 100 | } 101 | } 102 | } 103 | } 104 | } 105 | } catch (e) { 106 | console.log(e) 107 | } 108 | await wait(5000) 109 | } 110 | } 111 | 112 | async function getShareCodeSelf(one: boolean = false) { 113 | if (one) { 114 | res = await api('h5activityIndex', {"isjdapp": 1}) 115 | return res?.data?.result?.redpacketInfo?.id 116 | } else { 117 | for (let [index, value] of cookiesArr.entries()) { 118 | try { 119 | cookie = value 120 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 121 | console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 122 | res = await api('h5activityIndex', {"isjdapp": 1}) 123 | console.log('ID:', res.data.result.redpacketInfo.id) 124 | shareCodesSelf.push(res.data.result.redpacketInfo.id) 125 | } catch (e) { 126 | console.log('getShareCodeSelf error', e) 127 | } 128 | await wait(1000) 129 | } 130 | o2s(shareCodesSelf) 131 | } 132 | } 133 | 134 | async function api(fn: string, body: object) { 135 | let {data} = await axios.post('https://api.m.jd.com/api', new URLSearchParams({ 136 | 'body': JSON.stringify(body) 137 | }), { 138 | params: { 139 | 'appid': 'jinlihongbao', 140 | 'functionId': fn, 141 | 'loginType': '2', 142 | 'client': 'jinlihongbao', 143 | 't': Date.now(), 144 | 'clientVersion': '11.1.0', 145 | 'osVersion': '-1' 146 | }, 147 | headers: { 148 | 'Host': 'api.m.jd.com', 149 | 'Origin': 'https://happy.m.jd.com', 150 | 'User-Agent': "jdapp;android;11.1.0;;;appBuild/98139;", 151 | 'Referer': 'https://happy.m.jd.com/', 152 | 'Cookie': cookie 153 | } 154 | }) 155 | return data 156 | } 157 | 158 | async function getLog(): Promise { 159 | let data = await get(`https://api.jdsharecode.xyz/api/jlhb?project=${__dirname}`) 160 | if (data !== '1' && data !== 1) { 161 | random = data.match(/"random":"(\d+)"/)[1] 162 | log = data.match(/"log":"(.*)"/)[1] 163 | } else { 164 | console.log('No log') 165 | process.exit(0) 166 | } 167 | } -------------------------------------------------------------------------------- /jd_jxScore.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __generator = (this && this.__generator) || function (thisArg, body) { 12 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 13 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 14 | function verb(n) { return function (v) { return step([n, v]); }; } 15 | function step(op) { 16 | if (f) throw new TypeError("Generator is already executing."); 17 | while (g && (g = 0, op[0] && (_ = 0)), _) try { 18 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 19 | if (y = 0, t) op = [op[0] & 2, t.value]; 20 | switch (op[0]) { 21 | case 0: case 1: t = op; break; 22 | case 4: _.label++; return { value: op[1], done: false }; 23 | case 5: _.label++; y = op[1]; op = [0]; continue; 24 | case 7: op = _.ops.pop(); _.trys.pop(); continue; 25 | default: 26 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 27 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 28 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 29 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 30 | if (t[2]) _.ops.pop(); 31 | _.trys.pop(); continue; 32 | } 33 | op = body.call(thisArg, _); 34 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 35 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 36 | } 37 | }; 38 | exports.__esModule = true; 39 | var axios_1 = require("axios"); 40 | var TS_USER_AGENTS_1 = require("./TS_USER_AGENTS"); 41 | var cookie = '', UserName = '', elements; 42 | !(function () { return __awaiter(void 0, void 0, void 0, function () { 43 | var cookiesArr, _i, _a, _b, index, value; 44 | return __generator(this, function (_c) { 45 | switch (_c.label) { 46 | case 0: return [4 /*yield*/, (0, TS_USER_AGENTS_1.getCookie)()]; 47 | case 1: 48 | cookiesArr = _c.sent(); 49 | _i = 0, _a = cookiesArr.entries(); 50 | _c.label = 2; 51 | case 2: 52 | if (!(_i < _a.length)) return [3 /*break*/, 5]; 53 | _b = _a[_i], index = _b[0], value = _b[1]; 54 | cookie = value; 55 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)[1]); 56 | console.log("\n\u5F00\u59CB\u3010\u4EAC\u4E1C\u8D26\u53F7".concat(index + 1, "\u3011").concat(UserName, "\n")); 57 | axios_1["default"].get("https://api.m.jd.com/?t=".concat(Date.now(), "&functionId=pg_channel_page_data&appid=vip_h5&body=%7B%22paramData%22:%7B%22token%22:%2260143dce-1cde-44de-8130-a6e5579e1567%22%7D%7D"), { 58 | headers: { 59 | 'Host': 'api.m.jd.com', 60 | 'Origin': 'https://vipgrowth.m.jd.com', 61 | 'Accept': 'application/json', 62 | 'User-Agent': TS_USER_AGENTS_1["default"], 63 | 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', 64 | 'Referer': 'https://vipgrowth.m.jd.com/', 65 | 'Cookie': cookie 66 | } 67 | }).then(function (_a) { 68 | var res = _a.data; 69 | console.log('京享值', res.data.floorInfoList[0].floorData.jxScoreInfo.jxScore); 70 | elements = res.data.floorInfoList[0].floorData.jxScoreInfo.elements; 71 | for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { 72 | var ele = elements_1[_i]; 73 | if (ele.level) { 74 | console.log(ele.name, ele.level); 75 | } 76 | } 77 | console.log('更新时间', res.data.floorInfoList[0].floorData.jxScoreInfo.lastUpdateTime); 78 | })["catch"](function (err) { 79 | console.log(err); 80 | }); 81 | return [4 /*yield*/, (0, TS_USER_AGENTS_1.wait)(3000)]; 82 | case 3: 83 | _c.sent(); 84 | _c.label = 4; 85 | case 4: 86 | _i++; 87 | return [3 /*break*/, 2]; 88 | case 5: 89 | desc(); 90 | return [2 /*return*/]; 91 | } 92 | }); 93 | }); })(); 94 | function desc() { 95 | console.log('\n\n'); 96 | for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { 97 | var ele = elements_2[_i]; 98 | if (ele.level) { 99 | console.log("".concat(ele.name, "\uFF1A").concat(ele.desc)); 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /jd_jxScore.ts: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import USER_AGENT, {getCookie, wait} from './TS_USER_AGENTS' 3 | 4 | let cookie: string = '', UserName: string = '', elements: Array<{ desc: string, level: number | null, name: string }> 5 | 6 | !(async () => { 7 | let cookiesArr: string[] = await getCookie() 8 | for (let [index, value] of cookiesArr.entries()) { 9 | cookie = value 10 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 11 | console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 12 | 13 | axios.get(`https://api.m.jd.com/?t=${Date.now()}&functionId=pg_channel_page_data&appid=vip_h5&body=%7B%22paramData%22:%7B%22token%22:%2260143dce-1cde-44de-8130-a6e5579e1567%22%7D%7D`, { 14 | headers: { 15 | 'Host': 'api.m.jd.com', 16 | 'Origin': 'https://vipgrowth.m.jd.com', 17 | 'Accept': 'application/json', 18 | 'User-Agent': USER_AGENT, 19 | 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', 20 | 'Referer': 'https://vipgrowth.m.jd.com/', 21 | 'Cookie': cookie 22 | } 23 | }).then(({data: res}: any) => { 24 | console.log('京享值', res.data.floorInfoList[0].floorData.jxScoreInfo.jxScore) 25 | elements = res.data.floorInfoList[0].floorData.jxScoreInfo.elements 26 | for (let ele of elements) { 27 | if (ele.level) { 28 | console.log(ele.name, ele.level) 29 | } 30 | } 31 | console.log('更新时间', res.data.floorInfoList[0].floorData.jxScoreInfo.lastUpdateTime) 32 | }).catch(err => { 33 | console.log(err) 34 | }) 35 | await wait(3000) 36 | } 37 | desc() 38 | })() 39 | 40 | function desc() { 41 | console.log('\n\n') 42 | for (let ele of elements) { 43 | if (ele.level) { 44 | console.log(`${ele.name}:${ele.desc}`) 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /jd_jxgc_stock.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 京喜工厂:肯德基、沃尔玛 3 | * cron: 0 * * * * 4 | */ 5 | 6 | import axios from "axios"; 7 | import {getCookie, o2s, wait, randomWord} from "./TS_USER_AGENTS"; 8 | import {requestAlgo} from "./utils/V3"; 9 | import {sendNotify} from './sendNotify' 10 | 11 | let cookie: string = '', res: any = '', message: string = ''; 12 | 13 | !(async () => { 14 | await requestAlgo('10001') 15 | let cookiesArr: string[] = await getCookie(); 16 | cookie = cookiesArr[Math.floor(Math.random() * cookiesArr.length)]; 17 | 18 | /* 19 | let exist: string[] = []; 20 | if (existsSync('json/jxgc_stock.json')) { 21 | exist = JSON.parse(readFileSync('./json/jxgc_stock.json').toString() || '[]') 22 | } 23 | res = await api(); 24 | let current: string[] = [] 25 | for (let t of res.data.commodityList) { 26 | console.log(t.name) 27 | current.push(t.name) 28 | if (!exist.includes(t.name)) { 29 | message += t.name + '\n' 30 | } 31 | } 32 | writeFileSync('./json/jxgc_stock.json', JSON.stringify(current)) 33 | if (message) { 34 | console.log('send...') 35 | sendNotify('京喜工厂可生产', message) 36 | } 37 | */ 38 | res = await api(); 39 | await wait(1000) 40 | 41 | let keywords: string[] = ['KFC', 'kfc', '肯德基', '沃尔玛'] 42 | for (let t of res.data.commodityList) { 43 | let name: string = t.name, commodityId: number = t.commodityId 44 | res = await api(commodityId) 45 | await wait(1000) 46 | 47 | let desp: string = res.data.commodityList[0].description 48 | if (desp.indexOf('红包') > -1) { 49 | desp = desp.match(/奖[励|品]以(.*)发放/)[1] 50 | message += `${name} ${desp}\n` 51 | } else if (desp.indexOf('支付') > -1) { 52 | desp = desp.match(/完成需(.*元)/)![1] 53 | } else { 54 | o2s(res) 55 | } 56 | console.log(name, desp) 57 | 58 | for (let keyword of keywords) { 59 | if (name.indexOf(keyword) > -1) { 60 | await sendNotify("京喜工厂", name) 61 | break 62 | } 63 | } 64 | } 65 | if (message) { 66 | sendNotify('京喜工厂送红包', message) 67 | } 68 | })() 69 | 70 | async function api(commodityId?: number) { 71 | let t = Date.now() 72 | let url: string = commodityId 73 | ? `https://m.jingxi.com/dreamfactory/diminfo/GetCommodityDetails?zone=dream_factory&commodityId=${commodityId}&_time=${t}&_ts=${t}&_=${t}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls` 74 | : `https://m.jingxi.com/dreamfactory/diminfo/GetCommodityList?zone=dream_factory&flag=2&pageNo=1&pageSize=12&_time=${t}&_ts=${t}&_=${t}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls` 75 | let {data}: any = await axios.get(url, { 76 | headers: { 77 | 'Host': 'm.jingxi.com', 78 | 'User-Agent': 'jdpingou;', 79 | 'Referer': 'https://st.jingxi.com/', 80 | 'Cookie': cookie 81 | } 82 | }) 83 | return JSON.parse(data.match(/jsonpCBK.?\((.*)/)[1]) 84 | } -------------------------------------------------------------------------------- /jd_jxmc_getCoin.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 单独收牛牛 3 | * cron: 0,30 * * * * 4 | */ 5 | 6 | import axios from 'axios'; 7 | import * as path from 'path'; 8 | import {getCookie, wait, exceptCookie, randomWord} from './TS_USER_AGENTS'; 9 | import {requestAlgo, geth5st} from "./utils/V3"; 10 | import {existsSync, readFileSync} from "fs"; 11 | 12 | let cookie: string = '', res: any = '', homePageInfo: any, jxToken: { farm_jstoken: string, phoneid: string, timestamp: number }, UserName: string, index: number; 13 | let {cow, token} = require('./utils/jd_jxmc.js'), ua: string = 'jdpingou;'; 14 | 15 | !(async () => { 16 | let account: any[] = []; 17 | if (existsSync('./utils/account.json')) { 18 | try { 19 | account = JSON.parse(readFileSync('./utils/account.json').toString()) 20 | } catch (e) { 21 | console.log(e) 22 | } 23 | } 24 | 25 | await requestAlgo('00df8', 'jdpingou;'); 26 | let cookiesArr: string[] = await getCookie(); 27 | let except: string[] = exceptCookie(path.basename(__filename)); 28 | 29 | for (let i = 0; i < cookiesArr.length; i++) { 30 | cookie = cookiesArr[i]; 31 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 32 | index = i + 1; 33 | console.log(`\n开始【京东账号${index}】${UserName}\n`); 34 | 35 | if (except.includes(encodeURIComponent(UserName))) { 36 | console.log('已设置跳过') 37 | continue 38 | } 39 | 40 | ua = 'jdpingou;' 41 | for (let acc of account) { 42 | if (acc?.pt_pin.includes(UserName) && acc?.jdpingou) { 43 | ua = acc.jdpingou 44 | console.log('指定UA:', ua) 45 | break 46 | } 47 | } 48 | 49 | jxToken = await token(cookie); 50 | homePageInfo = await api('queryservice/GetHomePageInfo', 'activeid,activekey,channel,isgift,isqueryinviteicon,isquerypicksite,isregionflag,jxmc_jstoken,phoneid,sceneid,timestamp', {isgift: 1, isquerypicksite: 1, isqueryinviteicon: 1, isregionflag: 0, activeid: null}) 51 | let lastgettime: number 52 | if (homePageInfo.data?.cow?.lastgettime) { 53 | lastgettime = homePageInfo.data.cow.lastgettime 54 | } else { 55 | continue 56 | } 57 | 58 | let food: number = 0 59 | try { 60 | food = homePageInfo.data.materialinfo[0].value; 61 | } catch (e: any) { 62 | console.log('未开通?黑号?') 63 | continue 64 | } 65 | 66 | // 收牛牛 67 | let cowToken = await cow(lastgettime); 68 | res = await api('operservice/GetCoin', 'activeid,activekey,channel,commtype,jxmc_jstoken,phoneid,sceneid,timestamp,token', {token: cowToken, commtype: 0, activeid: 'jxmc_active_0001'}) 69 | if (res.ret === 0) 70 | console.log('收牛牛:', res.data.addcoin) 71 | else 72 | console.log('收牛牛:', res) 73 | await wait(3000) 74 | } 75 | })() 76 | 77 | async function api(fn: string, stk: string, params: object) { 78 | let url: string, t: { key: string, value: string } [] = [ 79 | {key: 'activekey', value: 'null'}, 80 | {key: 'channel', value: '7'}, 81 | {key: 'jxmc_jstoken', value: jxToken.farm_jstoken}, 82 | {key: 'phoneid', value: jxToken.phoneid}, 83 | {key: 'sceneid', value: '1001'}, 84 | {key: 'timestamp', value: jxToken.timestamp.toString()}, 85 | ] 86 | url = `https://m.jingxi.com/jxmc/${fn}?channel=7&sceneid=1001&activekey=null&jxmc_jstoken=${jxToken['farm_jstoken']}×tamp=${jxToken.timestamp}&phoneid=${jxToken.phoneid}&_stk=${encodeURIComponent(stk)}&_ste=1&_=${Date.now()}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls` 87 | 88 | for (let [key, value] of Object.entries(params)) { 89 | t.push({key, value}) 90 | url += `&${key}=${value}` 91 | } 92 | url += `&h5st=${encodeURIComponent(geth5st(t, '00df8'))}` 93 | try { 94 | let {data}: any = await axios.get(url, { 95 | headers: { 96 | 'Host': 'm.jingxi.com', 97 | 'Accept': '*/*', 98 | 'Connection': 'keep-alive', 99 | 'User-Agent': ua, 100 | 'Referer': 'https://st.jingxi.com/pingou/jxmc/index.html', 101 | 'Cookie': cookie 102 | } 103 | }) 104 | return JSON.parse(data.replace(/jsonpCBK.?\(/, '').split('\n')[0]) 105 | } catch (e: any) { 106 | console.log('api Error:', e) 107 | return {} 108 | } 109 | } -------------------------------------------------------------------------------- /jd_jxmc_stock.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 京喜牧场兑换新品通知 3 | * 推送新上商品 4 | * cron: 0 * * * * 5 | */ 6 | 7 | import axios from 'axios'; 8 | import {readFileSync, writeFileSync, existsSync} from "fs"; 9 | import {getCookie, wait, getRandomNumberByRange, randomWord, randomString} from './TS_USER_AGENTS'; 10 | import {requestAlgo, geth5st} from "./utils/V3"; 11 | import {token} from './utils/jd_jxmc.js' 12 | import {sendNotify} from './sendNotify' 13 | 14 | let cookie: string = '', res: any = '', UserName: string, jxToken: { farm_jstoken: string, timestamp: string, phoneid: string }; 15 | 16 | !(async () => { 17 | await requestAlgo('00df8'); 18 | let cookiesArr: string[] = await getCookie(); 19 | cookie = cookiesArr[getRandomNumberByRange(0, cookiesArr.length)]; 20 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 21 | if (!existsSync('./json/jxmc_stock.json')) { 22 | writeFileSync('./json/jxmc_stock.json', '{}', 'utf-8') 23 | } 24 | let exist: object 25 | try { 26 | exist = JSON.parse(readFileSync('./json/jxmc_stock.json', 'utf-8')) 27 | } catch (e) { 28 | exist = {} 29 | } 30 | let items: string = '', message: string = '' 31 | res = await api('queryservice/GetGoodsListV2', 'activeid,activekey,channel,jxmc_jstoken,phoneid,sceneid,timestamp', {}) 32 | for (let good of res.data.goodslist) { 33 | if (!Object.keys(exist).includes(good.prizepool)) { 34 | items += good.prizepool + ',' 35 | exist[good.prizepool] = { 36 | id: good.prizepool, 37 | egg: good.neednum 38 | } 39 | } 40 | } 41 | let allItems: string = items; 42 | if (items) { 43 | let arr: string[] = items.split(','); 44 | arr.pop(); 45 | items = ''; 46 | let result = []; 47 | for (let i = 0, len = arr.length; i < len; i += 30) { 48 | result.push(arr.slice(i, i + 30)) 49 | } 50 | for (let group of result) { 51 | for (let id of group) { 52 | items += id + ',' 53 | } 54 | res = await getEgg(items) 55 | await wait(1000) 56 | for (let t of res.result) { 57 | exist[t.active].name = t.prizes[0].Name 58 | } 59 | items = '' 60 | } 61 | } 62 | console.log(exist) 63 | writeFileSync('./json/jxmc_stock.json', JSON.stringify(exist, null, 2), 'utf-8') 64 | for (let j of Object.keys(exist)) { 65 | if (allItems.indexOf(j) > -1) { 66 | message += exist[j].name + '\t' + exist[j].egg + '\n' 67 | } 68 | } 69 | console.log(message) 70 | if (message) { 71 | await sendNotify('京喜牧场兑换', message) 72 | } 73 | })() 74 | 75 | interface Params { 76 | isgift?: number, 77 | activeid?: string, 78 | activekey?: string, 79 | jxmc_jstoken?: string, 80 | timestamp?: string, 81 | phoneid?: string 82 | } 83 | 84 | async function api(fn: string, stk: string, params: Params = {}) { 85 | jxToken = await token(cookie) 86 | let url: string, t: { key: string, value: string } [] = [ 87 | {key: 'activeid', value: 'jxmc_active_0001'}, 88 | {key: 'activekey', value: 'null'}, 89 | {key: 'channel', value: '7'}, 90 | {key: 'sceneid', value: '1001'}, 91 | {key: 'jxmc_jstoken', value: jxToken.farm_jstoken}, 92 | {key: 'timestamp', value: jxToken.timestamp}, 93 | {key: 'phoneid', value: jxToken.phoneid}, 94 | ] 95 | url = `https://m.jingxi.com/jxmc/${fn}?channel=7&sceneid=1001&_stk=${encodeURIComponent(stk)}&_ste=1&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls` 96 | for (let [key, value] of Object.entries(params)) { 97 | t.push({key, value}) 98 | url += `&${key}=${value}` 99 | } 100 | let h5st = geth5st(t, '00df8') 101 | url += `&h5st=${encodeURIComponent(h5st)}` 102 | let {data}: any = await axios.get(url, { 103 | headers: { 104 | 'Host': 'm.jingxi.com', 105 | 'Accept': '*/*', 106 | 'Connection': 'keep-alive', 107 | 'User-Agent': `jdpingou;iPhone;5.14.2;${getRandomNumberByRange(12, 16)}.${getRandomNumberByRange(0, 3)};${randomString(40)};`, 108 | 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', 109 | 'Referer': 'https://st.jingxi.com/', 110 | 'Cookie': cookie 111 | } 112 | }) 113 | return JSON.parse(data.match(/jsonpCBK.?\((.*)/)[1]) 114 | } 115 | 116 | async function getEgg(items: string) { 117 | items = items.substring(0, items.length - 1) 118 | let {data} = await axios.get(`https://m.jingxi.com/active/queryprizedetails?actives=${items}&_=${Date.now()}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls`, { 119 | headers: { 120 | 'Host': 'm.jingxi.com', 121 | 'Accept': '*/*', 122 | 'Connection': 'keep-alive', 123 | 'User-Agent': `jdpingou;iPhone;5.14.2;${getRandomNumberByRange(12, 16)}.${getRandomNumberByRange(0, 3)};${randomString(40)};`, 124 | 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', 125 | 'Referer': 'https://st.jingxi.com/', 126 | 'Cookie': cookie 127 | } 128 | }) 129 | return JSON.parse(data.match(/jsonpCBK.?\(([\s\S]*)\);/)[1]) 130 | } -------------------------------------------------------------------------------- /jd_miniTask.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * 微信-购物-天天赚💰 4 | */ 5 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 6 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 7 | return new (P || (P = Promise))(function (resolve, reject) { 8 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 9 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 10 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 11 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 12 | }); 13 | }; 14 | var __generator = (this && this.__generator) || function (thisArg, body) { 15 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 16 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 17 | function verb(n) { return function (v) { return step([n, v]); }; } 18 | function step(op) { 19 | if (f) throw new TypeError("Generator is already executing."); 20 | while (g && (g = 0, op[0] && (_ = 0)), _) try { 21 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 22 | if (y = 0, t) op = [op[0] & 2, t.value]; 23 | switch (op[0]) { 24 | case 0: case 1: t = op; break; 25 | case 4: _.label++; return { value: op[1], done: false }; 26 | case 5: _.label++; y = op[1]; op = [0]; continue; 27 | case 7: op = _.ops.pop(); _.trys.pop(); continue; 28 | default: 29 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 30 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 31 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 32 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 33 | if (t[2]) _.ops.pop(); 34 | _.trys.pop(); continue; 35 | } 36 | op = body.call(thisArg, _); 37 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 38 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 39 | } 40 | }; 41 | exports.__esModule = true; 42 | var TS_USER_AGENTS_1 = require("./TS_USER_AGENTS"); 43 | !(function () { return __awaiter(void 0, void 0, void 0, function () { 44 | var cookiesArr, wqskey, _i, cookiesArr_1, cookie; 45 | return __generator(this, function (_a) { 46 | switch (_a.label) { 47 | case 0: return [4 /*yield*/, (0, TS_USER_AGENTS_1.getCookie)()]; 48 | case 1: 49 | cookiesArr = _a.sent(); 50 | wqskey = []; 51 | for (_i = 0, cookiesArr_1 = cookiesArr; _i < cookiesArr_1.length; _i++) { 52 | cookie = cookiesArr_1[_i]; 53 | if (cookie.includes('wq_uin') && cookie.includes('wq_skey')) { 54 | wqskey.push(cookie); 55 | } 56 | } 57 | if (wqskey.length === 0) { 58 | console.log('无微信购物专用cookie'); 59 | } 60 | return [2 /*return*/]; 61 | } 62 | }); 63 | }); })(); 64 | -------------------------------------------------------------------------------- /jd_miniTask.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 微信-购物-天天赚💰 3 | */ 4 | 5 | import {getCookie} from "./TS_USER_AGENTS"; 6 | 7 | !(async () => { 8 | let cookiesArr: string[] = await getCookie(); 9 | let wqskey: string[] = [] 10 | for (let cookie of cookiesArr) { 11 | if (cookie.includes('wq_uin') && cookie.includes('wq_skey')) { 12 | wqskey.push(cookie) 13 | } 14 | } 15 | if (wqskey.length === 0) { 16 | console.log('无微信购物专用cookie') 17 | } 18 | })() -------------------------------------------------------------------------------- /jd_plantBean__help.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 京东-种豆-助力 3 | * 所有CK助力顺序 4 | * 内部 -> 助力池 5 | * cron: 15 7-21/2 * * * 6 | */ 7 | 8 | import {User, JDHelloWorld} from "./TS_JDHelloWorld" 9 | import {H5ST} from "./utils/h5st_pro"; 10 | 11 | class Jd_plantBean__help extends JDHelloWorld { 12 | user: User 13 | h5stTool: H5ST 14 | fp: any = undefined 15 | 16 | constructor() { 17 | super(); 18 | } 19 | 20 | async init() { 21 | try { 22 | this.fp = process.env.FP_6B93E || await this.getFp() 23 | } catch (e) { 24 | console.log(e.message) 25 | } 26 | await this.run(this) 27 | } 28 | 29 | async api(fn: string, body: object) { 30 | let h5st: string = await this.h5stTool.__genH5st({ 31 | 'appid': 'signed_wh5', 32 | 'body': JSON.stringify(body), 33 | 'client': 'apple', 34 | 'clientVersion': '11.3.6', 35 | 'functionId': fn, 36 | }) 37 | let data: string = await this.get(`https://api.m.jd.com/client.action?functionId=${fn}&appid=signed_wh5&body=${encodeURIComponent(JSON.stringify(body))}&client=apple&clientVersion=11.3.6&h5st=${h5st}&jsonp=jsonp_${Date.now()}_${this.getRandomNumberByRange(12345, 56789)}`, { 38 | 'Host': 'api.m.jd.com', 39 | 'User-Agent': this.user.UserAgent, 40 | 'Referer': 'https://plantearth.m.jd.com/', 41 | 'Cookie': this.user.cookie, 42 | }) 43 | return JSON.parse(data.match(/jsonp_.*\((.*)\)/)[1]) 44 | } 45 | 46 | async runTimes(code: string) { 47 | try { 48 | let data = await this.get(`https://sharecodepool.cnmb.win/api/runTimes0917?activityId=bean&sharecode=${code}`) 49 | console.log(data) 50 | } catch (e) { 51 | await this.wait(5000) 52 | } 53 | } 54 | 55 | async main(user: User) { 56 | let res: any, data: any 57 | try { 58 | this.user = user 59 | this.user.UserAgent = `jdapp;iPhone;11.3.6;;;M/5.0;appBuild/168392;Mozilla/5.0 (iPhone; CPU iPhone OS ${this.getIosVer()} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1;` 60 | this.h5stTool = new H5ST('6b93e', this.user.UserAgent, this.fp, 'https://plantearth.m.jd.com/plantBean/index?source=lingjingdoushouye', 'https://plantearth.m.jd.com', this.user.UserName) 61 | await this.h5stTool.__genAlgo() 62 | res = await this.api('plantBeanIndex', {"monitor_source": "plant_m_plant_index", "monitor_refer": "", "version": "9.2.4.2"}) 63 | let code: string = res.data.jwordShareInfo.shareUrl.match(/plantUuid=(\w+)/)[1] 64 | console.log('助力码', code) 65 | 66 | res = await this.api('plantShareSupportList', {"roundId": ""}) 67 | console.log('收到助力', res.data.length) 68 | } catch (e) { 69 | console.log(e.message) 70 | } 71 | } 72 | 73 | async help(users: User[]) { 74 | let res: any, full: string[] = [] 75 | for (let user of users) { 76 | try { 77 | this.user = user 78 | this.user.UserAgent = `jdapp;iPhone;11.3.6;;;M/5.0;appBuild/168392;Mozilla/5.0 (iPhone; CPU iPhone OS ${this.getIosVer()} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1;` 79 | this.h5stTool = new H5ST('6b93e', this.user.UserAgent, this.fp, 'https://plantearth.m.jd.com/plantBean/index?source=lingjingdoushouye', 'https://plantearth.m.jd.com', this.user.UserName) 80 | await this.h5stTool.__genAlgo() 81 | let shareCodePool: string[] = await this.getShareCodePool('bean', 50) 82 | let shareCode: string[] = Array.from(new Set([...shareCodePool])) 83 | res = await this.api('plantBeanIndex', {"monitor_source": "plant_m_plant_index", "monitor_refer": "", "version": "9.2.4.2"}) 84 | let my: string = res.data.jwordShareInfo.shareUrl.match(/plantUuid=(\w+)/)[1] 85 | for (let code of shareCode) { 86 | console.log(`账号${user.index + 1} ${user.UserName} 去助力 ${code}`) 87 | if (full.includes(code)) { 88 | console.log('full contains') 89 | continue 90 | } 91 | res = await this.api('plantBeanIndex', {"plantUuid": code, "monitor_source": "plant_m_plant_index", "monitor_refer": "", "version": "9.2.4.2"}) 92 | console.log(res.data.helpShareRes.promptText) 93 | if (res.data.helpShareRes.state === '2') { 94 | console.log('上限') 95 | break 96 | } else if (res.data.helpShareRes.state === '3') { 97 | full.push(code) 98 | } 99 | await this.runTimes(my) 100 | await this.wait(3000) 101 | } 102 | } catch (e) { 103 | console.log(e.message) 104 | await this.wait(5000) 105 | } 106 | } 107 | } 108 | } 109 | 110 | new Jd_plantBean__help().init().then() -------------------------------------------------------------------------------- /jd_ql_repo.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * 🐉 ql repo 4 | * cron: 30 2 * * * 5 | */ 6 | exports.__esModule = true; 7 | var child_process_1 = require("child_process"); 8 | if (process.env.HOSTNAME === 'qinglong' || process.env.QL_DIR) { 9 | process.chdir('../../repo/JDHelloWorld_jd_scripts/'); 10 | (0, child_process_1.execSync)('git fetch --all; git reset --hard origin/main; git pull'); 11 | (0, child_process_1.execSync)('ql repo https://github.com/JDHelloWorld/jd_scripts.git "jd_|jx_" "backUp" "^jd[^_]|USER|^TS|utils"'); 12 | } 13 | -------------------------------------------------------------------------------- /jd_ql_repo.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 🐉 ql repo 3 | * cron: 30 2 * * * 4 | */ 5 | 6 | import {execSync} from "child_process"; 7 | 8 | if (process.env.HOSTNAME === 'qinglong' || process.env.QL_DIR) { 9 | process.chdir('../../repo/JDHelloWorld_jd_scripts/') 10 | execSync('git fetch --all; git reset --hard origin/main; git pull') 11 | execSync('ql repo https://github.com/JDHelloWorld/jd_scripts.git "jd_|jx_" "backUp" "^jd[^_]|USER|^TS|utils"') 12 | } 13 | -------------------------------------------------------------------------------- /jd_queryRedpacket.ts: -------------------------------------------------------------------------------- 1 | import {JDHelloWorld, User} from "./TS_JDHelloWorld"; 2 | 3 | class Jd_queryRedpacket extends JDHelloWorld { 4 | constructor() { 5 | super("京东红包"); 6 | } 7 | 8 | async init() { 9 | await this.run(new Jd_queryRedpacket()) 10 | } 11 | 12 | add(arg1: number, arg2: number) { 13 | let r1, r2, m 14 | try { 15 | r1 = arg1.toString().split('.')[1].length 16 | } catch (e) { 17 | r1 = 0 18 | } 19 | try { 20 | r2 = arg2.toString().split('.')[1].length 21 | } catch (e) { 22 | r2 = 0 23 | } 24 | m = Math.pow(10, Math.max(r1, r2)) 25 | return parseFloat(((arg1 * m + arg2 * m) / m).toFixed(2)) 26 | } 27 | 28 | async main(user: User) { 29 | let res: any = await this.get(`https://m.jingxi.com/user/info/QueryUserRedEnvelopesV2?type=1&orgFlag=JD_PinGou_New&page=1&cashRedType=1&redBalanceFlag=1&channel=1&_=${Date.now()}&sceneval=2&g_login_type=1&g_ty=ls`, { 30 | 'Host': 'm.jingxi.com', 31 | 'Referer': 'https://st.jingxi.com/my/redpacket.shtml', 32 | "Cookie": user.cookie, 33 | 'User-Agent': user.UserAgent 34 | }) 35 | let day: number = new Date().getDay(), jdRed: number = 0, jdRedExp: number = 0, jsRed: number = 0, jsRedExp: number = 0 36 | for (let j of res.data.useRedInfo?.redList || []) { 37 | console.log(j) 38 | if (j.orgLimitStr.includes('京喜')) { 39 | } else if (j.activityName.includes('极速版')) { 40 | jsRed = this.add(jsRed, j.balance) 41 | if (new Date(j.endTime * 1000).getDay() === day) 42 | jsRedExp = this.add(jsRedExp, j.balance) 43 | } else if (j.orgLimitStr.includes('京东健康')) { 44 | } else { 45 | jdRed = this.add(jdRed, j.balance) 46 | if (new Date(j.endTime * 1000).getDay() === day) 47 | jdRedExp = this.add(jdRedExp, j.balance) 48 | } 49 | } 50 | console.log('京东', jdRed, ' 今日过期:', jdRedExp) 51 | console.log('极速', jsRed, ' 今日过期:', jsRedExp) 52 | let msg = `【账号】 ${user.UserName}\n京东红包 ${jdRed}\n今日过期 ${jdRedExp}\n\n` 53 | return { 54 | msg: msg 55 | } 56 | } 57 | } 58 | 59 | new Jd_queryRedpacket().init().then() 60 | -------------------------------------------------------------------------------- /jd_sgmh.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 闪购盲盒 3 | * cron: 20 8 * * * 4 | */ 5 | 6 | import {getCookie, getShareCodePool, wait} from "./TS_USER_AGENTS" 7 | import axios from "axios"; 8 | 9 | let cookie: string = '', UserName: string, res: any 10 | let shareCodeSelf: string[] = [], shareCode: string[] = [], shareCodePool: string[] = [] 11 | 12 | !(async () => { 13 | let cookiesArr: string[] = await getCookie() 14 | for (let [index, value] of cookiesArr.entries()) { 15 | cookie = value 16 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 17 | console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 18 | 19 | res = await api('healthyDay_getHomeData', {"appId": "1ElZXwKuP", "taskToken": "", "channelId": 1}) 20 | 21 | for (let t of res.data.result.taskVos) { 22 | if (t.taskType === 14) { 23 | console.log('助力码', t.assistTaskDetailVo?.taskToken) 24 | shareCodeSelf.push(t.assistTaskDetailVo?.taskToken) 25 | } 26 | if ((t.browseShopVo || t.productInfoVos || t.shoppingActivityVos) && t.times < t.maxTimes) { 27 | for (let i = 0; i < t.maxTimes - t.times; i++) { 28 | let tp: any[] = [] 29 | if (t.productInfoVos) 30 | tp = t.productInfoVos 31 | else if (t.browseShopVo) 32 | tp = t.browseShopVo 33 | else if (t.shoppingActivityVos) 34 | tp = t.shoppingActivityVos 35 | console.log(tp[i]?.shopName || tp[i]?.skuName || tp[i]?.title) 36 | if (!t.shoppingActivityVos) { 37 | res = await api('harmony_collectScore', { 38 | "appId": "1ElZXwKuP", 39 | "taskToken": tp[i].taskToken, 40 | "taskId": t.taskId, 41 | "actionType": 1 42 | }) 43 | console.log(res.data.bizMsg) 44 | await wait(t.waitDuration * 1000 || 2000) 45 | } 46 | res = await api('harmony_collectScore', { 47 | "appId": "1ElZXwKuP", 48 | "taskToken": tp[i].taskToken, 49 | "taskId": t.taskId, 50 | "actionType": 0 51 | }) 52 | await wait(1000) 53 | if (res.data.bizMsg === 'success') { 54 | console.log('任务完成') 55 | } else { 56 | break 57 | } 58 | } 59 | } 60 | } 61 | } 62 | 63 | // 助力 64 | let full: string[] = [] 65 | for (let [index, value] of cookiesArr.entries()) { 66 | cookie = value 67 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 68 | console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 69 | 70 | shareCodePool = await getShareCodePool('sgmh', 30) 71 | shareCode = Array.from(new Set([...shareCodeSelf, ...shareCodePool])) 72 | 73 | for (let code of shareCode) { 74 | if (full.includes(code)) { 75 | console.log('full contains') 76 | continue 77 | } 78 | console.log('去助力', code) 79 | res = await api('harmony_collectScore', {"appId": "1ElZXwKuP", "taskToken": code, "taskId": 3}) 80 | if (res.data.bizCode === 0) { 81 | console.log('助力成功') 82 | } else if (res.data.bizCode === 108) { 83 | console.log('上限') 84 | break 85 | } else if (res.data.bizMsg === '助力已满员!谢谢你哦~') { 86 | full.push(code) 87 | console.log('已满') 88 | } else { 89 | console.log('助力失败', res.data.bizMsg) 90 | } 91 | await wait(2000) 92 | } 93 | } 94 | 95 | // 抽奖 96 | for (let [index, value] of cookiesArr.entries()) { 97 | cookie = value 98 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 99 | console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 100 | res = await api('healthyDay_getHomeData', {"appId": "1ElZXwKuP", "taskToken": "", "channelId": 1}) 101 | await wait(1000) 102 | let lotteryNum: number = parseInt(res.data.result.userInfo.lotteryNum) 103 | console.log('可以抽奖', lotteryNum, '次') 104 | for (let i = 0; i < lotteryNum; i++) { 105 | res = await api('interact_template_getLotteryResult', {"appId": "1ElZXwKuP"}) 106 | if (res.data.result.userAwardsCacheDto.type === 0) { 107 | console.log('抽奖成功 空气') 108 | } else { 109 | console.log('抽奖成功', res.data.result.userAwardsCacheDto.jBeanAwardVo?.prizeName) 110 | } 111 | await wait(1000) 112 | } 113 | } 114 | })() 115 | 116 | async function api(fn: string, body: object) { 117 | let {data} = await axios.post('https://api.m.jd.com/client.action', 118 | `functionId=${fn}&body=${JSON.stringify(body)}&client=wh5&clientVersion=1.0.0`, { 119 | headers: { 120 | 'Host': 'api.m.jd.com', 121 | 'Origin': 'https://h5.m.jd.com', 122 | 'User-Agent': 'jdapp;iPhone;10.4.3;', 123 | 'Referer': 'https://h5.m.jd.com/', 124 | 'Cookie': cookie 125 | } 126 | }) 127 | return data 128 | } -------------------------------------------------------------------------------- /jd_speed_3.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 极速版 3 | * cron: 35 10 * * * 4 | */ 5 | 6 | import {H5ST} from "./utils/h5st_pro" 7 | import {JDHelloWorld, User} from "./TS_JDHelloWorld"; 8 | 9 | class Speed_Sign extends JDHelloWorld { 10 | user: User 11 | h5stTool: H5ST 12 | fp: string 13 | 14 | constructor() { 15 | super(); 16 | } 17 | 18 | async init() { 19 | this.fp = await this.getFp() 20 | await this.run(this) 21 | } 22 | 23 | async api(fn: string, body: object) { 24 | let timestamp: number = Date.now() 25 | let h5st: string = await this.h5stTool.__genH5st({ 26 | appid: 'activities_platform', 27 | body: JSON.stringify({}), 28 | client: 'ios', 29 | clientVersion: '4.3.0', 30 | functionId: fn, 31 | t: timestamp.toString() 32 | }) 33 | return await this.get(`https://api.m.jd.com/?functionId=${fn}&body=${encodeURIComponent(JSON.stringify(body))}&t=${timestamp}&appid=activities_platform&client=ios&clientVersion=4.3.0&h5st=${h5st}`, 34 | { 35 | 'Host': 'api.m.jd.com', 36 | 'Origin': 'https://prodev.m.jd.com', 37 | 'User-Agent': this.user.UserAgent, 38 | 'Referer': 'https://prodev.m.jd.com/jdlite/active/31U4T6S4PbcK83HyLPioeCWrD63j/index.html', 39 | 'Cookie': this.user.cookie 40 | }) 41 | } 42 | 43 | async main(user: User) { 44 | this.user = user 45 | this.user.UserAgent = `jdltapp;iPhone;4.3.0;Mozilla/5.0 (iPhone; CPU iPhone OS ${this.getIosVer()} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1;` 46 | this.h5stTool = new H5ST("07244", this.user.UserAgent, this.fp, 'https://prodev.m.jd.com/jdlite/active/31U4T6S4PbcK83HyLPioeCWrD63j/index.html', 'https://prodev.m.jd.com', this.user.UserName); 47 | await this.h5stTool.__genAlgo() 48 | for (let i = 0; i < 3; i++) { 49 | let res: any = await this.api('spring_reward_receive', {"inviter": "", "linkId": "Eu7-E0CUzqYyhZJo9d3YkQ"}) 50 | try { 51 | console.log(res.data.received.prizeDesc, res.data.received.amount) 52 | } catch (e) { 53 | break 54 | } 55 | await this.wait(5000) 56 | } 57 | } 58 | } 59 | 60 | new Speed_Sign().init().then() -------------------------------------------------------------------------------- /jd_speed_monitor.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __generator = (this && this.__generator) || function (thisArg, body) { 12 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 13 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 14 | function verb(n) { return function (v) { return step([n, v]); }; } 15 | function step(op) { 16 | if (f) throw new TypeError("Generator is already executing."); 17 | while (g && (g = 0, op[0] && (_ = 0)), _) try { 18 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 19 | if (y = 0, t) op = [op[0] & 2, t.value]; 20 | switch (op[0]) { 21 | case 0: case 1: t = op; break; 22 | case 4: _.label++; return { value: op[1], done: false }; 23 | case 5: _.label++; y = op[1]; op = [0]; continue; 24 | case 7: op = _.ops.pop(); _.trys.pop(); continue; 25 | default: 26 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 27 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 28 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 29 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 30 | if (t[2]) _.ops.pop(); 31 | _.trys.pop(); continue; 32 | } 33 | op = body.call(thisArg, _); 34 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 35 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 36 | } 37 | }; 38 | exports.__esModule = true; 39 | var axios_1 = require("axios"); 40 | var sendNotify_1 = require("./sendNotify"); 41 | var TS_USER_AGENTS_1 = require("./TS_USER_AGENTS"); 42 | var CryptoJS = require('crypto-js'); 43 | var cookie = '', UserName; 44 | !(function () { return __awaiter(void 0, void 0, void 0, function () { 45 | var cookiesArr, t, fn, body, params, key, data, _i, _a, t_1; 46 | return __generator(this, function (_b) { 47 | switch (_b.label) { 48 | case 0: return [4 /*yield*/, (0, TS_USER_AGENTS_1.getCookie)()]; 49 | case 1: 50 | cookiesArr = _b.sent(); 51 | cookie = cookiesArr[Math.random() * cookiesArr.length | 0]; 52 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)[1]); 53 | console.log(" ".concat(UserName, "\n")); 54 | t = Date.now(), fn = 'MyAssetsService.execute', body = { "method": "goldShopPage", "data": { "channel": 1 } }; 55 | params = "lite-android&".concat(JSON.stringify(body), "&android&3.1.0&").concat(fn, "&").concat(t, "&846c4c32dae910ef"); 56 | key = CryptoJS.HmacSHA256(params, '12aea658f76e453faf803d15c40a72e0').toString(); 57 | return [4 /*yield*/, axios_1["default"].get("https://api.m.jd.com/api?functionId=".concat(fn, "&body=").concat(encodeURIComponent(JSON.stringify(body)), "&appid=lite-android&client=android&uuid=846c4c32dae910ef&clientVersion=3.1.0&t=").concat(t, "&sign=").concat(key), { 58 | headers: { 59 | 'Host': 'api.m.jd.com', 60 | 'accept': '*/*', 61 | 'kernelplatform': 'RN', 62 | 'user-agent': 'JDMobileLite/3.1.0 (iPad; iOS 14.4; Scale/2.00)', 63 | 'accept-language': 'zh-Hans-CN;q=1, ja-CN;q=0.9', 64 | 'Cookie': cookie 65 | } 66 | })]; 67 | case 2: 68 | data = (_b.sent()).data; 69 | _i = 0, _a = data.data.gears; 70 | _b.label = 3; 71 | case 3: 72 | if (!(_i < _a.length)) return [3 /*break*/, 6]; 73 | t_1 = _a[_i]; 74 | console.log(t_1.amount); 75 | if (!(t_1.amount === '50' || t_1.amount === '120')) return [3 /*break*/, 5]; 76 | return [4 /*yield*/, (0, sendNotify_1.sendNotify)('极速版金币', "".concat(t_1.amount, "\uD83E\uDDE7"))]; 77 | case 4: 78 | _b.sent(); 79 | return [3 /*break*/, 6]; 80 | case 5: 81 | _i++; 82 | return [3 /*break*/, 3]; 83 | case 6: return [2 /*return*/]; 84 | } 85 | }); 86 | }); })(); 87 | -------------------------------------------------------------------------------- /jd_speed_monitor.ts: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import {sendNotify} from './sendNotify'; 3 | import {getCookie} from './TS_USER_AGENTS' 4 | 5 | const CryptoJS = require('crypto-js'); 6 | let cookie: string = '', UserName: string 7 | 8 | !(async () => { 9 | let cookiesArr: string[] = await getCookie() 10 | cookie = cookiesArr[Math.random() * cookiesArr.length | 0] 11 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 12 | console.log(` ${UserName}\n`) 13 | 14 | let t: number = Date.now(), fn: string = 'MyAssetsService.execute', body: object = {"method": "goldShopPage", "data": {"channel": 1}} 15 | let params: string = `lite-android&${JSON.stringify(body)}&android&3.1.0&${fn}&${t}&846c4c32dae910ef` 16 | let key = CryptoJS.HmacSHA256(params, '12aea658f76e453faf803d15c40a72e0').toString() 17 | 18 | let {data} = await axios.get(`https://api.m.jd.com/api?functionId=${fn}&body=${encodeURIComponent(JSON.stringify(body))}&appid=lite-android&client=android&uuid=846c4c32dae910ef&clientVersion=3.1.0&t=${t}&sign=${key}`, { 19 | headers: { 20 | 'Host': 'api.m.jd.com', 21 | 'accept': '*/*', 22 | 'kernelplatform': 'RN', 23 | 'user-agent': 'JDMobileLite/3.1.0 (iPad; iOS 14.4; Scale/2.00)', 24 | 'accept-language': 'zh-Hans-CN;q=1, ja-CN;q=0.9', 25 | 'Cookie': cookie 26 | } 27 | }) 28 | 29 | for (let t of data.data.gears) { 30 | console.log(t.amount) 31 | if (t.amount === '50' || t.amount === '120') { 32 | await sendNotify('极速版金币', `${t.amount}🧧`) 33 | break 34 | } 35 | } 36 | })() 37 | -------------------------------------------------------------------------------- /jd_speed_sign.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 极速版-签到+提现 3 | * cron: 45 0 * * * 4 | * export FP_15097="" 5 | */ 6 | 7 | import {H5ST} from "./utils/h5st_pro" 8 | import {JDHelloWorld, User} from "./TS_JDHelloWorld"; 9 | 10 | class Speed_Sign extends JDHelloWorld { 11 | user: User 12 | h5stTool: H5ST 13 | fp: string 14 | 15 | constructor() { 16 | super(); 17 | } 18 | 19 | async init() { 20 | this.fp = process.env.FP_15097 || await this.getFp() 21 | await this.run(this) 22 | } 23 | 24 | async api(fn: string, body: object) { 25 | let timestamp: number = Date.now() 26 | let h5st: string = await this.h5stTool.__genH5st({ 27 | appid: 'activities_platform', 28 | body: JSON.stringify(body), 29 | client: 'H5', 30 | clientVersion: '1.0.0', 31 | functionId: fn, 32 | t: timestamp.toString() 33 | }) 34 | return await this.post('https://api.m.jd.com/', `functionId=${fn}&body=${JSON.stringify(body)}&t=${timestamp}&appid=activities_platform&client=H5&clientVersion=1.0.0&h5st=${h5st}`, { 35 | 'Host': 'api.m.jd.com', 36 | 'Cookie': this.user.cookie, 37 | 'accept': 'application/json, text/plain, */*', 38 | 'content-type': 'application/x-www-form-urlencoded', 39 | 'origin': 'https://daily-redpacket.jd.com', 40 | 'user-agent': this.user.UserAgent, 41 | 'referer': 'https://daily-redpacket.jd.com/' 42 | }) 43 | } 44 | 45 | async main(user: User) { 46 | this.user = user 47 | this.user.UserAgent = `jdltapp;iPhone;3.9.2;Mozilla/5.0 (iPhone; CPU iPhone OS ${this.getIosVer()} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1;` 48 | this.h5stTool = new H5ST("15097", this.user.UserAgent, this.fp, 'https://daily-redpacket.jd.com/?activityId=9WA12jYGulArzWS7vcrwhw', 'https://daily-redpacket.jd.com', this.user.UserName); 49 | await this.h5stTool.__genAlgo() 50 | let res: any = await this.api('apSignIn_day', {"linkId": "9WA12jYGulArzWS7vcrwhw", "serviceName": "dayDaySignGetRedEnvelopeSignService", "business": 1}) 51 | try { 52 | if (res.data.retCode === 0) { 53 | console.log('签到成功') 54 | } else { 55 | console.log(res.data.retMessage) 56 | } 57 | await this.wait(2000) 58 | 59 | res = await this.api('signPrizeDetailList', {"linkId": "9WA12jYGulArzWS7vcrwhw", "serviceName": "dayDaySignGetRedEnvelopeSignService", "business": 1, "pageSize": 20, "page": 1}) 60 | for (let t of res.data.prizeDrawBaseVoPageBean.items) { 61 | if (t.prizeType === 4 && t.prizeStatus === 0) { 62 | res = await this.api('apCashWithDraw', {"linkId": "9WA12jYGulArzWS7vcrwhw", "businessSource": "DAY_DAY_RED_PACKET_SIGN", "base": {"prizeType": t.prizeType, "business": t.business, "id": t.id, "poolBaseId": t.poolBaseId, "prizeGroupId": t.prizeGroupId, "prizeBaseId": t.prizeBaseId}}) 63 | console.log(parseFloat(t.prizeValue), res.data.message) 64 | await this.wait(2000) 65 | } 66 | } 67 | } catch (e) { 68 | console.log('error', e) 69 | } 70 | } 71 | } 72 | 73 | new Speed_Sign().init().then() -------------------------------------------------------------------------------- /jd_speed_wabao.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 极速版-挖宝 3 | * cron: 2 0,1,6 * * * 4 | * export FP_8DD95="" 5 | * CK1 优先助力 HW.ts 6 | */ 7 | 8 | import {User, JDHelloWorld} from "./TS_JDHelloWorld" 9 | import {H5ST} from "./utils/h5st_pro"; 10 | 11 | interface INVITE { 12 | inviter: string, 13 | inviteCode: string 14 | } 15 | 16 | class Jd_speed_wabao extends JDHelloWorld { 17 | user: User 18 | h5stTool: H5ST 19 | sharecode: INVITE[] = [] 20 | shareCodesSelf: INVITE[] = [] 21 | 22 | constructor() { 23 | super(); 24 | } 25 | 26 | async init() { 27 | await this.run(this) 28 | } 29 | 30 | async api(fn: string, body: object) { 31 | let timestamp: number = Date.now() 32 | let h5st: string = await this.h5stTool.__genH5st({ 33 | appid: 'activities_platform', 34 | body: JSON.stringify(body), 35 | client: 'ios', 36 | clientVersion: '3.9.2', 37 | functionId: fn, 38 | t: timestamp.toString(), 39 | }) 40 | return await this.get(`https://api.m.jd.com/?functionId=${fn}&body=${encodeURIComponent(JSON.stringify(body))}&t=${timestamp}&appid=activities_platform&client=ios&clientVersion=3.9.2&h5st=${h5st}`, { 41 | 'authority': 'api.m.jd.com', 42 | 'origin': 'https://bnzf.jd.com', 43 | 'referer': 'https://bnzf.jd.com/', 44 | 'user-agent': this.user.UserAgent, 45 | 'cookie': this.user.cookie 46 | }) 47 | } 48 | 49 | async main(user: User) { 50 | let fp: any = process.env.FP_8DD95 || await this.getFp() 51 | this.user = user 52 | this.user.UserAgent = `jdltapp;iPhone;3.9.2;Mozilla/5.0 (iPhone; CPU iPhone OS ${this.getIosVer()} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1;` 53 | this.h5stTool = new H5ST("8dd95", this.user.UserAgent, fp, 'https://bnzf.jd.com/?activityId=pTTvJeSTrpthgk9ASBVGsw', 'https://bnzf.jd.com', this.user.UserName) 54 | await this.h5stTool.__genAlgo() 55 | 56 | let res: any, data: any 57 | try { 58 | res = await this.api('happyDigHome', {"linkId": "pTTvJeSTrpthgk9ASBVGsw"}) 59 | console.log('助力码', res.data.markedPin, res.data.inviteCode) 60 | this.shareCodesSelf.push({inviter: res.data.markedPin, inviteCode: res.data.inviteCode}) 61 | 62 | res = await this.api('apTaskList', {"linkId": "pTTvJeSTrpthgk9ASBVGsw"}) 63 | await this.wait(1000) 64 | for (let t of res.data) { 65 | if (t.taskType === 'BROWSE_CHANNEL' && t.taskDoTimes === 0 && t.taskLimitTimes === 1) { 66 | console.log(t.taskShowTitle) 67 | data = await this.api('apDoTask', {"linkId": "pTTvJeSTrpthgk9ASBVGsw", "taskType": "BROWSE_CHANNEL", "taskId": t.id, "channel": 4, "itemId": encodeURIComponent(t.taskSourceUrl), "checkVersion": false}) 68 | await this.wait(1000) 69 | if (data.success) { 70 | console.log('任务完成') 71 | } else { 72 | this.o2s(data, '任务失败') 73 | } 74 | } 75 | } 76 | } catch (e) { 77 | console.log('error', e) 78 | } 79 | } 80 | 81 | async help(users: User[]) { 82 | console.log('内部助力') 83 | this.o2s(this.shareCodesSelf) 84 | let res: any, shareCodesHW: any = [], shareCodes: any 85 | for (let user of users) { 86 | this.user = user 87 | this.user.UserAgent = `jdltapp;iPhone;3.9.2;Mozilla/5.0 (iPhone; CPU iPhone OS ${this.getIosVer()} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1;` 88 | console.log(`\n开始【京东账号${user.index + 1}】${user.UserName}\n`) 89 | 90 | try { 91 | if (shareCodesHW.length === 0) { 92 | shareCodesHW = await this.getshareCodeHW('fcwb') 93 | } 94 | if (user.index === 0) { 95 | shareCodes = [...shareCodesHW, ...this.shareCodesSelf] 96 | } else { 97 | shareCodes = [...this.shareCodesSelf, ...shareCodesHW] 98 | } 99 | let fp: any = process.env.FP_8DD95 || await this.getFp() 100 | for (let code of shareCodes) { 101 | console.log(`账号${user.index + 1} ${user.UserName} 去助力 ${code.inviteCode}`) 102 | this.h5stTool = new H5ST("8dd95", this.user.UserAgent, fp, `https://bnzf.jd.com/?activityId=pTTvJeSTrpthgk9ASBVGsw&inviterId=${code.inviter}&inviterCode=${code.inviteCode}&utm_source=iosapp&utm_medium=liteshare&utm_campaign=&utm_term=Qqfriends&ad_od=share`, 'https://bnzf.jd.com', user.UserName) 103 | await this.h5stTool.__genAlgo() 104 | res = await this.api('happyDigHelp', {"linkId": "pTTvJeSTrpthgk9ASBVGsw", "inviter": code.inviter, "inviteCode": code.inviteCode}) 105 | if (res.code === 0) { 106 | console.log('助力成功') 107 | await this.wait(4000) 108 | break 109 | } else if (res.code === 16144) { 110 | console.log('上限') 111 | await this.wait(4000) 112 | break 113 | } else { 114 | console.log(res.code, res.errMsg) 115 | await this.wait(4000) 116 | } 117 | } 118 | } catch (e) { 119 | console.log('error', e) 120 | } 121 | } 122 | } 123 | } 124 | 125 | new Jd_speed_wabao().init().then() -------------------------------------------------------------------------------- /jd_track.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 京东快递更新通知 3 | * cron: 0 0-23/4 * * * 4 | */ 5 | 6 | import * as path from "path" 7 | import {sendNotify} from './sendNotify' 8 | import {existsSync, mkdirSync, readFileSync, writeFileSync} from "fs" 9 | import USER_AGENT, {get, getCookie, exceptCookie, wait, o2s} from "./TS_USER_AGENTS" 10 | import {pushplus} from "./utils/pushplus"; 11 | 12 | let cookie: string = '', UserName: string, allMessage: string = '', res: any = '' 13 | 14 | !(async () => { 15 | let cookiesArr: string[] = await getCookie() 16 | let except: string[] = exceptCookie(path.basename(__filename)) 17 | let orders: any = {}, pushplusArr: { pt_pin: string, pushplus: string }[], pushplusUser: string[] = [] 18 | try { 19 | pushplusArr = JSON.parse(readFileSync('./utils/account.json').toString()) 20 | } catch (e) { 21 | console.log('utils/account.json load failed') 22 | } 23 | for (let user of pushplusArr) { 24 | if (user.pushplus) 25 | pushplusUser.push(decodeURIComponent(user.pt_pin)) 26 | } 27 | if (existsSync('./json')) { 28 | if (existsSync('./json/jd_track.json')) { 29 | orders = JSON.parse(readFileSync('./json/jd_track.json').toString() || '{}') 30 | } else { 31 | writeFileSync('./json/jd_track.json', '{}') 32 | } 33 | } else { 34 | mkdirSync('./json') 35 | writeFileSync('./json/jd_track.json', '{}') 36 | } 37 | for (let [index, value] of cookiesArr.entries()) { 38 | cookie = value 39 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 40 | console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 41 | 42 | if (except.includes(encodeURIComponent(UserName))) { 43 | console.log('已设置跳过') 44 | continue 45 | } 46 | 47 | let message: string = '', markdown: string = '', i: number = 1 48 | 49 | let headers: object = { 50 | 'authority': 'wq.jd.com', 51 | 'user-agent': USER_AGENT, 52 | 'referer': 'https://wqs.jd.com/', 53 | 'cookie': cookie 54 | } 55 | try { 56 | res = await get(`https://wq.jd.com/bases/orderlist/list?order_type=2&start_page=1&last_page=0&page_size=10&callersource=mainorder&t=${Date.now()}&sceneval=2&_=${Date.now()}&sceneval=2`, headers) 57 | await wait(1000) 58 | 59 | for (let order of res.orderList) { 60 | let orderId: string = order.orderId 61 | let orderType: string = order.orderType 62 | let title: string = order.productList[0].title 63 | let t: string = order.progressInfo?.tip || null 64 | let status: string = order.progressInfo?.content || null 65 | let shopName: string = order.shopInfo.shopName 66 | 67 | res = await get(`https://wq.jd.com/bases/wuliudetail/dealloglist?deal_id=${orderId}&orderstate=15&ordertype=${orderType}&t=${Date.now()}&sceneval=2`, headers) 68 | await wait(1000) 69 | let carrier: string = res.carrier, carriageId: string = res.carriageId 70 | 71 | if (t && status) { 72 | if (status.match(/(?=签收|已取走|已暂存)/)) 73 | continue 74 | if (!pushplusUser.includes(UserName)) { 75 | console.log(`<${shopName}>\t${title}`) 76 | console.log('\t', t, status) 77 | console.log() 78 | } else { 79 | console.log('隐私保护,不显示日志') 80 | } 81 | if (!Object.keys(orders).includes(orderId) || orders[orderId]['status'] !== status) { 82 | if (pushplusUser.includes(UserName)) { 83 | console.log('+ pushplus') 84 | markdown += `${i++}. ${title}\n\t- ${carrier} ${carriageId}\n\t- ${t} ${status}\n` 85 | } else { 86 | console.log('+ sendNotify') 87 | message += `<${shopName}>\t${title}\n${carrier} ${carriageId}\n${t} ${status}\n\n` 88 | } 89 | } 90 | orders[orderId] = { 91 | user: UserName, shopName, title, t, status, carrier, carriageId 92 | } 93 | } 94 | } 95 | 96 | if (message) { 97 | message = `【京东账号${index + 1}】 ${UserName}\n\n${message}` 98 | allMessage += message 99 | } 100 | if (markdown) { 101 | markdown = `#### <${UserName}>\n${markdown}` 102 | await pushplus('京东快递更新', markdown, 'markdown') 103 | } 104 | await wait(1000) 105 | } catch (e) { 106 | } 107 | } 108 | 109 | let account: { pt_pin: string, remarks: string }[] = [] 110 | try { 111 | account = JSON.parse(readFileSync('./utils/account.json').toString()) 112 | } catch (e) { 113 | console.log('utils/account.json load failed') 114 | } 115 | 116 | // 删除已签收 117 | Object.keys(orders).map(key => { 118 | if (orders[key].status.match(/(?=签收|已取走|已暂存)/)) { 119 | delete orders[key] 120 | } 121 | if (pushplusUser.includes(orders[key].user)) { 122 | orders[key].title = '******' 123 | } 124 | }) 125 | 126 | // 替换通知中的用户名为备注 127 | orders = JSON.stringify(orders, null, 2) 128 | for (let acc of account) { 129 | orders = orders.replace(new RegExp(decodeURIComponent(acc.pt_pin), 'g'), acc.remarks ?? acc.pt_pin) 130 | } 131 | writeFileSync('./json/jd_track.json', orders) 132 | if (allMessage) 133 | await sendNotify('京东快递更新', allMessage) 134 | })() 135 | -------------------------------------------------------------------------------- /jd_unsubscribe.ts: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import {getCookie, wait, o2s, randomWord} from './TS_USER_AGENTS' 3 | 4 | let cookie: string = '', UserName: string = '', res: any = '' 5 | 6 | !(async () => { 7 | let cookiesArr: string[] = await getCookie() 8 | for (let [index, value] of cookiesArr.entries()) { 9 | cookie = value 10 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 11 | console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 12 | 13 | res = await api('FavCommQueryFilter') 14 | let commId: string = '' 15 | console.log('当前关注商品:', parseInt(res.totalNum)) 16 | res.data.map((item: { commId: string }) => { 17 | commId += item.commId + ',' 18 | }) 19 | commId = commId.slice(0, -1) 20 | await wait(1000) 21 | 22 | if (commId) { 23 | res = await api('FavCommBatchDel', commId) 24 | if (res.iRet === '0') { 25 | console.log('取关', commId.split(',').length, '个商品成功') 26 | } else { 27 | console.log('取关失败', res.errMsg) 28 | } 29 | } 30 | 31 | await wait(2000) 32 | res = await api('QueryShopFavList') 33 | console.log('当前关注店铺:', parseInt(res.totalNum)) 34 | await wait(1000) 35 | commId = '' 36 | res.data.map((item: { shopId: string }) => { 37 | commId += item.shopId + ',' 38 | }) 39 | commId = commId.slice(0, -1) 40 | if (commId) { 41 | res = await api('batchunfollow', commId) 42 | if (res.iRet === '0') { 43 | console.log('取关', commId.split(',').length, '个店铺成功') 44 | } else { 45 | console.log('取关失败', res.errMsg) 46 | } 47 | } 48 | } 49 | })() 50 | 51 | async function api(fn: string, params: string = '') { 52 | let url: string, u = `_=${Date.now()}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls` 53 | if (fn === 'FavCommQueryFilter') 54 | url = `https://wq.jd.com/fav/comm/FavCommQueryFilter?cp=1&pageSize=10&category=0&promote=0&cutPrice=0&coupon=0&stock=0${u}` 55 | else if (fn === 'FavCommBatchDel') 56 | url = `https://wq.jd.com/fav/comm/FavCommBatchDel?commId=${params}${u}` 57 | else if (fn === 'QueryShopFavList') 58 | url = `https://wq.jd.com/fav/shop/QueryShopFavList?cp=1&pageSize=10&lastlogintime=0${u}` 59 | else 60 | url = `https://wq.jd.com/fav/shop/batchunfollow?shopId=${params}${u}` 61 | 62 | let {data} = await axios.get(url, { 63 | headers: { 64 | 'authority': 'wq.jd.com', 65 | 'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1', 66 | 'referer': 'https://wqs.jd.com/', 67 | 'accept-language': 'zh-CN,zh;q=0.9', 68 | 'cookie': cookie 69 | } 70 | }) 71 | return JSON.parse(data.match(/jsonpCBK.?\(([\w\W]*)\);/)[1]) 72 | } -------------------------------------------------------------------------------- /jd_wechat_sign.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 微信小程序签到红包 3 | * FP_9A38A 4 | * cron: 8 10 * * * 5 | */ 6 | 7 | import {H5ST} from "./utils/h5st_pro" 8 | import {User, JDHelloWorld} from "./TS_JDHelloWorld"; 9 | 10 | class Jd_wechat_sign extends JDHelloWorld { 11 | user: User 12 | h5stTool: H5ST 13 | fp: string 14 | 15 | constructor() { 16 | super("微信签到"); 17 | } 18 | 19 | async init() { 20 | try { 21 | this.fp = process.env.FP_9A38A ?? await this.getFp() 22 | } catch (e) { 23 | console.log('FP Error: ', e.message) 24 | process.exit(0) 25 | } 26 | await this.run(this) 27 | } 28 | 29 | async task(fn: string, body: object, signComponent: string) { 30 | let h5st: string = await this.h5stTool.__genH5st({ 31 | appid: "hot_channel", 32 | body: JSON.stringify(body), 33 | client: "android", 34 | clientVersion: "7.22.240", 35 | functionId: signComponent, 36 | }) 37 | return await this.post(`https://api.m.jd.com/scanTask/${fn}`, `client=android&clientVersion=7.22.240&functionId=${signComponent}&appid=hot_channel&body=${encodeURIComponent(JSON.stringify(body))}&h5st=${h5st}`, { 38 | 'Host': 'api.m.jd.com', 39 | 'wqreferer': 'http://wq.jd.com/wxapp/pages/market/market2/index', 40 | 'User-Agent': this.user.UserAgent, 41 | 'Referer': 'https://servicewechat.com/wx91d27dbf599dff74/664/page-frame.html', 42 | 'Cookie': this.user.cookie 43 | }) 44 | } 45 | 46 | async main(user: User) { 47 | try { 48 | this.user = user 49 | this.user.UserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS ${this.getIosVer()} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.28(0x18001c2b) NetType/WIFI Language/zh_CN` 50 | let res: any, data: any 51 | 52 | this.h5stTool = new H5ST("9a38a", this.user.UserAgent, this.fp, 'http://wq.jd.com/wxapp/pages/market/market2/index', 'http://wq.jd.com', this.user.UserName); 53 | await this.h5stTool.__genAlgo() 54 | res = await this.task('doSignTask', {"activityId": "10004", "version": 1}, 'SignComponent_doSignTask') 55 | res.success ? console.log('签到奖励', res.data.rewardList[0].discount) : console.log(res.message) 56 | 57 | this.h5stTool = new H5ST("2b5bc", this.user.UserAgent, this.fp, 'http://wq.jd.com/wxapp/pages/market/market2/index', 'http://wq.jd.com', this.user.UserName); 58 | await this.h5stTool.__genAlgo() 59 | res = await this.task('querySignList', {"activityId": "10004", "version": 1}, 'SignComponent_querySignList') 60 | if (!res.data.scanTaskInfo.completionFlag) { 61 | data = await this.task('startScanTask', {"itemId": res.data.scanTaskInfo.itemId, "activityId": "10004", "scanAssignmentId": res.data.scanTaskInfo.scanAssignmentId, "actionType": 1, "version": 1}, 'SignComponent_doScanTask') 62 | console.log('开始任务', data.message || res.success) 63 | await this.wait(8000) 64 | data = await this.task('startScanTask', {"activityId": "10004", "actionType": 0, "scanAssignmentId": res.data.scanTaskInfo.scanAssignmentId, "itemId": res.data.scanTaskInfo.itemId, "version": 1}, 'SignComponent_doScanTask') 65 | console.log('领取奖励', data.data.rewardList[0].discount) 66 | } 67 | } catch (e) { 68 | console.log(e.message) 69 | } 70 | } 71 | } 72 | 73 | new Jd_wechat_sign().init().then() -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jd", 3 | "version": "1.0.0", 4 | "description": "{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}", 5 | "main": "AlipayManor.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "" 12 | }, 13 | "keywords": [ 14 | "JD" 15 | ], 16 | "author": "", 17 | "license": "ISC", 18 | "dependencies": { 19 | "axios": "^0.21.4", 20 | "commander": "^9.4.1", 21 | "console-grid": "^2.0.1", 22 | "crypto-js": "^4.1.1", 23 | "date-fns": "^2.29.3", 24 | "dotenv": "^16.0.3", 25 | "download": "^8.0.0", 26 | "form-data": "^4.0.0", 27 | "got": "^11.8.3", 28 | "http-server": "^14.1.1", 29 | "jsdom": "^20.0.3", 30 | "md5": "^2.3.0", 31 | "png-js": "^1.0.0", 32 | "prettytable": "^0.3.1", 33 | "qrcode-terminal": "^0.12.0", 34 | "request": "^2.88.2", 35 | "tough-cookie": "^4.1.2", 36 | "ts-md5": "^1.3.1", 37 | "tslib": "^2.4.1", 38 | "tunnel": "0.0.6", 39 | "uglify-js": "^3.17.4", 40 | "ws": "^8.11.0" 41 | }, 42 | "devDependencies": { 43 | "@types/express": "^4.17.14", 44 | "@types/node": "^18.11.10", 45 | "express": "^4.18.2", 46 | "gulp": "^4.0.2", 47 | "gulp-typescript": "^6.0.0-alpha.1", 48 | "ts-node": "^10.9.1", 49 | "typescript": "^4.9.3" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /reset.sh: -------------------------------------------------------------------------------- 1 | git reset --hard $1 2 | git push origin HEAD --force 3 | -------------------------------------------------------------------------------- /thread.py: -------------------------------------------------------------------------------- 1 | import threading 2 | import os 3 | import re 4 | import sys 5 | from urllib.parse import quote 6 | 7 | cookies = [] 8 | 9 | 10 | def get_cookies(): 11 | if not os.path.exists('./test/logs'): 12 | os.makedirs('./test/logs') 13 | with open("jdCookie.js", 'r') as f: 14 | txt = f.read() 15 | for cookie in re.findall("(.*['\"]pt_key[^'|\"]*)", txt): 16 | if '//' not in cookie: 17 | cookie = re.search(r"(pt_key.*)", cookie).group(0) 18 | cookies.append(cookie) 19 | print(len(cookies), cookies) 20 | 21 | 22 | def main(ck, index): 23 | filename = sys.argv[1] 24 | for file in os.listdir('./'): 25 | if filename in file: 26 | filename = file 27 | if '.ts' in filename: 28 | program = "ts-node" 29 | elif '.js' in filename: 30 | program = "node" 31 | else: 32 | program = "node" 33 | with open(f"./test/logs/{filename.split('.')[0]}-{index}.log", 'w') as f: 34 | f.truncate(0) 35 | os.system(f"{program} {filename} {quote(ck)} >> ./test/logs/{filename.split('.')[0]}-{index}.log &") 36 | print('done') 37 | 38 | 39 | if __name__ == '__main__': 40 | print('tread.py', sys.argv) 41 | get_cookies() 42 | for i in range(len(cookies)): 43 | threading.Thread(target=main, args=(cookies[i], i)).start() 44 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "downlevelIteration": true 4 | } 5 | } -------------------------------------------------------------------------------- /utils/V3.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __generator = (this && this.__generator) || function (thisArg, body) { 12 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 13 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 14 | function verb(n) { return function (v) { return step([n, v]); }; } 15 | function step(op) { 16 | if (f) throw new TypeError("Generator is already executing."); 17 | while (g && (g = 0, op[0] && (_ = 0)), _) try { 18 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 19 | if (y = 0, t) op = [op[0] & 2, t.value]; 20 | switch (op[0]) { 21 | case 0: case 1: t = op; break; 22 | case 4: _.label++; return { value: op[1], done: false }; 23 | case 5: _.label++; y = op[1]; op = [0]; continue; 24 | case 7: op = _.ops.pop(); _.trys.pop(); continue; 25 | default: 26 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 27 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 28 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 29 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 30 | if (t[2]) _.ops.pop(); 31 | _.trys.pop(); continue; 32 | } 33 | op = body.call(thisArg, _); 34 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 35 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 36 | } 37 | }; 38 | exports.__esModule = true; 39 | exports.geth5st = exports.requestAlgo = void 0; 40 | var axios_1 = require("axios"); 41 | var date_fns_1 = require("date-fns"); 42 | var CryptoJS = require('crypto-js'); 43 | var fp = '', tk = '', genKey = null; 44 | function requestAlgo(appId, USER_AGENT) { 45 | if (USER_AGENT === void 0) { USER_AGENT = 'jdpingou;'; } 46 | return __awaiter(this, void 0, void 0, function () { 47 | function generateFp() { 48 | var e = "0123456789"; 49 | var a = 13; 50 | var i = ''; 51 | for (; a--;) 52 | i += e[Math.random() * e.length | 0]; 53 | return (i + Date.now()).slice(0, 16); 54 | } 55 | var data; 56 | return __generator(this, function (_a) { 57 | switch (_a.label) { 58 | case 0: 59 | fp = generateFp(); 60 | return [4 /*yield*/, axios_1["default"].post("https://cactus.jd.com/request_algo?g_ty=ajax", "{\"version\":\"3.0\",\"fp\":\"".concat(fp, "\",\"appId\":\"").concat(appId, "\",\"timestamp\":").concat(Date.now(), ",\"platform\":\"web\",\"expandParams\":\"\"}"), { 61 | headers: { 62 | 'Accept': 'application/json', 63 | 'Content-Type': 'application/json', 64 | "Accept-Encoding": "gzip, deflate, br", 65 | "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8", 66 | 'host': 'cactus.jd.com', 67 | 'Referer': 'https://cactus.jd.com', 68 | 'User-Agent': USER_AGENT 69 | } 70 | })]; 71 | case 1: 72 | data = (_a.sent()).data; 73 | tk = data.data.result.tk; 74 | genKey = new Function("return ".concat(data.data.result.algo))(); 75 | return [2 /*return*/, { fp: fp, tk: tk, genKey: genKey }]; 76 | } 77 | }); 78 | }); 79 | } 80 | exports.requestAlgo = requestAlgo; 81 | function geth5st(t, appId) { 82 | var a = ''; 83 | t.forEach(function (_a) { 84 | var key = _a.key, value = _a.value; 85 | a += "".concat(key, ":").concat(value, "&"); 86 | }); 87 | a = a.slice(0, -1); 88 | var time = Date.now(); 89 | var timestamp = (0, date_fns_1.format)(time, "yyyyMMddHHmmssSSS"); 90 | var hash1 = genKey(tk, fp.toString(), timestamp.toString(), appId.toString(), CryptoJS).toString(CryptoJS.enc.Hex); 91 | var hash2 = CryptoJS.HmacSHA256(a, hash1).toString(); 92 | return encodeURIComponent(["".concat(timestamp.toString()), "".concat(fp.toString()), "".concat(appId.toString()), "".concat(tk), "".concat(hash2), "3.0", "".concat(time.toString())].join(";")); 93 | } 94 | exports.geth5st = geth5st; 95 | -------------------------------------------------------------------------------- /utils/V3.ts: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import {format} from "date-fns"; 3 | 4 | const CryptoJS = require('crypto-js') 5 | 6 | let fp: string = '', tk: string = '', genKey: any = null 7 | 8 | async function requestAlgo(appId: string, USER_AGENT: string = 'jdpingou;') { 9 | function generateFp() { 10 | let e = "0123456789"; 11 | let a = 13; 12 | let i = ''; 13 | for (; a--;) 14 | i += e[Math.random() * e.length | 0]; 15 | return (i + Date.now()).slice(0, 16) 16 | } 17 | 18 | fp = generateFp() 19 | let {data} = await axios.post(`https://cactus.jd.com/request_algo?g_ty=ajax`, `{"version":"3.0","fp":"${fp}","appId":"${appId}","timestamp":${Date.now()},"platform":"web","expandParams":""}`, { 20 | headers: { 21 | 'Accept': 'application/json', 22 | 'Content-Type': 'application/json', 23 | "Accept-Encoding": "gzip, deflate, br", 24 | "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8", 25 | 'host': 'cactus.jd.com', 26 | 'Referer': 'https://cactus.jd.com', 27 | 'User-Agent': USER_AGENT 28 | } 29 | }) 30 | tk = data.data.result.tk; 31 | genKey = new Function(`return ${data.data.result.algo}`)(); 32 | return {fp, tk, genKey} 33 | } 34 | 35 | function geth5st(t: { key: string, value: string } [], appId: string) { 36 | let a = '' 37 | t.forEach(({key, value}) => { 38 | a += `${key}:${value}&` 39 | }) 40 | a = a.slice(0, -1) 41 | let time = Date.now() 42 | let timestamp = format(time, "yyyyMMddHHmmssSSS"); 43 | let hash1 = genKey(tk, fp.toString(), timestamp.toString(), appId.toString(), CryptoJS).toString(CryptoJS.enc.Hex); 44 | const hash2 = CryptoJS.HmacSHA256(a, hash1).toString(); 45 | return encodeURIComponent(["".concat(timestamp.toString()), "".concat(fp.toString()), "".concat(appId.toString()), "".concat(tk), "".concat(hash2), "3.0", "".concat(time.toString())].join(";")) 46 | } 47 | 48 | export { 49 | requestAlgo, 50 | geth5st, 51 | } -------------------------------------------------------------------------------- /utils/account_demo.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "pt_pin": "与jdCookie中pt_pin相同,禁止出现中文", 4 | "remarks": "备注", 5 | "pushplus": "", 6 | "jdpingou": "jdpingou;", 7 | "joy_park_run": 0.04 8 | }, 9 | { 10 | "pt_pin": "jd_xxxx", 11 | "joy_park_run": 0.08 12 | } 13 | ] -------------------------------------------------------------------------------- /utils/empty.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /utils/exceptCookie.json: -------------------------------------------------------------------------------- 1 | { 2 | "jd_88hb.ts": [ 3 | "jd_xxxxx" 4 | ], 5 | "jd_jxgc.ts": [ 6 | "%E7%A4%BA%E4%BE%8B%E8%B4%A6%E5%8F%B7" 7 | ] 8 | } -------------------------------------------------------------------------------- /utils/h5st.ts: -------------------------------------------------------------------------------- 1 | import axios from "axios" 2 | import {format} from "date-fns" 3 | import * as CryptoJS from 'crypto-js' 4 | 5 | class H5ST { 6 | tk: string; 7 | timestamp: string; 8 | rd: string; 9 | appId: string; 10 | fp: string; 11 | time: number; 12 | ua: string 13 | enc: string; 14 | 15 | constructor(appId: string, ua: string, fp: string) { 16 | this.appId = appId 17 | this.ua = ua 18 | this.fp = fp || this.__genFp() 19 | } 20 | 21 | __genFp() { 22 | let e = "0123456789"; 23 | let a = 13; 24 | let i = ''; 25 | for (; a--;) 26 | i += e[Math.random() * e.length | 0]; 27 | return (i + Date.now()).slice(0, 16) 28 | } 29 | 30 | async __genAlgo() { 31 | this.time = Date.now() 32 | this.timestamp = format(this.time, "yyyyMMddHHmmssSSS") 33 | let {data} = await axios.post(`https://cactus.jd.com/request_algo?g_ty=ajax`, { 34 | 'version': '3.0', 35 | 'fp': this.fp, 36 | 'appId': this.appId.toString(), 37 | 'timestamp': this.time, 38 | 'platform': 'web', 39 | 'expandParams': '' 40 | }, { 41 | headers: { 42 | 'Host': 'cactus.jd.com', 43 | 'accept': 'application/json', 44 | 'content-type': 'application/json', 45 | 'user-agent': this.ua, 46 | } 47 | }) 48 | this.tk = data.data.result.tk 49 | this.rd = data.data.result.algo.match(/rd='(.*)'/)[1] 50 | this.enc = data.data.result.algo.match(/algo\.(.*)\(/)[1] 51 | } 52 | 53 | __genKey(tk: string, fp: string, ts: string, ai: string, algo: object) { 54 | let str = `${tk}${fp}${ts}${ai}${this.rd}`; 55 | return algo[this.enc](str, tk) 56 | } 57 | 58 | __genH5st(body: object) { 59 | let y = this.__genKey(this.tk, this.fp, this.timestamp, this.appId, CryptoJS).toString(CryptoJS.enc.Hex) 60 | let s = '' 61 | for (let key of Object.keys(body)) { 62 | key === 'body' ? s += `${key}:${CryptoJS.SHA256(body[key]).toString(CryptoJS.enc.Hex)}&` : s += `${key}:${body[key]}&` 63 | } 64 | s = s.slice(0, -1) 65 | s = CryptoJS.HmacSHA256(s, y).toString(CryptoJS.enc.Hex) 66 | return encodeURIComponent(`${this.timestamp};${this.fp};${this.appId.toString()};${this.tk};${s};3.0;${this.time.toString()}`) 67 | } 68 | } 69 | 70 | export { 71 | H5ST 72 | } 73 | -------------------------------------------------------------------------------- /utils/h5st_pro.ts: -------------------------------------------------------------------------------- 1 | import axios from "axios" 2 | import {format} from "date-fns" 3 | import * as CryptoJS from 'crypto-js' 4 | 5 | class H5ST { 6 | tk: string 7 | timestamp: string 8 | rd: string 9 | appId: string 10 | fp: string 11 | time: number 12 | ua: string 13 | enc: string 14 | url: string 15 | og: string 16 | pin: string 17 | iosVer: string 18 | api: string 19 | 20 | constructor(appId: string, ua: string, fp: string, url: string, og: string, pin?: string) { 21 | this.appId = appId 22 | this.ua = ua 23 | this.iosVer = ua.match(/iPhone OS (\d{2}_\d)/)[1] 24 | this.fp = fp 25 | this.url = url 26 | this.og = og 27 | this.pin = pin || '' 28 | this.api = 'https://sharecodepool.cnmb.win/api' 29 | } 30 | 31 | async __genAlgo() { 32 | this.time = Date.now() 33 | this.timestamp = format(this.time, "yyyyMMddHHmmssSSS") 34 | let {data: expandParams} = await axios.post(`${this.api}/expandParams`, { 35 | iosVer: this.iosVer, 36 | ua: this.ua, 37 | pin: this.pin, 38 | url: this.url, 39 | og: this.og, 40 | appId: this.appId, 41 | fp: this.fp 42 | }) 43 | let {data: algo} = await axios.post(`https://cactus.jd.com/request_algo?g_ty=ajax`, { 44 | 'version': '3.1', 45 | 'fp': this.fp, 46 | 'appId': this.appId.toString(), 47 | 'timestamp': this.time, 48 | 'platform': 'web', 49 | 'expandParams': expandParams 50 | }, { 51 | headers: { 52 | 'authority': 'cactus.jd.com', 53 | 'accept': 'application/json', 54 | 'content-type': 'application/json', 55 | 'origin': this.og, 56 | 'referer': this.og, 57 | 'user-agent': this.ua 58 | } 59 | }) 60 | this.tk = algo.data.result.tk 61 | this.rd = algo.data.result.algo.match(/rd='(.*)'/)[1] 62 | this.enc = algo.data.result.algo.match(/algo\.(.*)\(/)[1] 63 | } 64 | 65 | __genKey(tk: string, fp: string, ts: string, ai: string, algo: object) { 66 | let str = `${tk}${fp}${ts}${ai}${this.rd}` 67 | return algo[this.enc](str, tk) 68 | } 69 | 70 | async __genH5st(body: object) { 71 | let y = this.__genKey(this.tk, this.fp, this.timestamp, this.appId, CryptoJS).toString(CryptoJS.enc.Hex) 72 | let s = '' 73 | for (let key of Object.keys(body)) { 74 | key === 'body' ? s += `${key}:${CryptoJS.SHA256(body[key]).toString(CryptoJS.enc.Hex)}&` : s += `${key}:${body[key]}&` 75 | } 76 | s = s.slice(0, -1) 77 | let {data} = await axios.post(`${this.api}/h5st`, {s, y, iosVer: this.iosVer, pin: this.pin, fp: this.fp}) 78 | return encodeURIComponent(`${this.timestamp};${this.fp};${this.appId.toString()};${this.tk};${data.s};3.1;${this.time.toString()};${data.u}`) 79 | } 80 | } 81 | 82 | export { 83 | H5ST 84 | } -------------------------------------------------------------------------------- /utils/jdShareCodes.js: -------------------------------------------------------------------------------- 1 | // 从日志中获取互助码 2 | 3 | // process.env.SHARE_CODE_FILE = "/scripts/logs/sharecode.log"; 4 | // process.env.JD_COOKIE = "cookie1&cookie2"; 5 | 6 | exports.JDZZ_SHARECODES = []; 7 | exports.DDFACTORY_SHARECODES = []; 8 | exports.DREAM_FACTORY_SHARE_CODES = []; 9 | exports.PLANT_BEAN_SHARECODES = []; 10 | exports.FRUITSHARECODES = []; 11 | exports.PETSHARECODES = []; 12 | exports.JDJOY_SHARECODES = []; 13 | 14 | let fileContent = ''; 15 | if (process.env.SHARE_CODE_FILE) { 16 | try { 17 | const fs = require('fs'); 18 | if (fs.existsSync(process.env.SHARE_CODE_FILE)) fileContent = fs.readFileSync(process.env.SHARE_CODE_FILE, 'utf8'); 19 | } catch (err) { 20 | console.error(err) 21 | } 22 | } 23 | let lines = fileContent.split('\n'); 24 | 25 | let shareCodesMap = { 26 | "JDZZ_SHARECODES": [], 27 | "DDFACTORY_SHARECODES": [], 28 | "DREAM_FACTORY_SHARE_CODES": [], 29 | "PLANT_BEAN_SHARECODES": [], 30 | "FRUITSHARECODES": [], 31 | "PETSHARECODES": [], 32 | "JDJOY_SHARECODES": [], 33 | }; 34 | for (let i = 0; i < lines.length; i++) { 35 | if (lines[i].includes('京东赚赚')) { 36 | shareCodesMap.JDZZ_SHARECODES.push(lines[i].split('】')[1].trim()); 37 | } else if (lines[i].includes('东东工厂')) { 38 | shareCodesMap.DDFACTORY_SHARECODES.push(lines[i].split('】')[1].trim()); 39 | } else if (lines[i].includes('京喜工厂')) { 40 | shareCodesMap.DREAM_FACTORY_SHARE_CODES.push(lines[i].split('】')[1].trim()); 41 | } else if (lines[i].includes('京东种豆得豆')) { 42 | shareCodesMap.PLANT_BEAN_SHARECODES.push(lines[i].split('】')[1].trim()); 43 | } else if (lines[i].includes('东东农场')) { 44 | shareCodesMap.FRUITSHARECODES.push(lines[i].split('】')[1].trim()); 45 | } else if (lines[i].includes('东东萌宠')) { 46 | shareCodesMap.PETSHARECODES.push(lines[i].split('】')[1].trim()); 47 | } else if (lines[i].includes('crazyJoy')) { 48 | shareCodesMap.JDJOY_SHARECODES.push(lines[i].split('】')[1].trim()); 49 | } 50 | } 51 | for (let key in shareCodesMap) { 52 | shareCodesMap[key] = shareCodesMap[key].reduce((prev, cur) => prev.includes(cur) ? prev : [...prev, cur], []); // 去重 53 | } 54 | let cookieCount = 0; 55 | if (process.env.JD_COOKIE) { 56 | if (process.env.JD_COOKIE.indexOf('&') > -1) { 57 | cookieCount = process.env.JD_COOKIE.split('&').length; 58 | } else { 59 | cookieCount = process.env.JD_COOKIE.split('\n').length; 60 | } 61 | } 62 | 63 | for (let key in shareCodesMap) { 64 | exports[key] = []; 65 | if (shareCodesMap[key].length === 0) { 66 | continue; 67 | } 68 | for (let i = 0; i < cookieCount; i++) { 69 | exports[key][i] = shareCodesMap[key].sort(() => Math.random() - 0.5).join('@'); 70 | } 71 | } 72 | 73 | -------------------------------------------------------------------------------- /utils/jd_joy_getInvokeKey.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * cron: 0 0 * * * 4 | */ 5 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 6 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 7 | return new (P || (P = Promise))(function (resolve, reject) { 8 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 9 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 10 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 11 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 12 | }); 13 | }; 14 | var __generator = (this && this.__generator) || function (thisArg, body) { 15 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 16 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 17 | function verb(n) { return function (v) { return step([n, v]); }; } 18 | function step(op) { 19 | if (f) throw new TypeError("Generator is already executing."); 20 | while (g && (g = 0, op[0] && (_ = 0)), _) try { 21 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 22 | if (y = 0, t) op = [op[0] & 2, t.value]; 23 | switch (op[0]) { 24 | case 0: case 1: t = op; break; 25 | case 4: _.label++; return { value: op[1], done: false }; 26 | case 5: _.label++; y = op[1]; op = [0]; continue; 27 | case 7: op = _.ops.pop(); _.trys.pop(); continue; 28 | default: 29 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 30 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 31 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 32 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 33 | if (t[2]) _.ops.pop(); 34 | _.trys.pop(); continue; 35 | } 36 | op = body.call(thisArg, _); 37 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 38 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 39 | } 40 | }; 41 | exports.__esModule = true; 42 | var axios_1 = require("axios"); 43 | var sendNotify_1 = require("../sendNotify"); 44 | !(function () { return __awaiter(void 0, void 0, void 0, function () { 45 | var res, file; 46 | return __generator(this, function (_a) { 47 | switch (_a.label) { 48 | case 0: return [4 /*yield*/, api('https://prodev.m.jd.com/mall/active/2tZssTgnQsiUqhmg5ooLSHY9XSeN/index.html')]; 49 | case 1: 50 | res = _a.sent(); 51 | file = 'https://storage.360buyimg.com/' + res.match(/htmlSourceUrl":"([^"]*)/)[1]; 52 | return [4 /*yield*/, api(file)]; 53 | case 2: 54 | res = _a.sent(); 55 | file = 'https:' + res.match(/src="(\/\/storage.*)"/)[1]; 56 | return [4 /*yield*/, api(file)]; 57 | case 3: 58 | res = _a.sent(); 59 | file = res.match(/invokeKey: '(.*)'/)[1]; 60 | console.log('invokeKey:', file); 61 | if (!(file !== 'q8DNJdpcfRQ69gIx')) return [3 /*break*/, 5]; 62 | return [4 /*yield*/, (0, sendNotify_1.sendNotify)('invokeKey Update', file)]; 63 | case 4: 64 | _a.sent(); 65 | _a.label = 5; 66 | case 5: return [2 /*return*/]; 67 | } 68 | }); 69 | }); })(); 70 | function api(url) { 71 | return __awaiter(this, void 0, void 0, function () { 72 | var data; 73 | return __generator(this, function (_a) { 74 | switch (_a.label) { 75 | case 0: return [4 /*yield*/, axios_1["default"].get(url, { 76 | headers: { 77 | 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36' 78 | } 79 | })]; 80 | case 1: 81 | data = (_a.sent()).data; 82 | return [2 /*return*/, data]; 83 | } 84 | }); 85 | }); 86 | } 87 | -------------------------------------------------------------------------------- /utils/jd_joy_getInvokeKey.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * cron: 0 0 * * * 3 | */ 4 | 5 | import axios from "axios"; 6 | import {sendNotify} from '../sendNotify'; 7 | 8 | !(async () => { 9 | let res: any = await api('https://prodev.m.jd.com/mall/active/2tZssTgnQsiUqhmg5ooLSHY9XSeN/index.html') 10 | let file: string = 'https://storage.360buyimg.com/' + res.match(/htmlSourceUrl":"([^"]*)/)[1] 11 | res = await api(file) 12 | file = 'https:' + res.match(/src="(\/\/storage.*)"/)[1] 13 | res = await api(file) 14 | file = res.match(/invokeKey: '(.*)'/)[1] 15 | console.log('invokeKey:', file) 16 | if (file !== 'q8DNJdpcfRQ69gIx') { 17 | await sendNotify('invokeKey Update', file) 18 | } 19 | })() 20 | 21 | async function api(url: string) { 22 | let {data}: any = await axios.get(url, { 23 | headers: { 24 | 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36', 25 | } 26 | }) 27 | return data 28 | } -------------------------------------------------------------------------------- /utils/pushplus.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __generator = (this && this.__generator) || function (thisArg, body) { 12 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 13 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 14 | function verb(n) { return function (v) { return step([n, v]); }; } 15 | function step(op) { 16 | if (f) throw new TypeError("Generator is already executing."); 17 | while (g && (g = 0, op[0] && (_ = 0)), _) try { 18 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 19 | if (y = 0, t) op = [op[0] & 2, t.value]; 20 | switch (op[0]) { 21 | case 0: case 1: t = op; break; 22 | case 4: _.label++; return { value: op[1], done: false }; 23 | case 5: _.label++; y = op[1]; op = [0]; continue; 24 | case 7: op = _.ops.pop(); _.trys.pop(); continue; 25 | default: 26 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 27 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 28 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 29 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 30 | if (t[2]) _.ops.pop(); 31 | _.trys.pop(); continue; 32 | } 33 | op = body.call(thisArg, _); 34 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 35 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 36 | } 37 | }; 38 | exports.__esModule = true; 39 | exports.pushplus = void 0; 40 | var axios_1 = require("axios"); 41 | var fs_1 = require("fs"); 42 | var account = []; 43 | try { 44 | account = JSON.parse((0, fs_1.readFileSync)("./utils/account.json").toString()); 45 | } 46 | catch (e) { 47 | console.log('utils/account.json load failed'); 48 | } 49 | function pushplus(title, content, template) { 50 | if (template === void 0) { template = 'html'; } 51 | return __awaiter(this, void 0, void 0, function () { 52 | var token, _i, account_1, user, data; 53 | return __generator(this, function (_a) { 54 | switch (_a.label) { 55 | case 0: 56 | for (_i = 0, account_1 = account; _i < account_1.length; _i++) { 57 | user = account_1[_i]; 58 | if (content.includes(decodeURIComponent(user.pt_pin)) && user.pushplus) { 59 | token = user.pushplus; 60 | break; 61 | } 62 | } 63 | if (!token) { 64 | console.log('no pushplus token'); 65 | return [2 /*return*/]; 66 | } 67 | return [4 /*yield*/, axios_1["default"].post('https://www.pushplus.plus/send', { 68 | token: token, 69 | title: title, 70 | content: content, 71 | template: template 72 | }, { 73 | headers: { 74 | 'Content-Type': 'application/json' 75 | } 76 | })]; 77 | case 1: 78 | data = (_a.sent()).data; 79 | if (data.code === 200) { 80 | console.log('pushplus发送成功'); 81 | } 82 | else { 83 | console.log('pushplus发送失败', JSON.stringify(data)); 84 | } 85 | return [2 /*return*/]; 86 | } 87 | }); 88 | }); 89 | } 90 | exports.pushplus = pushplus; 91 | -------------------------------------------------------------------------------- /utils/pushplus.ts: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import {readFileSync} from "fs"; 3 | 4 | let account: { pt_pin: string, pushplus?: string } [] = [] 5 | 6 | try { 7 | account = JSON.parse(readFileSync("./utils/account.json").toString()) 8 | } catch (e) { 9 | console.log('utils/account.json load failed') 10 | } 11 | 12 | export async function pushplus(title: string, content: string, template: string = 'html'): Promise { 13 | let token: string 14 | for (let user of account) { 15 | if (content.includes(decodeURIComponent(user.pt_pin)) && user.pushplus) { 16 | token = user.pushplus 17 | break 18 | } 19 | } 20 | if (!token) { 21 | console.log('no pushplus token') 22 | return 23 | } 24 | let {data}: any = await axios.post('https://www.pushplus.plus/send', { 25 | token: token, 26 | title: title, 27 | content: content, 28 | template: template 29 | }, { 30 | headers: { 31 | 'Content-Type': 'application/json' 32 | } 33 | }) 34 | if (data.code === 200) { 35 | console.log('pushplus发送成功') 36 | } else { 37 | console.log('pushplus发送失败', JSON.stringify(data)) 38 | } 39 | } -------------------------------------------------------------------------------- /utils/shareCodesTool.ts: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import USER_AGENT, {randomWord} from "../TS_USER_AGENTS"; 3 | import {requestAlgo, geth5st} from './V3' 4 | 5 | async function bean(cookie: string) { 6 | let {data}: any = await axios.post('https://api.m.jd.com/client.action', `functionId=plantBeanIndex&body=${decodeURIComponent(JSON.stringify({version: "9.0.0.1", "monitor_source": "plant_app_plant_index", "monitor_refer": ""}))}&appid=ld&client=apple&area=5_274_49707_49973&build=167283&clientVersion=9.1.0`, { 7 | headers: { 8 | Cookie: cookie, 9 | Host: "api.m.jd.com", 10 | "User-Agent": USER_AGENT 11 | } 12 | }) 13 | if (data.data?.jwordShareInfo?.shareUrl) 14 | return data.data?.jwordShareInfo.shareUrl.split('Uuid=')![1] 15 | else 16 | return 'null' 17 | } 18 | 19 | async function farm(cookie: string) { 20 | let {data}: any = await axios.post('https://api.m.jd.com/client.action?functionId=initForFarm', `body=${encodeURIComponent(JSON.stringify({"version": 4}))}&appid=wh5&clientVersion=9.1.0`, { 21 | headers: { 22 | "cookie": cookie, 23 | "origin": "https://home.m.jd.com", 24 | "referer": "https://home.m.jd.com/myJd/newhome.action", 25 | "User-Agent": USER_AGENT, 26 | "Content-Type": "application/x-www-form-urlencoded" 27 | } 28 | }) 29 | return data.farmUserPro?.shareCode ?? 'null' 30 | } 31 | 32 | async function health(cookie: string) { 33 | let {data}: any = await axios.get(`https://api.m.jd.com/client.action/client.action?functionId=jdhealth_getTaskDetail&body=${encodeURIComponent(JSON.stringify({"buildingId": "", taskId: 6, "channelId": 1}))}&client=wh5&clientVersion=1.0.0`, { 34 | headers: { 35 | "Cookie": cookie, 36 | "origin": "https://h5.m.jd.com", 37 | "referer": "https://h5.m.jd.com/", 38 | 'Content-Type': 'application/x-www-form-urlencoded', 39 | "User-Agent": USER_AGENT 40 | } 41 | }) 42 | return data.data?.result?.taskVos[0].assistTaskDetailVo.taskToken ?? 'null' 43 | } 44 | 45 | async function pet(cookie: string) { 46 | let {data} = await axios.post('https://api.m.jd.com/client.action', 47 | `functionId=initPetTown&body=${JSON.stringify({"version": 1})}&appid=wh5&client=apple&clientVersion=10.3.6&build=167963&rfs=0000`, { 48 | headers: { 49 | 'Host': 'api.m.jd.com', 50 | 'Origin': 'https://h5.m.jd.com', 51 | 'User-Agent': USER_AGENT, 52 | 'Referer': 'https://h5.m.jd.com/', 53 | 'Content-Type': 'application/x-www-form-urlencoded', 54 | 'Cookie': cookie 55 | } 56 | }) 57 | return data.result?.shareCode ?? 'null' 58 | } 59 | 60 | async function factory(cookie: string) { 61 | let {data}: any = await axios.post(`https://api.m.jd.com/client.action?functionId=jdfactory_getTaskDetail`, 62 | `functionId=jdfactory_getTaskDetail&body=${encodeURIComponent(JSON.stringify({}))}&client=wh5&clientVersion=9.1.0`, { 63 | headers: { 64 | Cookie: cookie, 65 | origin: "https://h5.m.jd.com", 66 | referer: "https://h5.m.jd.com/", 67 | "Content-Type": "application/x-www-form-urlencoded", 68 | 'User-Agent': USER_AGENT, 69 | } 70 | }); 71 | if (data.data.bizCode === 0) { 72 | for (let t of data.data?.result?.taskVos) { 73 | if (t.taskType === 14) 74 | return t.assistTaskDetailVo.taskToken 75 | } 76 | } 77 | return 'null' 78 | } 79 | 80 | async function sgmh(cookie: string) { 81 | let {data}: any = await axios.post(`https://api.m.jd.com/client.action`, 82 | `functionId=interact_template_getHomeData&body={"appId":"1EFRXxg","taskToken":""}&client=wh5&clientVersion=1.0.0`, { 83 | headers: { 84 | 'Origin': `https://h5.m.jd.com`, 85 | 'Cookie': cookie, 86 | 'Accept': `application/json, text/plain, */*`, 87 | 'Referer': `https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html`, 88 | 'Host': `api.m.jd.com`, 89 | } 90 | }) 91 | if (data.data.bizCode === 0) { 92 | for (let t of data.data?.result?.taskVos) { 93 | if (t.taskName === '邀请好友助力') 94 | return t.assistTaskDetailVo.taskToken 95 | } 96 | } 97 | return 'null' 98 | } 99 | 100 | async function jxfactory(cookie: string) { 101 | await requestAlgo('c0ff1') 102 | let url: string, timestamp = Date.now() 103 | let stk = `_time,bizCode,showAreaTaskFlag,source`, params = {showAreaTaskFlag: '1', bizCode: 'dream_factory'} 104 | let t: { key: string, value: string } [] = [ 105 | {key: '_time', value: timestamp.toString()}, 106 | {key: '_ts', value: timestamp.toString()}, 107 | {key: 'bizCode', value: 'dream_factory'}, 108 | {key: 'source', value: 'dreamfactory'}, 109 | ] 110 | url = `https://m.jingxi.com/newtasksys/newtasksys_front/GetUserTaskStatusList?source=dreamfactory&_time=${timestamp}&_ts=${timestamp}&_stk=${encodeURIComponent(stk)}&_=${timestamp + 3}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls` 111 | 112 | for (let [key, value] of Object.entries(params)) { 113 | t.push({key, value}) 114 | url += `&${key}=${value}` 115 | } 116 | let h5st = geth5st(t, 'c0ff1') 117 | url += `&h5st=${encodeURIComponent(h5st)}` 118 | let {data}: any = await axios.get(url, { 119 | headers: { 120 | 'Referer': 'https://actst.jingxi.com/pingou/dream_factory/index.html', 121 | 'User-Agent': USER_AGENT, 122 | 'Host': 'm.jingxi.com', 123 | 'Cookie': cookie 124 | } 125 | }) 126 | return JSON.parse(data.match(/try{jsonpCBK.?\((.*)/)![1]).data?.encryptPin || 'null' 127 | } 128 | 129 | export { 130 | bean, 131 | farm, 132 | health, 133 | pet, 134 | factory, 135 | sgmh, 136 | jxfactory 137 | } -------------------------------------------------------------------------------- /utils/sharecodes.json: -------------------------------------------------------------------------------- 1 | { 2 | "cfd":["abcd", "abc123"], 3 | "jxfactory":["tuanid:123", "tuanid:234"] 4 | } 5 | -------------------------------------------------------------------------------- /z_jd_喂猪.ts: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import USER_AGENT, {o2s, getCookie, wait} from "./TS_USER_AGENTS"; 3 | 4 | let cookie: string = '', res: any = '', UserName: string, index: number 5 | 6 | !(async () => { 7 | let cookiesArr: string[] = await getCookie(); 8 | for (let i = 0; i < cookiesArr.length; i++) { 9 | cookie = cookiesArr[i]; 10 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 11 | index = i + 1; 12 | console.log(`\n开始【京东账号${index}】${UserName}\n`); 13 | 14 | res = await api('pigPetLogin', {"shareId": "", "helpId": "", "cardId": "", "signId": "", "validation": "", "channelLV": "", "source": 2, "riskDeviceParam": "{}"}) 15 | o2s(res) 16 | if (!res.resultData.resultData.hasPig) { 17 | console.log('没有养猪,跳过') 18 | continue 19 | } 20 | 21 | let currCount = res.resultData.resultData.cote.pig.currCount 22 | let currLevelCount = res.resultData.resultData.cote.pig.currLevelCount 23 | console.log('成长值:', currCount, currLevelCount) 24 | if (currCount == currLevelCount) { 25 | console.log('成长值已满,跳过') 26 | continue 27 | } 28 | 29 | // 任务 30 | // res = await api('pigPetMissionList', {"source": 2, "channelLV": "", "riskDeviceParam": "{}"}) 31 | // for(let t of res.resultData.resultData.missions){ 32 | // if(['完成每日分享','']) 33 | // } 34 | 35 | // 转盘 36 | res = await api('pigPetLotteryIndex', {"source": 2, "channelLV": "", "riskDeviceParam": "{}"}) 37 | console.log('转盘次数:', res.resultData.resultData.currentCount) 38 | for (let j = 0; j < res.resultData.resultData.currentCount; j++) { 39 | res = await api('pigPetLotteryPlay', {"type": 0, "validation": "", "channelLV": "", "source": 2, "riskDeviceParam": "{}"}) 40 | try { 41 | console.log('转盘') 42 | o2s(res) 43 | // console.log('转盘:', res.resultData.resultData.award.content, res.resultData.resultData.award.count) 44 | } catch (e) { 45 | console.log(e) 46 | o2s(res) 47 | } 48 | } 49 | 50 | // 背包 51 | res = await api('pigPetUserBag', {"category": "1001", "channelLV": "", "source": 2, "riskDeviceParam": "{}"}) 52 | let levelMax: boolean = false 53 | for (let t of res.resultData.resultData.goods) { 54 | let food: number = t.count 55 | console.log(t.goodsName, food) 56 | for (let j = 0; j < 10; j++) { 57 | if (food >= 20 && !levelMax) { 58 | res = await api('pigPetAddFood', {channelLV: "", riskDeviceParam: "{}", skuId: "1001003003", source: 2}) 59 | o2s(res) 60 | console.log(`喂${t.goodsName},成长值:`, res.resultData.resultData.cote.pig.currCount) 61 | if (res.resultData.resultData.cote.pig.currCount === currLevelCount) { 62 | console.log('成长值已满') 63 | levelMax = true 64 | break 65 | } 66 | await wait(13000) 67 | food -= 20 68 | } else { 69 | break 70 | } 71 | } 72 | } 73 | } 74 | })() 75 | 76 | async function api(fn: string, body: object) { 77 | let {data} = await axios.post(`https://ms.jr.jd.com/gw/generic/uc/h5/m/${fn}?_=${Date.now()}`, `reqData=${encodeURIComponent(JSON.stringify(body))}`, { 78 | headers: { 79 | 'Host': 'ms.jr.jd.com', 80 | 'Accept': 'application/json', 81 | 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', 82 | 'Origin': 'https://u.jr.jd.com', 83 | 'User-Agent': USER_AGENT, 84 | 'Referer': 'https://u.jr.jd.com/', 85 | 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', 86 | 'Cookie': cookie 87 | } 88 | }) 89 | return data 90 | } --------------------------------------------------------------------------------