mirror of
				https://github.com/shufflewzc/faker2.git
				synced 2025-10-31 03:42:43 +08:00 
			
		
		
		
	update
This commit is contained in:
		
							parent
							
								
									77c2f9d40c
								
							
						
					
					
						commit
						d8d50c4cf9
					
				| @ -1854,7 +1854,7 @@ function getCoupon() { | ||||
| 					//console.log(useable[i]);
 | ||||
|                     if (useable[i].limitStr.indexOf('全品类') > -1) { | ||||
|                         $.beginTime = useable[i].beginTime; | ||||
|                         if ($.beginTime < new Date().getTime() && useable[i].quota < 20 && useable[i].coupontype === 1) {                            | ||||
|                         if ($.beginTime < new Date().getTime() && useable[i].quota <= 100 && useable[i].coupontype === 1) {                            | ||||
| 							//$.couponEndTime = new Date(parseInt(useable[i].endTime)).Format('yyyy-MM-dd');
 | ||||
|                             $.couponName = useable[i].limitStr; | ||||
| 							if (useable[i].platFormInfo)  | ||||
|  | ||||
| @ -1,23 +1,8 @@ | ||||
| /* | ||||
| 金榜创造营 | ||||
| 活动入口:https://h5.m.jd.com/babelDiy/Zeus/2H5Ng86mUJLXToEo57qWkJkjFPxw/index.html
 | ||||
| 活动时间:2021-05-21至2021-12-31 | ||||
| 脚本更新时间:2021-05-28 14:20 | ||||
| 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js | ||||
| ===================quantumultx================ | ||||
| [task_local] | ||||
| #金榜创造营 | ||||
| 13 1,22 * * * jd_gold_creator.js, tag=金榜创造营, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
 | ||||
| 13 5 * * * jd_gold_creator.js, tag=金榜创造营, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
 | ||||
| 
 | ||||
| =====================Loon================ | ||||
| [Script] | ||||
| cron "13 1,22 * * *" script-path=jd_gold_creator.js, tag=金榜创造营 | ||||
| 
 | ||||
| ====================Surge================ | ||||
| 金榜创造营 = type=cron,cronexp="13 1,22 * * *",wake-system=1,timeout=3600,script-path=jd_gold_creator.js | ||||
| 
 | ||||
| ============小火箭========= | ||||
| 金榜创造营 = type=cron,script-path=jd_gold_creator.js, cronexpr="13 1,22 * * *", timeout=3600, enable=true | ||||
|  */ | ||||
| const $ = new Env('金榜创造营'); | ||||
| const notify = $.isNode() ? require('./sendNotify') : ''; | ||||
| @ -54,7 +39,7 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action'; | ||||
|       $.beans = 0 | ||||
|       $.nickName = ''; | ||||
|       message = ''; | ||||
|       //await TotalBean();
 | ||||
|       await TotalBean(); | ||||
|       console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); | ||||
|       if (!$.isLogin) { | ||||
|         $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, {"open-url": "https://bean.m.jd.com/"}); | ||||
| @ -79,8 +64,11 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action'; | ||||
| async function main() { | ||||
|   try { | ||||
|     await goldCreatorTab();//获取顶部主题
 | ||||
|     await $.wait(1000); | ||||
|     await getDetail(); | ||||
|     await $.wait(500); | ||||
|     await goldCreatorPublish(); | ||||
|     await $.wait(500); | ||||
|     await showMsg(); | ||||
|   } catch (e) { | ||||
|     $.logErr(e) | ||||
| @ -100,7 +88,7 @@ async function getDetail() { | ||||
|   for (let item of $.subTitleInfos) { | ||||
|     console.log(`\n开始给【${item['longTitle']}】主题下的商品进行投票`); | ||||
|     await goldCreatorDetail(item['matGrpId'], item['subTitleId'], item['taskId'], item['batchId']); | ||||
|     await $.wait(4000); | ||||
|     await $.wait(2000); | ||||
|   } | ||||
| } | ||||
| function goldCreatorTab() { | ||||
| @ -211,7 +199,7 @@ async function doTask2(batchId) { | ||||
|         body['type'] = 2; | ||||
|       } | ||||
|       await goldCreatorDoTask(body); | ||||
|       await $.wait(4000); | ||||
|       await $.wait(2000); | ||||
|     } | ||||
|   } | ||||
|   if ($.signTask['taskStatus'] === 1) { | ||||
| @ -232,7 +220,7 @@ function goldCreatorDoTask(body) { | ||||
|             data = JSON.parse(data) | ||||
|             if (data.code === '0') { | ||||
|               if (data.result.taskCode === '0') { | ||||
|                 console.log(`成功,获得 ${data.result.lotteryScore}京豆\n`); | ||||
|                 console.log(`成功,获得 ${data.result.lotteryScore}京豆`); | ||||
|                 if (data.result.lotteryScore) $.beans += parseInt(data.result.lotteryScore); | ||||
|               } else { | ||||
|                 console.log(`失败:${data.result['taskMsg']}\n`); | ||||
|  | ||||
							
								
								
									
										150
									
								
								jd_jdzz.js
									
									
									
									
									
								
							
							
						
						
									
										150
									
								
								jd_jdzz.js
									
									
									
									
									
								
							| @ -1,28 +1,12 @@ | ||||
| /* | ||||
| 京东赚赚 | ||||
| 活动入口:京东赚赚小程序 | ||||
| 长期活动,每日收益2毛左右 | ||||
| 已支持IOS双京东账号,Node.js支持N个京东账号 | ||||
| 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js | ||||
| ============Quantumultx=============== | ||||
| [task_local] | ||||
| # 京东赚赚 | ||||
| 10 0 * * * jd_jdzz.js, tag=京东赚赚, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzz.png, enabled=true
 | ||||
| ================Loon============== | ||||
| [Script] | ||||
| cron "10 0 * * *" script-path=jd_jdzz.js,tag=京东赚赚 | ||||
| ===============Surge================= | ||||
| 京东赚赚 = type=cron,cronexp="10 0 * * *",wake-system=1,timeout=3600,script-path=jd_jdzz.js | ||||
| ============小火箭========= | ||||
| 京东赚赚 = type=cron,script-path=jd_jdzz.js, cronexpr="10 0 * * *", timeout=3600, enable=true | ||||
| 11 3 * * * jd_jdzz.js | ||||
|  */ | ||||
| const $ = new Env('京东赚赚'); | ||||
| const notify = $.isNode() ? require('./sendNotify') : ''; | ||||
| //Node.js用户请在jdCookie.js处填写京东ck;
 | ||||
| const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; | ||||
| //let helpAuthor = true; // 帮助作者
 | ||||
| const randomCount = $.isNode() ? 20 : 5; | ||||
| let jdNotify = true; // 是否关闭通知,false打开通知推送,true关闭通知推送
 | ||||
| //IOS等用户直接用NobyDa的jd cookie
 | ||||
| let cookiesArr = [], cookie = '', message = '', allMessage = ''; | ||||
| if ($.isNode()) { | ||||
| @ -35,12 +19,8 @@ if ($.isNode()) { | ||||
|     cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); | ||||
| } | ||||
| const JD_API_HOST = 'https://api.m.jd.com/client.action'; | ||||
| const inviteCodes = [ | ||||
|   '' | ||||
| ] | ||||
| let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000); | ||||
| !(async () => { | ||||
|   //await requireConfig();
 | ||||
|     if (!cookiesArr[0]) { | ||||
|         $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" }); | ||||
|         return; | ||||
| @ -63,7 +43,6 @@ let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset() * | ||||
|                 } | ||||
|                 continue | ||||
|             } | ||||
|       //await shareCodesFormat()
 | ||||
|             await jdWish() | ||||
|         } | ||||
|     } | ||||
| @ -88,13 +67,11 @@ async function jdWish() { | ||||
|     $.assistStatus = 0; | ||||
|     await getTaskList(true) | ||||
| 
 | ||||
|   // await helpFriends()
 | ||||
|     await getUserInfo() | ||||
|     $.nowBean = parseInt($.totalBeanNum) | ||||
|     $.nowNum = parseInt($.totalNum) | ||||
|     for (let i = 0; i < $.taskList.length; ++i) { | ||||
|         let task = $.taskList[i] | ||||
|     // console.log(task);
 | ||||
|         if (task['taskId'] === 1 && task['status'] !== 2) { | ||||
|             console.log(`去做任务:${task.taskName}`) | ||||
|             await doTask({ "taskId": task['taskId'], "taskItem": {}, "actionType": 0, "taskToken": task['taskToken'], "mpVersion": "3.4.0" }) | ||||
| @ -138,11 +115,6 @@ function getUserInfo() { | ||||
|                 } else { | ||||
|                     if (safeGet(data)) { | ||||
|                         data = JSON.parse(data); | ||||
|             // if (data.data.shareTaskRes) {
 | ||||
|             //   console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】${data.data.shareTaskRes.itemId}\n`);
 | ||||
|             // } else {
 | ||||
|             //   console.log(`\n\n已满5人助力或助力功能已下线,故暂时无${$.name}好友助力码\n\n`)
 | ||||
|             // }
 | ||||
|                     } | ||||
|                 } | ||||
|             } catch (e) { | ||||
| @ -181,7 +153,6 @@ function getTaskList(flag = false) { | ||||
|     }) | ||||
| } | ||||
| 
 | ||||
| // 完成
 | ||||
| function doTask(body, func = "doInteractTask") { | ||||
|     // console.log(taskUrl("doInteractTask", body))
 | ||||
|     return new Promise(resolve => { | ||||
| @ -196,8 +167,8 @@ function doTask(body, func = "doInteractTask") { | ||||
|                         // console.log(data)
 | ||||
|                         if (func === "doInteractTask") { | ||||
|                             if (data.subCode === "S000") { | ||||
|                 console.log(`任务完成,获得 ${data.data.taskDetailResList[0].incomeAmountConf} 金币,${data.data.taskDetailResList[0].beanNum} 京豆`) | ||||
|                 $.bean += parseInt(data.data.taskDetailResList[0].beanNum) | ||||
|                                 console.log(`任务完成,获得 ${data.data.taskDetailResList[0].incomeAmount} 金币`) | ||||
|                                 //$.bean += parseInt(data.data.taskDetailResList[0].beanNum)
 | ||||
|                             } else { | ||||
|                                 console.log(`任务失败,错误信息:${data.message}`) | ||||
|                             } | ||||
| @ -215,126 +186,15 @@ function doTask(body, func = "doInteractTask") { | ||||
|     }) | ||||
| } | ||||
| 
 | ||||
| async function helpFriends() { | ||||
|   for (let code of $.newShareCodes) { | ||||
|     if (!code) continue | ||||
|     await doTask({"itemId": code, "taskId": "3", "mpVersion": "3.4.0"}, "doHelpTask") | ||||
|   } | ||||
| } | ||||
| function readShareCode() { | ||||
|   console.log(`开始`) | ||||
|   return new Promise(async resolve => { | ||||
|     $.get({url: `https://code.chiang.fun/api/v1/jd/jdzz/read/${randomCount}/`, 'timeout': 10000}, (err, resp, data) => { | ||||
|       try { | ||||
|         if (err) { | ||||
|           console.log(`${JSON.stringify(err)}`) | ||||
|           console.log(`${$.name} API请求失败,请检查网路重试`) | ||||
|         } else { | ||||
|           if (data) { | ||||
|             console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) | ||||
|             data = JSON.parse(data); | ||||
|           } | ||||
|         } | ||||
|       } catch (e) { | ||||
|         $.logErr(e, resp) | ||||
|       } finally { | ||||
|         resolve(data); | ||||
|       } | ||||
|     }) | ||||
|     await $.wait(10000); | ||||
|     resolve() | ||||
|   }) | ||||
| } | ||||
| //格式化助力码
 | ||||
| function shareCodesFormat() { | ||||
|   return new Promise(async resolve => { | ||||
|     // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
 | ||||
|     $.newShareCodes = []; | ||||
|     if ($.shareCodesArr[$.index - 1]) { | ||||
|       $.newShareCodes = $.shareCodesArr[$.index - 1].split('@'); | ||||
|     } else { | ||||
|       console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`) | ||||
|       const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1); | ||||
|       $.newShareCodes = inviteCodes[tempIndex].split('@'); | ||||
|     } | ||||
|     const readShareCodeRes = await readShareCode(); | ||||
|     if (readShareCodeRes && readShareCodeRes.code === 200) { | ||||
|       $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])]; | ||||
|     } | ||||
|     console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`) | ||||
|     resolve(); | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| function requireConfig() { | ||||
|   return new Promise(resolve => { | ||||
|     console.log(`开始获取${$.name}配置文件\n`); | ||||
|     //Node.js用户请在jdCookie.js处填写京东ck;
 | ||||
|     let shareCodes = []; | ||||
|     if ($.isNode()) { | ||||
|       if (process.env.JDZZ_SHARECODES) { | ||||
|         if (process.env.JDZZ_SHARECODES.indexOf('\n') > -1) { | ||||
|           shareCodes = process.env.JDZZ_SHARECODES.split('\n'); | ||||
|         } else { | ||||
|           shareCodes = process.env.JDZZ_SHARECODES.split('&'); | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|     console.log(`共${cookiesArr.length}个京东账号\n`); | ||||
|     $.shareCodesArr = []; | ||||
|     if ($.isNode()) { | ||||
|       Object.keys(shareCodes).forEach((item) => { | ||||
|         if (shareCodes[item]) { | ||||
|           $.shareCodesArr.push(shareCodes[item]) | ||||
|         } | ||||
|       }) | ||||
|     } | ||||
|     console.log(`您提供了${$.shareCodesArr.length}个账号的${$.name}助力码\n`); | ||||
|     resolve() | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| function taskUrl(functionId, body = {}) { | ||||
|     return { | ||||
|     url: `${JD_API_HOST}?functionId=${functionId}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=9.1.0`, | ||||
|         url: `${JD_API_HOST}?functionId=${functionId}&body=${escape(JSON.stringify(body))}&appid=wh5&loginType=2&loginWQBiz=interact`, | ||||
|         headers: { | ||||
|             'Cookie': cookie, | ||||
|       'Host': 'api.m.jd.com', | ||||
|       'Connection': 'keep-alive', | ||||
|             'Content-Type': 'application/json', | ||||
|       'Referer': 'http://wq.jd.com/wxapp/pages/hd-interaction/index/index', | ||||
|             'Referer': 'https://servicewechat.com/wx8830763b00c18ac3/120/page-frame.html', | ||||
|             'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "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"), | ||||
|       'Accept-Language': 'zh-cn', | ||||
|       'Accept-Encoding': 'gzip, deflate, br', | ||||
|     } | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| function taskTuanUrl(function_id, body = {}) { | ||||
|   return { | ||||
|     url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=swat_miniprogram&osVersion=5.0.0&clientVersion=3.1.3&fromType=wxapp×tamp=${new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000}`, | ||||
|     headers: { | ||||
|       "Accept": "*/*", | ||||
|       "Accept-Encoding": "gzip, deflate, br", | ||||
|       "Accept-Language": "zh-cn", | ||||
|       "Connection": "keep-alive", | ||||
|       "Content-Type": "application/x-www-form-urlencoded", | ||||
|       "Host": "api.m.jd.com", | ||||
|       "Referer": "https://servicewechat.com/wxa5bf5ee667d91626/108/page-frame.html", | ||||
|       "Cookie": cookie, | ||||
|       "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "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"), | ||||
|     } | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| function taskPostUrl(function_id, body = {}) { | ||||
|   return { | ||||
|     url: `${JD_API_HOST}?functionId=${function_id}`, | ||||
|     body: body, | ||||
|     headers: { | ||||
|       "Cookie": cookie, | ||||
|       'Content-Type': 'application/x-www-form-urlencoded', | ||||
|       "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "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"), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										231
									
								
								jd_joy_park_run.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										231
									
								
								jd_joy_park_run.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,231 @@ | ||||
| /** | ||||
| 汪汪乐园-跑步+组队 | ||||
| 默认翻倍到0.01红包结束,修改请设置变量 | ||||
| export JD_JOY_PARK_RUN_ASSETS="0.04" | ||||
| cron:30 0 * * * * | ||||
| 30 0 * * * * jd_joy_park_run.ts | ||||
| new Env('极速版汪汪赛跑'); | ||||
| 
 | ||||
| **/ | ||||
| 
 | ||||
| import {get, post, o2s, requireConfig, wait} from './function/TS_USER_AGENTS' | ||||
| import {H5ST} from "./function/h5st" | ||||
| import {existsSync, readFileSync} from "fs"; | ||||
| import {getDate} from "date-fns"; | ||||
| 
 | ||||
| let cookie: string = '', res: any = '', UserName: string = '', fp_448de: string = '' || process.env.FP_448DE, fp_b6ac3: string = '' || process.env.FP_B6AC3 | ||||
| let assets: number = 0, captainId: string = '', h5stTool: H5ST = null | ||||
| 
 | ||||
| !(async () => { | ||||
|   let cookiesArr: string[] = await requireConfig() | ||||
|   let account: { pt_pin: string, joy_park_run: number }[] = [] | ||||
| 
 | ||||
| 
 | ||||
|   for (let [index, value] of cookiesArr.entries()) { | ||||
|     cookie = value | ||||
|     UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) | ||||
|     console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) | ||||
| 
 | ||||
|    | ||||
| 
 | ||||
|     assets = parseFloat(process.env.JD_JOY_PARK_RUN_ASSETS || '0.01') | ||||
|     let rewardAmount: number = 0 | ||||
|     try { | ||||
|       h5stTool = new H5ST('448de', 'jdltapp;', fp_448de) | ||||
|       await h5stTool.__genAlgo() | ||||
|       res = await team('runningMyPrize', {"linkId": "L-sOanK_5RJCz7I314FpnQ", "pageSize": 20, "time": null, "ids": null}) | ||||
|       let sum: number = 0, success: number = 0 | ||||
|       for (let t of res?.data?.detailVos || []) { | ||||
|         if (t.amount > 0 && getDate(new Date(t.createTime)) === new Date().getDate()) { | ||||
|           sum = add(sum, t.amount) | ||||
|           success++ | ||||
|         } else { | ||||
|           break | ||||
|         } | ||||
|       } | ||||
|       console.log('今日成功', success, '次') | ||||
|       console.log('今日收益', sum.toFixed(2), '元') | ||||
| 
 | ||||
|       res = await team('runningTeamInfo', {"linkId": "L-sOanK_5RJCz7I314FpnQ"}) | ||||
|       if (!captainId) { | ||||
|         if (res.data.members.length === 0) { | ||||
|           console.log('成为队长') | ||||
|           captainId = res.data.captainId | ||||
|         } else if (res.data.members.length !== 6) { | ||||
|           console.log('队伍未满', res.data.members.length, '人') | ||||
|           console.log('战队收益', res.data.teamSumPrize, '元') | ||||
|           captainId = res.data.captainId | ||||
|         } else { | ||||
|           console.log('队伍已满', res.data.members.length, '人') | ||||
|           console.log('战队收益', res.data.teamSumPrize, '元') | ||||
|         } | ||||
|       } else if (captainId && res.data.members.length === 0) { | ||||
|         console.log('已有组队ID,未加入队伍') | ||||
|         res = await team('runningJoinTeam', {"linkId": "L-sOanK_5RJCz7I314FpnQ", "captainId": captainId}) | ||||
|         if (res.code === 0) { | ||||
|           console.log('组队成功') | ||||
|           for (let member of res.data.members) { | ||||
|             if (member.captain) { | ||||
|               console.log('队长', member.nickName) | ||||
|               break | ||||
|             } | ||||
|           } | ||||
|           if (res.data.members.length === 6) { | ||||
|             console.log('队伍已满') | ||||
|             captainId = '' | ||||
|           } | ||||
|         } else { | ||||
|           o2s(res, '组队失败') | ||||
|         } | ||||
|       } else { | ||||
|         console.log('已组队', res.data.members.length, '人') | ||||
|         console.log('战队收益', res.data.teamSumPrize, '元') | ||||
|       } | ||||
| 
 | ||||
| 
 | ||||
|       h5stTool = new H5ST('b6ac3', 'jdltapp;', fp_b6ac3) | ||||
|       await h5stTool.__genAlgo() | ||||
|       res = await runningPageHome() | ||||
|       console.log('🧧总金额', res.data.runningHomeInfo.prizeValue, '元') | ||||
|        | ||||
|       let energy: number = res.data.runningHomeInfo.energy | ||||
|       console.log('💊 X', res.data.runningHomeInfo.energy, '个能量棒')  | ||||
|       await wait(2000) | ||||
|       if (res.data.runningHomeInfo.nextRunningTime){ | ||||
|       console.log('⏳体力恢复中,还有', secondsToMinutes(res.data.runningHomeInfo.nextRunningTime / 1000)) | ||||
|         if (res.data.runningHomeInfo.nextRunningTime / 1000 < 300) { | ||||
|           await wait(res.data.runningHomeInfo.nextRunningTime) | ||||
|           res = await runningPageHome() | ||||
|           console.log('体力恢复完成,开始跑步....') | ||||
|           await wait(1000) | ||||
|         } else { | ||||
|             console.log('⏳等体力恢复在跑吧!'); | ||||
|             continue; | ||||
|                } | ||||
|       } else { | ||||
|           console.log('体力已恢复,开始跑步....') | ||||
|       } | ||||
| 
 | ||||
|       await startRunning(res, assets) | ||||
|       for (let i = 0; i < energy; i++) { | ||||
|         console.log('💉消耗能量棒跑步....') | ||||
|         res = await api('runningUseEnergyBar', {"linkId": "L-sOanK_5RJCz7I314FpnQ"}) | ||||
|         //console.log(res.errMsg)
 | ||||
|         res = await runningPageHome() | ||||
|         await startRunning(res, assets) | ||||
|         await wait(1000) | ||||
|       } | ||||
|       res = await runningPageHome() | ||||
|       console.log('🧧总金额', res.data.runningHomeInfo.prizeValue, '元') | ||||
|       await wait(2000) | ||||
|     } catch (e) { | ||||
|       console.log('Error', e) | ||||
|       await wait(3000) | ||||
|     } | ||||
|   } | ||||
| })() | ||||
| 
 | ||||
| async function startRunning(res: any, assets: number) { | ||||
|   if (!res.data.runningHomeInfo.nextRunningTime) { | ||||
|     console.log('终点目标', assets) | ||||
|     for (let i = 0; i < 5; i++) { | ||||
|       res = await api('runningOpenBox', {"linkId": "L-sOanK_5RJCz7I314FpnQ"}) | ||||
|       if (parseFloat(res.data.assets) >= assets) { | ||||
|         let assets: number = parseFloat(res.data.assets) | ||||
|         res = await api('runningPreserveAssets', {"linkId": "L-sOanK_5RJCz7I314FpnQ"}) | ||||
|         console.log('领取成功', assets) | ||||
|         break | ||||
|       } else { | ||||
|         if (res.data.doubleSuccess) { | ||||
|           console.log('翻倍成功', parseFloat(res.data.assets)) | ||||
|           await wait(10000) | ||||
|         } else if (!res.data.doubleSuccess && !res.data.runningHomeInfo.runningFinish) { | ||||
|           console.log('开始跑步', parseFloat(res.data.assets)) | ||||
|           await wait(10000) | ||||
|         } else { | ||||
|           console.log('翻倍失败') | ||||
|           break | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|   await wait(3000) | ||||
| } | ||||
| 
 | ||||
| async function api(fn: string, body: object) { | ||||
|   let timestamp: number = Date.now(), h5st: string = '' | ||||
|   if (fn === 'runningOpenBox') { | ||||
|     h5st = h5stTool.__genH5st({ | ||||
|       appid: "activities_platform", | ||||
|       body: JSON.stringify(body), | ||||
|       client: "ios", | ||||
|       clientVersion: "3.1.0", | ||||
|       functionId: "runningOpenBox", | ||||
|       t: timestamp.toString() | ||||
|     }) | ||||
|   } | ||||
|   let params: string = `functionId=${fn}&body=${JSON.stringify(body)}&t=${timestamp}&appid=activities_platform&client=ios&clientVersion=3.1.0&cthr=1` | ||||
|   h5st && (params += `&h5st=${h5st}`) | ||||
|   return await post('https://api.m.jd.com/', params, { | ||||
|     'authority': 'api.m.jd.com', | ||||
|     'content-type': 'application/x-www-form-urlencoded', | ||||
|     'cookie': cookie, | ||||
|     'origin': 'https://h5platform.jd.com', | ||||
|     'referer': 'https://h5platform.jd.com/', | ||||
|     'user-agent': 'jdltapp;' | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| async function runningPageHome() { | ||||
|   return get(`https://api.m.jd.com/?functionId=runningPageHome&body=%7B%22linkId%22:%22L-sOanK_5RJCz7I314FpnQ%22,%22isFromJoyPark%22:true,%22joyLinkId%22:%22LsQNxL7iWDlXUs6cFl-AAg%22%7D&t=${Date.now()}&appid=activities_platform&client=ios&clientVersion=3.1.0`, { | ||||
|     'Host': 'api.m.jd.com', | ||||
|     'Origin': 'https://h5platform.jd.com', | ||||
|     'User-Agent': 'jdltapp;', | ||||
|     'Referer': 'https://h5platform.jd.com/', | ||||
|     'Cookie': cookie | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| async function team(fn: string, body: object) { | ||||
|   let timestamp: number = Date.now(), h5st: string | ||||
|   h5st = h5stTool.__genH5st({ | ||||
|     appid: "activities_platform", | ||||
|     body: JSON.stringify(body), | ||||
|     client: "ios", | ||||
|     clientVersion: "3.1.0", | ||||
|     functionId: fn, | ||||
|     t: timestamp.toString() | ||||
|   }) | ||||
|   return await get(`https://api.m.jd.com/?functionId=${fn}&body=${encodeURIComponent(JSON.stringify(body))}&t=${timestamp}&appid=activities_platform&client=ios&clientVersion=3.1.0&cthr=1&h5st=${h5st}`, { | ||||
|     'Host': 'api.m.jd.com', | ||||
|     'User-Agent': 'jdltapp;', | ||||
|     'Origin': 'https://h5platform.jd.com', | ||||
|     'X-Requested-With': 'com.jd.jdlite', | ||||
|     'Referer': 'https://h5platform.jd.com/', | ||||
|     'Cookie': cookie | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| // 秒转时分秒
 | ||||
| function secondsToMinutes(seconds: number) { | ||||
|   let minutes: number = Math.floor(seconds / 60) | ||||
|   let second: number = Math.floor(seconds % 60) | ||||
|   return `${minutes}分${second}秒` | ||||
| } | ||||
| 
 | ||||
| // 小数加法
 | ||||
| function add(num1: number, num2: number) { | ||||
|   let r1: number, r2: number | ||||
|   try { | ||||
|     r1 = num1.toString().split('.')[1].length | ||||
|   } catch (e) { | ||||
|     r1 = 0 | ||||
|   } | ||||
|   try { | ||||
|     r2 = num2.toString().split('.')[1].length | ||||
|   } catch (e) { | ||||
|     r2 = 0 | ||||
|   } | ||||
|   let m: number = Math.pow(10, Math.max(r1, r2)) | ||||
|   return (num1 * m + num2 * m) / m | ||||
| } | ||||
							
								
								
									
										373
									
								
								jd_joy_park_task.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										373
									
								
								jd_joy_park_task.js
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										88
									
								
								jd_joy_run_reward.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										88
									
								
								jd_joy_run_reward.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,88 @@ | ||||
| /** | ||||
| 汪汪赛跑-提现10元 | ||||
| 2 0 0 * * 5 jd_joy_run_reward.ts | ||||
| new Env('汪汪赛跑提现') | ||||
| Modify By Dylan from HW | ||||
| updateTime:2022-07-09 | ||||
| **/ | ||||
| 
 | ||||
| import {get, post, requireConfig, wait} from './function/TS_USER_AGENTS' | ||||
| import {H5ST} from "./function/h5st" | ||||
| 
 | ||||
| let cookie: string = '', res: any = '', UserName: string = '', fp_448de: string = '' || process.env.FP_448DE, fp_b6ac3: string = '' || process.env.FP_B6AC3 | ||||
| let h5stTool: H5ST = null | ||||
| 
 | ||||
| !(async () => { | ||||
|   let cookiesArr: string[] = await requireConfig() | ||||
|   for (let [index, value] of cookiesArr.entries()) { | ||||
|     cookie = value | ||||
|     UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) | ||||
|     console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) | ||||
|     let rewardAmount: number = 0 | ||||
|     try { | ||||
|       h5stTool = new H5ST('448de', 'jdltapp;', fp_448de) | ||||
|       await h5stTool.__genAlgo() | ||||
|       res = await team('runningMyPrize', {"linkId": "L-sOanK_5RJCz7I314FpnQ", "pageSize": 20, "time": null, "ids": null}) | ||||
| 	  rewardAmount = res.data.rewardAmount | ||||
|       if (res.data.runningCashStatus.currentEndTime) { | ||||
|         console.log('可提现', rewardAmount) | ||||
|         res = await api('runningPrizeDraw', {"linkId": "L-sOanK_5RJCz7I314FpnQ", "type": 2, "level": 3}) | ||||
|         await wait(2000) | ||||
|         if (res.success){ | ||||
|                console.log(res.data.message) | ||||
|            } else { | ||||
|                 console.log('提现失败:', res.errMsg) | ||||
|              } | ||||
|       }else{ | ||||
|           console.log('还未到提现时间') | ||||
|       } | ||||
|     } catch (e) { | ||||
|       console.log('Error', e) | ||||
|       await wait(1000) | ||||
|     } | ||||
|   } | ||||
| })() | ||||
| 
 | ||||
| async function api(fn: string, body: object) { | ||||
|   let timestamp: number = Date.now(), h5st: string = '' | ||||
|   if (fn === 'runningOpenBox') { | ||||
|     h5st = h5stTool.__genH5st({ | ||||
|       appid: "activities_platform", | ||||
|       body: JSON.stringify(body), | ||||
|       client: "ios", | ||||
|       clientVersion: "3.1.0", | ||||
|       functionId: "runningOpenBox", | ||||
|       t: timestamp.toString() | ||||
|     }) | ||||
|   } | ||||
|   let params: string = `functionId=${fn}&body=${JSON.stringify(body)}&t=${timestamp}&appid=activities_platform&client=ios&clientVersion=3.1.0&cthr=1` | ||||
|   h5st && (params += `&h5st=${h5st}`) | ||||
|   return await post('https://api.m.jd.com/', params, { | ||||
|     'authority': 'api.m.jd.com', | ||||
|     'content-type': 'application/x-www-form-urlencoded', | ||||
|     'cookie': cookie, | ||||
|     'origin': 'https://h5platform.jd.com', | ||||
|     'referer': 'https://h5platform.jd.com/', | ||||
|     'user-agent': 'jdltapp;' | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| async function team(fn: string, body: object) { | ||||
|   let timestamp: number = Date.now(), h5st: string | ||||
|   h5st = h5stTool.__genH5st({ | ||||
|     appid: "activities_platform", | ||||
|     body: JSON.stringify(body), | ||||
|     client: "ios", | ||||
|     clientVersion: "3.1.0", | ||||
|     functionId: fn, | ||||
|     t: timestamp.toString() | ||||
|   }) | ||||
|   return await get(`https://api.m.jd.com/?functionId=${fn}&body=${encodeURIComponent(JSON.stringify(body))}&t=${timestamp}&appid=activities_platform&client=ios&clientVersion=3.1.0&cthr=1&h5st=${h5st}`, { | ||||
|     'Host': 'api.m.jd.com', | ||||
|     'User-Agent': 'jdltapp;', | ||||
|     'Origin': 'https://h5platform.jd.com', | ||||
|     'X-Requested-With': 'com.jd.jdlite', | ||||
|     'Referer': 'https://h5platform.jd.com/', | ||||
|     'Cookie': cookie | ||||
|   }) | ||||
| } | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -21,7 +21,7 @@ const querystring = require('querystring'); | ||||
| const exec = require('child_process').exec; | ||||
| const $ = new Env(); | ||||
| const timeout = 15000; //超时时间(单位毫秒)
 | ||||
| console.log("加载sendNotify,当前版本: 20220723"); | ||||
| console.log("加载sendNotify,当前版本: 20221118"); | ||||
| // =======================================go-cqhttp通知设置区域===========================================
 | ||||
| //gobot_url 填写请求地址http://127.0.0.1/send_private_msg
 | ||||
| //gobot_token 填写在go-cqhttp文件设置的访问密钥
 | ||||
| @ -1968,7 +1968,7 @@ function GetnickName() { | ||||
|                 Accept: "*/*", | ||||
|                 Connection: "keep-alive", | ||||
|                 Cookie: cookie, | ||||
|                 "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "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"), | ||||
|                 "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.42", | ||||
|                 "Accept-Language": "zh-cn", | ||||
|                 "Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&", | ||||
|                 "Accept-Encoding": "gzip, deflate, br" | ||||
| @ -2005,16 +2005,17 @@ function GetnickName() { | ||||
| function GetnickName2() { | ||||
|     return new Promise(async(resolve) => { | ||||
|         const options = { | ||||
|             url: `https://wxapp.m.jd.com/kwxhome/myJd/home.json?&useGuideModule=0&bizId=&brandId=&fromType=wxapp×tamp=${Date.now()}`, | ||||
|             headers: { | ||||
|                 Cookie: cookie, | ||||
|                 'content-type': `application/x-www-form-urlencoded`, | ||||
|                 Connection: `keep-alive`, | ||||
|                 'Accept-Encoding': `gzip,compress,br,deflate`, | ||||
|                 Referer: `https://servicewechat.com/wxa5bf5ee667d91626/161/page-frame.html`, | ||||
|                 Host: `wxapp.m.jd.com`, | ||||
|                 'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.10(0x18000a2a) NetType/WIFI Language/zh_CN`, | ||||
|             }, | ||||
|             "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, | ||||
|             "headers": { | ||||
|                 "Accept": "application/json,text/plain, */*", | ||||
|                 "Content-Type": "application/x-www-form-urlencoded", | ||||
|                 "Accept-Encoding": "gzip, deflate, br", | ||||
|                 "Accept-Language": "zh-cn", | ||||
|                 "Connection": "keep-alive", | ||||
|                 "Cookie": cookie, | ||||
|                 "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", | ||||
|                 "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "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") | ||||
|             } | ||||
|         }; | ||||
|         $.post(options, (err, resp, data) => { | ||||
|             try { | ||||
| @ -2023,13 +2024,12 @@ function GetnickName2() { | ||||
|                 } else { | ||||
|                     if (data) { | ||||
|                         data = JSON.parse(data); | ||||
|                         if (!data.user) { | ||||
| 						if (data['retcode'] === 13) { | ||||
|                             $.isLogin = false; //cookie过期
 | ||||
|                             return; | ||||
|                             return | ||||
|                         }                         | ||||
|                         const userInfo = data.user; | ||||
|                         if (userInfo) { | ||||
|                             $.nickName = userInfo.petName; | ||||
| 						if (data['retcode'] === 0) { | ||||
|                             $.nickName = (data['base'] && data['base'].nickname) || ""; | ||||
|                         } | ||||
|                     } else { | ||||
|                         $.log('京东服务器返回空数据'); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Faker
						Faker