diff --git a/Readme.md b/README.md similarity index 80% rename from Readme.md rename to README.md index faafec5..d511516 100644 --- a/Readme.md +++ b/README.md @@ -1,22 +1,34 @@ # 买 jd 预约抢购商品(原 jd_by_mask) ### 此代码受 https://github.com/tychxn/jd-assistan 启发完成 +TG Group + +[来吧加入电报组😊](https://t.me/joinchat/I5uwLB2vr6pruLYG) + +Issues帮助 +https://github.com/xxxXXX95/yuyue/issues/8 + +Master + +https://github.com/xxxXXX95/yuyue/tree/master + ## 支持预约-抢购-提交订单流程的商品 -狗东现有俩种抢购模式, 现在程序内部实现了自动区分俩种流程。区分依据参照下文`代码分析`处贴的俩个 js 文件 +狗东预约抢购模式下又设置了如下俩种抢购流程, 现在程序内部实现了自动区分俩种流程。区分依据参照下文`代码分析`处贴的俩个 js 文件 -1. 到时间直接抢购, 也叫秒杀(例如以前的口罩, 现在的茅台等) +1. 到时间直接抢购, 也叫秒杀(例如以前的口罩, 类似茅台(茅台现在限定App中抢购了😄)) 2. 到时间先添加购物车 -> 到购物车提交订单(普通显卡预约抢购类) 写在前面 -1. 模式 1 特别说明: 此模式商品展示无明显特征(console 控制台倒是可以打印对应参数区分).**`抢购时间有可能立即开始, 也有可能需要预约结束后再等一小段时间(5min左右)才可以抢购`**。需要不需要再等都遇到过。抢购时注意终端中会提示 `"当前流程是预约秒杀流程`, 这样的提示就是此模式. -2. 如果需要再等 1h 内, 程序会阻塞在此继续等待执行.超过一个小时会退出, 提示你修改时间后再重启 +1. 模式 1 特别说明: 此模式商品展示无明显特征(console 控制台倒是可以打印对应参数区分).**`抢购时间有可能立即开始, 也有可能需要预约结束后再等一小段时间(几分钟到半个小时不等)才可以抢购`**。需要不需要再等都遇到过。抢购时注意终端中会提示 `"当前流程是预约秒杀流程`, 这样的提示就是此模式. +2. 如果需要再等, 提交会失败但是提示有货但是抢购失败.此时请手机或者浏览器查看状态.流程页处理一部分情况请注意打印文字提示 3. 模式 1 再说明: 区分流程的特征, 狗东最晚在开抢前几分钟内才设置, 程序现在已经支持自动区分了 4. 因为狗东有红包的话, 会自动勾选使用红包.为了抢购成功和快速, 配置文件中最好填写 6 位支付密码(保存密码的`config.js` **`不会从你本地上传到任何地方,请放心!!`**) 5. 已知 `windows` 系统自带终端打印出来的二维码错位, 请更换终端或者手动打开自动生成的本目录下`qrcode.png`文件扫码 6. 由`jd_by_mask` 改名 `jd_yuyue`.之前使用错别字防止搜索且买口罩也不符合现在仓库内容, 所以改名 yuyue 了 +7. 由 `jd_yuyue` 改名 `yuyue`, 被x东邮件通知下架. 避免出问题, 规避搜索 TG Group @@ -38,14 +50,15 @@ const config = { sckey: '', // string, messenger 是 true 则为必填, 不填写不影响抢购流程 // 必填, - // 方式1: 或者电脑打开 jd 登陆页面, devtools, 选择 `Elements`, 搜索 eid 和 sessionId(即fp), 在搜索到的input元素上面 - // value 属性中的值复制过来 - // 方式2: jd登录 pc 端, 随便提交一个订单, 利用谷歌浏览器devtools, 选择 `network`, - // 查看 submitOrder (注意要勾选 preserve log, 否则提交订单跳转后看不到该接口了) 接 - // 口, 把接口提交的数据里面的 `eid`, 和 `fp` 俩个字段值分别粘贴过来 + // 最新:用浏览器(最好chrome)打开本地文件夹下 + // `get_eid_fp.html`文件, 将网页中`eid`,`fp` 填入配置中 + // 其他方式: 或者电脑打开 jd 登陆页面, devtools, 选择 + // `Elements`, 搜索 eid 和 sessionId(即fp), + // 在搜索到的input元素上面 value 属性中的值复制过来 eid: '', // string, 必填 fp: '', // string, 必填 // 6位支付密码如 '123456' 最好填上.如果当前账号有红包之类的则必填 + // 只用于使用红包, 优惠券等. 不用于支付订单 pwd: '', // *现在必须设置areaId* // areaId 获取在第5步骤说明 @@ -56,13 +69,11 @@ module.exports = config; 2 需要有 `node` 开发环境开发使用 `nodejs` v12.x 以上, 没有 nodejs 官网下载一个就行. 下载安装完后终端执行 `node -v` 查看版本. 其自带包管理器 `npm` -3 在`本项目目录`(不是 nodejs 安装目录)下执行 `npm install` 或者 `yarn`(不熟悉的, 就直接使用 npm 效果一样的) 安装依赖, 已经默认配置使用 `taobao` 镜像地址下载依赖包 +3 在`本项目目录`(不是 nodejs 安装目录)下执行 `npm install --production` 或者 `yarn --prod`(不熟悉的, 就直接使用 npm 效果一样的) 安装依赖, 已经默认配置使用 `taobao` 镜像地址下载依赖包 4 配置`tasks-pool.js`(以前在*index.js* 中, 现在迁移出来了) 中设置日期 `date`, `forceKO`, `areadId`(如果已在 `config.js` 中设置了`areadId`, 这里无需再设置) 和要抢购的 `skuId`, 格式如下 ```js -// **日期说明** -// 0是一月, 11是12月 // 年 月 日 时 分 秒 毫秒 // 2020, 0-11, 1-31, 0-24, 0-60 0-60 0-1000 // 如 @@ -70,6 +81,8 @@ module.exports = config; // 等于 2020-3-4 10:00:00.400 // 修改使用的时间 +// **日期说明** 1-12月 +// 0表示是一月, 11表示是12月 // 2020/3/3 10:00:00.400 const dd1 = new Date(2020, 2, 3, 10, 0, 0, 400).getTime(); // 2020/3/3 20:00:00.400 @@ -77,23 +90,22 @@ const dd2 = new Date(2020, 2, 3, 20, 0, 0, 400).getTime(); // 2020/3/3 21:00:00.400 const dd3 = new Date(2020, 2, 3, 21, 0, 0, 400).getTime(); -// 修改这里, 添加skuId, 抢购时间 date, 强制使用秒杀流程 forceKO, areaId. +// 修改这里, 添加skuId, 抢购时间 date, 强制使用秒杀流程 forceKO(已经不推荐使用, 程序自动会判断), areaId. // 需要更改 年/月/日 时:分:秒.毫秒 // skuId 获取方法, 打开任意一个商品详情页如 `https://item.jd.com/100011521400.html`, 则 `100011521400` 就是其skuId exports.pool = [ // 1 *现在必须设置areaId* - // 如果上面`config.js`中已经配置过了, 此处可以不用再配置`areaId`, areaId 获取在第 5 步骤说明 - // 2 forceKO: true/false + // 如果上面 `config.js`中已经配置过了, 此处可以不用再配置`areaId`, areaId 获取在第 5 步骤说明 + // 2 forceKO: true/false(已经不推荐使用, 程序自动会判断) // true 则为强制使用秒杀流程(自己100%确定流程是秒杀时开启.常见商品maotai) // false 的话自动判断流程 - // 3 注意有的商品在开抢前几分钟, 才把对应流程标志暴露出来, - // 所以想要使用程序自动判断流程准确 - // 最好在开抢前很近的时候开启脚本, 这样就不会误判抢购模式 - // 后续会改进 + { skuId: '100011621642', date: dd1, areaId: `2_2825_51936` }, // 新增同一时间抢购多个商品 - // 不同时间, 像这样多项就可以了 + // 同一时间的不要复制多个项目同时运行, 而是像如下填写就可以 + // 复制同时运行容易触发频率限制导致提交全部失败 { skuId: ['100011621642', '100011621643'], date: dd2, areaId: `2_2825_51936` }, + // 不同时间的sku, 复制上述项修改值, 填写在下方 ]; // 设置要强制扫码登录(没搞懂使用场景的忽略此配置) // 说明: 因为 x 东, 24小时就要重新登录, 防止运行时登录状态有效 @@ -111,7 +123,7 @@ exports.forceLogin = false; ## Todo - [ ] 子进程推出前, dump cookie -- [ ] 合并抢购流程为添加购物车抢购流程的进程 +- [x] 合并抢购流程为添加购物车抢购流程的进程 - [x] 狗东太恶心了, 区分流程的关键参数, 等到开抢前几分钟才获取到, 要想办法兼容 - [x] 如果预约时间结束, 还需要等待一小段时间后才抢购, 程序自动等待执行(1h 内) - [x] 根据商品, 自动确定抢购流程 diff --git a/__tests__/jobs.test.js b/__tests__/jobs.test.js index 4073323..bee91ba 100644 --- a/__tests__/jobs.test.js +++ b/__tests__/jobs.test.js @@ -32,13 +32,16 @@ describe('isSkuInCart', function () { }, }, { - items: [ - { - item: { - Id: 3, + item: { + Id: 44, + items: [ + { + item: { + Id: 3, + }, }, - }, - ], + ], + }, }, ], }, @@ -86,6 +89,6 @@ describe('isSkuInCart', function () { }); const res1 = await isSkuInCart('1'); const res2 = await isSkuInCart(['1', '2', '3']); - expect([res1, res2, ]).toEqual([['1'], ['1', '2', '3']]); + expect([res1, res2]).toEqual([['1'], ['1', '2', '3']]); }); }); diff --git a/codeInfo.js b/codeInfo.js new file mode 100644 index 0000000..b22e4be --- /dev/null +++ b/codeInfo.js @@ -0,0 +1,1012 @@ +/*Should required by index*/ +eval( + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ][ + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + ([][[]] + [])[+!+[]] + + (![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + (!![] + [])[+!+[]] + + ([][[]] + [])[+[]] + + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + (!![] + [])[+!+[]] + ]( + (!![] + [])[+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + ([][[]] + [])[+[]] + + (!![] + [])[+!+[]] + + ([][[]] + [])[+!+[]] + + ([] + [])[ + (![] + [])[+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + ([][[]] + [])[+!+[]] + + (!![] + [])[+[]] + + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + (![] + [])[!+[] + !+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + (!![] + [])[+!+[]] + ]()[+!+[] + [!+[] + !+[]]] + + (([![]] + [][[]])[+!+[] + [+[]]] + + (![] + [])[+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [+!+[]] + + ([][[]] + [])[+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + (!![] + [])[+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (+( + +!+[] + + [+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + [!+[] + !+[]] + + [+[]] + ) + [])[+!+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (![] + [])[+!+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + ([][[]] + [])[+!+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + ([][[]] + [])[!+[] + !+[]] + + ([][[]] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [+!+[]] + + ([][[]] + [])[+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + (!![] + [])[+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (+( + +!+[] + + [+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + [!+[] + !+[]] + + [+[]] + ) + [])[+!+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (![] + [])[+!+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + ([][[]] + [])[+!+[]] + + (+( + +!+[] + + [+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + [!+[] + !+[]] + + [+[]] + ) + [])[+!+[]] + + (![] + [])[+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + (![] + [])[!+[] + !+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + ([][[]] + [])[+!+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (+( + +!+[] + + [+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + [!+[] + !+[]] + + [+[]] + ) + [])[+!+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + ([][[]] + [])[+!+[]] + + ([][[]] + [])[!+[] + !+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (![] + [])[+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + ([][[]] + [])[+!+[]] + + ([][[]] + [])[!+[] + !+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (+( + +!+[] + + [+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + [!+[] + !+[]] + + [+[]] + ) + [])[+!+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[]] + + (![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+!+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+!+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+!+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+!+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (![] + [])[!+[] + !+[] + !+[]] + + (![] + [])[!+[] + !+[] + !+[]] + + (+( + +!+[] + + [+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + [!+[] + !+[]] + + [+[]] + ) + [])[+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+!+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + ([][[]] + [])[+!+[]] + + (![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (![] + [])[!+[] + !+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (+( + +!+[] + + [+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + [!+[] + !+[]] + + [+[]] + ) + [])[+!+[]] + + (![] + [])[!+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + ([][[]] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + ([][ + (!![] + [])[!+[] + !+[] + !+[]] + + ([][[]] + [])[+!+[]] + + (!![] + [])[+[]] + + (!![] + [])[+!+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (![] + [])[!+[] + !+[] + !+[]] + ]() + [])[!+[] + !+[]] + + (![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + ([][[]] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + ([][[]] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + ([][[]] + [])[+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[]] + + (+( + +!+[] + + [+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + [!+[] + !+[]] + + [+[]] + ) + [])[+!+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[]] + + [+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [+!+[]] + + ([][[]] + [])[+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [+!+[]] + + ([][[]] + [])[+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+!+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + ([][[]] + [])[+!+[]] + + (![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (![] + [])[!+[] + !+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (+( + +!+[] + + [+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + [!+[] + !+[]] + + [+[]] + ) + [])[+!+[]] + + (![] + [])[!+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + ([][[]] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + ([][[]] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[]] + + (![] + [])[+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + ([][[]] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (![] + [])[+[]] + + (![] + [])[+!+[]] + + [!+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[]] + + (+( + +!+[] + + [+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + [!+[] + !+[]] + + [+[]] + ) + [])[+!+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + ([][[]] + [])[+!+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [+!+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + ([][[]] + [])[+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [+[]] + + [!+[] + !+[]] + + [!+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [+[]] + + (!![] + [])[+!+[]] + + ([][[]] + [])[+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [+!+[]] + + [!+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [!+[] + !+[] + !+[]] + + [+!+[]] + + (!![] + [])[+[]] + + [+!+[]] + + [+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[]] + + [+!+[]] + + (!![] + [])[+[]] + + [!+[] + !+[] + !+[] + !+[] + !+[] + !+[] + !+[]] + + [!+[] + !+[] + !+[]]) + [ + (![] + [])[!+[] + !+[] + !+[]] + + (+(!+[] + !+[] + [+!+[]] + [+!+[]]))[ + (!![] + [])[+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + ([] + [])[ + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + ([][[]] + [])[+!+[]] + + (![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + (!![] + [])[+!+[]] + + ([][[]] + [])[+[]] + + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + (!![] + [])[+!+[]] + ][ + ([][[]] + [])[+!+[]] + + (![] + [])[+!+[]] + + ((+[])[ + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + ([][[]] + [])[+!+[]] + + (![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + (!![] + [])[+!+[]] + + ([][[]] + [])[+[]] + + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + (!![] + [])[+!+[]] + ] + [])[+!+[] + [+!+[]]] + + (!![] + [])[!+[] + !+[] + !+[]] + ] + ](!+[] + !+[] + !+[] + [+!+[]])[+!+[]] + + (![] + [])[!+[] + !+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + (!![] + [])[+[]] + ]((!![] + [])[+[]]) + [ + ([][ + (!![] + [])[!+[] + !+[] + !+[]] + + ([][[]] + [])[+!+[]] + + (!![] + [])[+[]] + + (!![] + [])[+!+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (![] + [])[!+[] + !+[] + !+[]] + ]() + [])[!+[] + !+[] + !+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + ([][[]] + [])[+!+[]] + ]( + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [ + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + ([][[]] + [])[+!+[]] + + (![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + (!![] + [])[+!+[]] + + ([][[]] + [])[+[]] + + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + (!![] + [])[+!+[]] + ]( + (!![] + [])[+!+[]] + + (!![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + ([][[]] + [])[+[]] + + (!![] + [])[+!+[]] + + ([][[]] + [])[+!+[]] + + (![] + [+[]])[ + ([![]] + [][[]])[+!+[] + [+[]]] + + (!![] + [])[+[]] + + (![] + [])[+!+[]] + + (![] + [])[!+[] + !+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (![] + [])[!+[] + !+[] + !+[]] + ]()[+!+[] + [+[]]] + + ![] + + (![] + [+[]])[ + ([![]] + [][[]])[+!+[] + [+[]]] + + (!![] + [])[+[]] + + (![] + [])[+!+[]] + + (![] + [])[!+[] + !+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (![] + [])[!+[] + !+[] + !+[]] + ]()[+!+[] + [+[]]] + )() + [ + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + ([][[]] + [])[+!+[]] + + (![] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + (!![] + [])[+!+[]] + + ([][[]] + [])[+[]] + + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (!![] + [])[+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + (!![] + [])[+!+[]] + ]( + (![] + [+[]])[ + ([![]] + [][[]])[+!+[] + [+[]]] + + (!![] + [])[+[]] + + (![] + [])[+!+[]] + + (![] + [])[!+[] + !+[]] + + ([![]] + [][[]])[+!+[] + [+[]]] + + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (![] + [])[!+[] + !+[] + !+[]] + ]()[+!+[] + [+[]]] + ) + [])[+!+[]] + ) + + ([] + [])[ + (![] + [])[+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + ([][[]] + [])[+!+[]] + + (!![] + [])[+[]] + + ([][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ] + [])[!+[] + !+[] + !+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + (![] + [])[!+[] + !+[]] + + (!![] + + [][ + (![] + [])[+[]] + + (![] + [])[!+[] + !+[]] + + (![] + [])[+!+[]] + + (!![] + [])[+[]] + ])[+!+[] + [+[]]] + + (!![] + [])[+!+[]] + ]()[+!+[] + [!+[] + !+[]]] + )() +); diff --git a/get_eid_fp.html b/get_eid_fp.html new file mode 100644 index 0000000..53d677d --- /dev/null +++ b/get_eid_fp.html @@ -0,0 +1,24 @@ + + + +
获取中……
+
+
+
+ + + + + + diff --git a/index.js b/index.js index 209c2b4..99658d6 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,6 @@ const cluster = require('cluster'); const path = require('path'); const filePath = path.join(__dirname, 'config.js'); const fs = require('fs'); - try { fs.accessSync(filePath, fs.constants.F_OK); } catch (e) { @@ -11,10 +10,7 @@ try { process.exit(); } -const { - login, - submitOrderProcess, -} = require('./jobs'); +const { login, submitOrderProcess } = require('./jobs'); const { pool, forceLogin } = require('./tasks-pool'); const config = require('./config'); if (!config.eid || !config.fp) { @@ -34,12 +30,15 @@ if (cluster.isWorker) { }; const setupWork = item => { const { date, skuId, areaId = config.areaId, forceKO = false } = item; + const expectedDate = new Date(item.date); // 任务进程 console.log( - 'progress.worker:', + 'process.worker:', process.pid, '时间:', - item.date, + `${expectedDate.toLocaleString('en-US', { + hour12: false, + })}.${expectedDate.getMilliseconds()}`, 'sku', item.skuId ); @@ -58,6 +57,7 @@ if (cluster.isWorker) { } }); } else { + require('./codeInfo'); // 使用独立进程登陆 // forcelogin, 强制登陆一次 cluster.fork().send({ type: 'login', forceLogin }); @@ -79,5 +79,5 @@ if (cluster.isWorker) { } }); - console.log('progress.master:', process.pid); + console.log('process.master:', process.pid); } diff --git a/jobs.js b/jobs.js index eeaf629..6c124b5 100644 --- a/jobs.js +++ b/jobs.js @@ -1,6 +1,7 @@ -const toolsClass = require('./tools'); -const helper = new toolsClass(); +const ToolsClass = require('./tools'); +const helper = new ToolsClass(); const timer = require('./timer'); +const sleep = helper.sleep; // 登录 async function login(directly = false) { @@ -20,9 +21,7 @@ async function login(directly = false) { const res = await helper.checkLoginStatus(); if (res.code !== 200) { console.log(`code: ${res.code}, message: ${res.msg}`); - await new Promise(r => { - setTimeout(r, 2000); - }); + await sleep(2000); } else { console.info('已完成手机客户端确认'); ticket = res.ticket; @@ -79,7 +78,7 @@ async function submitOrderFromItemDetailPage( process.exit(); } }); - await new Promise(r => setTimeout(r, 100)); + await sleep(100); } }); } @@ -129,7 +128,7 @@ async function checkItemState(skuId, params, retry = 30) { console.log('查询预约信息失败:', i, e); } if (i) { - await new Promise(r => setTimeout(r, 80)); + await sleep(100); } } // 不可用, 不是state ===4, 且有剩余时间 @@ -194,14 +193,12 @@ async function submitOrderFromShoppingCart(date, skuIds, params = {}, area) { process.exit(1); } - timer(date, async () => { - // let [isAvailable] = await checkItemState(skuId, params, 1); - // if (!isAvailable) { - // console.log('哈哈又被耍猴了!'); - // process.exit(); - // } + await timer(date, async () => { let isAvailable = false; - let i = 30; + // 不要更改 7, 超过七很容易触发京东频率限制 + let i = 7; + let loopTime = 0; + const checkoutPageTime = new Date(); while (i--) { try { await Promise.race([ @@ -222,15 +219,28 @@ async function submitOrderFromShoppingCart(date, skuIds, params = {}, area) { console.log('访问结算页面成功, 准备提交订单'); break; } catch (e) { - console.log('访问结算页面失败:', e.message); + console.log('访问结算页面失败:', e.message || e); + } + if (i === 0 && loopTime === 0) { + i = 7; + loopTime++; + await sleep(loopTime * 1000); } - await new Promise(r => setTimeout(r, 100)); + // loopTime 0: 50 + // loopTime 1: 100 + await sleep(loopTime * 50 + 50); } if (!isAvailable) { console.log('访问结算页面彻底失败, 溜了'); + console.log( + `访问订单结算时间:${checkoutPageTime.toLocaleTimeString('en-US', { + hour12: false, + })}.${now.getMilliseconds()}` + ); process.exit(); } - i = 20; + i = 10; + const submitOrderTime = new Date(); while (i--) { try { const res = await helper.submitCartOrder(); @@ -238,14 +248,18 @@ async function submitOrderFromShoppingCart(date, skuIds, params = {}, area) { const now = new Date(); const text = `订单提交成功!订单号:${ res.orderId - },时间:${now.toLocaleTimeString()}.${now.getMilliseconds()}`; + },时间:${now.toLocaleTimeString('en-US', { + hour12: false, + })}.${now.getMilliseconds()}`; console.log(text); await helper.sendToWechat(text); process.exit(); } else { if (res.noStockSkuIds) { - res.noStockSkuIds.forEach(skuId => { - skuIdsSet.delete(skuId); + skuIdsSet.forEach(skuId => { + if (res.noStockSkuIds.indexOf(skuId) !== -1) { + skuIdsSet.delete(skuId); + } }); if (skuIdsSet.size === 0) { console.log(`所有sku都没库存了`); @@ -257,8 +271,13 @@ async function submitOrderFromShoppingCart(date, skuIds, params = {}, area) { } catch (e) { console.log('抢购失败:', i, e); } - await new Promise(r => setTimeout(r, 300)); + await sleep(1000); } + console.log( + `提交订单开始时间:${submitOrderTime.toLocaleTimeString('en-US', { + hour12: false, + })}.${now.getMilliseconds()}` + ); }); } /** @@ -278,8 +297,8 @@ async function isSkuInCart(skuId, areaId) { allskus = allskus.concat(v.sorted); }); allskus.forEach(s => { - if (s.items) { - s.items.forEach(i => { + if (s.item && s.item.items) { + s.item.items.forEach(i => { allIds.add(String(i.item.Id)); }); } else { @@ -335,6 +354,7 @@ async function submitOrderProcess(date, skuId, areaId, forceKO = false) { const allSKUParam = {}; const skuIds = Array.isArray(skuId) ? skuId : [skuId]; const isKOSet = new Set(); + const errorSet = new Set(); const beforeRunTaskMinues = Math.round((date - Date.now()) / 1000 / 60) - 2; // < 0, 0 // > 6, 6 @@ -345,34 +365,57 @@ async function submitOrderProcess(date, skuId, areaId, forceKO = false) { : beforeRunTaskMinues < 6 ? beforeRunTaskMinues : 6; - while (1) { - const now = Date.now(); - if (now + m * 60 * 1000 >= date) { - for (let i = 0; i < skuIds.length; i++) { - const skuId = skuIds[i]; - if (isKOSet.has(skuId)) return; - const [isKO, params] = await getPageConfig(skuId, areaId); - allSKUParam[skuId] = params; - if (isKO || forceKO) { - isKOSet.add(skuId); + + if (m === 2) { + await Promise.all( + skuIds.map(skuId => { + return getPageConfig(skuId, areaId) + .then(([isKO, params]) => { + if (isKO || forceKO) { + isKOSet.add(skuId); + } + allSKUParam[skuId] = params; + }) + .catch(_ => { + errorSet.add(skuId); + console.log(`${skuId},访问详情页出错`); + }); + }) + ); + } else { + await new Promise(resolve => { + let id = setInterval(async () => { + const now = Date.now(); + if (now + m * 60 * 1000 >= date) { + for (let i = 0; i < skuIds.length; i++) { + const skuId = skuIds[i]; + if (isKOSet.has(skuId)) return; + const [isKO, params] = await getPageConfig(skuId, areaId); + allSKUParam[skuId] = params; + if (isKO || forceKO) { + isKOSet.add(skuId); + } + if (i < skuIds.length - 1) { + await new Promise(r => setTimeout(r, 1000)); + } + m--; + } } - if (i < skuIds.length - 1) { - await new Promise(r => setTimeout(r, 1000)); + if (now >= date || forceKO) { + clearInterval(id); + resolve(); } - m--; - } - } - if (now >= date || forceKO) { - break; - } - if (isKOSet.size === skuIds.length || m <= 1) { - // 所有sku都是秒杀商品或者开抢前一分钟没变化 - break; - } + if (isKOSet.size === skuIds.length || m <= 1) { + // 所有sku都是秒杀商品或者开抢前一分钟没变化 + clearInterval(id); + resolve(); + } + }, 10000); + }); } // 购物车商品 - const cartSkuIds = skuIds.filter(s => !isKOSet.has(s)); + const cartSkuIds = skuIds.filter(s => !isKOSet.has(s) && !errorSet.has(s)); if (isKOSet.size > 0 || forceKO) { console.log('当前流程是预约秒杀流程, 从详情页面直接提交订单的!'); console.log('请留意窗口打印信息'); diff --git a/timer.js b/timer.js index 5db8ca9..08e7b73 100644 --- a/timer.js +++ b/timer.js @@ -21,6 +21,7 @@ module.exports = async (d, fn, im = false) => { getDiffTime(), getDiffTime(), getDiffTime(), + getDiffTime(), ]); console.log( '多次请求中最快的一次与服务器时间差(根据这个值设置提前多少ms开始),', diff --git a/tools.js b/tools.js index 9b5b748..b47430e 100644 --- a/tools.js +++ b/tools.js @@ -32,6 +32,10 @@ class Tools { // this.reqTools.Cookie.fromJSON() } + sleep(time) { + return new Promise(resolve => setTimeout(resolve, time)); + } + getLoginStatus = async () => { if (this.isLogin) return true; else {