├── .gitignore ├── LICENSE ├── README.md ├── USER_AGENTS.js ├── backup ├── img.png ├── img1.png ├── img3.png ├── jd_card_collecting_common_enc.js ├── jd_draw_new-common_enc.js ├── jd_follow_common_enc.js ├── jd_game_common_enc.js ├── jd_opencard_teamBean_1600_common_enc.js ├── jd_opencard_teamBean_common_enc.js ├── jd_refresh_wskey_enc.js ├── jd_share_common_enc.js ├── ks.js └── wskey.js ├── code_tsukasa.sh ├── jdCookie.js ├── jd_GuangHaoWu_enc.js ├── package.json ├── report.json ├── sendNotify.js ├── sendNotify.py ├── smzdm_mission.js └── tmp.json /.gitignore: -------------------------------------------------------------------------------- 1 | ### Example user template template 2 | ### Example user template 3 | 4 | # IntelliJ project files 5 | .idea 6 | *.iml 7 | out 8 | gen 9 | node_modules 10 | pnpm-lock.yaml 11 | ### Example user template template 12 | ### Example user template 13 | 14 | jdCookie.js 15 | magic.json 16 | JDCookies.txt 17 | activeId.py 18 | app.* 19 | package-lock.json 20 | jdCookie_bak.js 21 | jdCookieOK.js 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # my_script 2 | 學習自動化 3 | -------------------------------------------------------------------------------- /USER_AGENTS.js: -------------------------------------------------------------------------------- 1 | const USER_AGENTS = [ 2 | 'jdltapp;iPhone;3.1.0;14.1;59d6ae6e8387bd09fe046d5b8918ead51614e80a;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone12,1;hasOCPay/0;appBuild/1017;supportBestPay/0;addressid/;pv/1.26;apprpd/;ref/JDLTSubMainPageViewController;psq/0;ads/;psn/59d6ae6e8387bd09fe046d5b8918ead51614e80a|3;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 3 | 'jdltapp;iPhone;3.1.0;13.5;22d679c006bf9c087abf362cf1d2e0020ebb8798;network/wifi;ADID/10857A57-DDF8-4A0D-A548-7B8F43AC77EE;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone12,1;addressid/2378947694;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/15.7;apprpd/Allowance_Registered;ref/JDLTTaskCenterViewController;psq/6;ads/;psn/22d679c006bf9c087abf362cf1d2e0020ebb8798|22;jdv/0|kong|t_1000170135|tuiguang|notset|1614153044558|1614153044;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 4 | 'jdltapp;iPhone;3.1.0;14.3;d7beab54ae7758fa896c193b49470204fbb8fce9;network/4g;ADID/97AD46C9-6D49-4642-BF6F-689256673906;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 5 | 'jdltapp;iPhone;2.1.0;14.4;eb5a9e7e596e262b4ffb3b6b5c830984c8a5c0d5;network/wifi;ADID/5603541B-30C1-4B5C-A782-20D0B569D810;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,2;addressid/1041002757;hasOCPay/0;appBuild/101;supportBestPay/0;pv/34.6;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/5;ads/;psn/eb5a9e7e596e262b4ffb3b6b5c830984c8a5c0d5|44;jdv/0|androidapp|t_335139774|appshare|CopyURL|1612612940307|1612612944;adk/;app_device/IOS;pap/JA2020_3112531|2.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 6 | 'jdltapp;iPhone;3.1.0;14.3;21631ed983b3e854a3154b0336413825ad0d6783;network/3g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,4;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.47;apprpd/;ref/JDLTSubMainPageViewController;psq/8;ads/;psn/21631ed983b3e854a3154b0336413825ad0d6783|9;jdv/0|direct|-|none|-|1614150725100|1614225882;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 7 | 'jdltapp;iPhone;3.1.0;13.5;500a795cb2abae60b877ee4a1930557a800bef1c;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone8,1;addressid/669949466;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/9.11;apprpd/;ref/JDLTSubMainPageViewController;psq/10;ads/;psn/500a795cb2abae60b877ee4a1930557a800bef1c|11;jdv/;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 8 | 'jdltapp;iPhone;3.1.0;14.4;19fef5419f88076c43f5317eabe20121d52c6a61;network/wifi;ADID/00000000-0000-0000-0000-000000000000;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,8;addressid/3430850943;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/10.4;apprpd/;ref/JDLTSubMainPageViewController;psq/3;ads/;psn/19fef5419f88076c43f5317eabe20121d52c6a61|16;jdv/0|kong|t_1001327829_|jingfen|f51febe09dd64b20b06bc6ef4c1ad790#/|1614096460311|1614096511;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', 9 | 'jdltapp;iPhone;3.1.0;12.2;f995bc883282f7c7ea9d7f32da3f658127aa36c7;network/4g;ADID/9F40F4CA-EA7C-4F2E-8E09-97A66901D83E;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,4;addressid/525064695;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/11.11;apprpd/;ref/JDLTSubMainPageViewController;psq/2;ads/;psn/f995bc883282f7c7ea9d7f32da3f658127aa36c7|22;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 12.2;Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 10 | 'jdltapp;iPhone;3.1.0;14.4;4e6b46913a2e18dd06d6d69843ee4cdd8e033bc1;network/3g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,2;addressid/666624049;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/54.11;apprpd/MessageCenter_MessageMerge;ref/MessageCenterController;psq/10;ads/;psn/4e6b46913a2e18dd06d6d69843ee4cdd8e033bc1|101;jdv/0|kong|t_2010804675_|jingfen|810dab1ba2c04b8588c5aa5a0d44c4bd|1614183499;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 11 | 'jdltapp;iPhone;3.1.0;14.2;c71b599e9a0bcbd8d1ad924d85b5715530efad06;network/wifi;ADID/751C6E92-FD10-4323-B37C-187FD0CF0551;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,8;addressid/4053561885;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/263.8;apprpd/;ref/JDLTSubMainPageViewController;psq/2;ads/;psn/c71b599e9a0bcbd8d1ad924d85b5715530efad06|481;jdv/0|kong|t_1001610202_|jingfen|3911bea7ee2f4fcf8d11fdf663192bbe|1614157052210|1614157056;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.2;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 12 | 'jdltapp;iPhone;3.1.0;14.4;2d306ee3cacd2c02560627a5113817ebea20a2c9;network/4g;ADID/A346F099-3182-4889-9A62-2B3C28AB861E;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,3;hasOCPay/0;appBuild/1017;supportBestPay/0;addressid/;pv/1.35;apprpd/Allowance_Registered;ref/JDLTTaskCenterViewController;psq/0;ads/;psn/2d306ee3cacd2c02560627a5113817ebea20a2c9|2;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 13 | 'jdltapp;iPhone;3.1.0;14.4;28355aff16cec8bcf3e5728dbbc9725656d8c2c2;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,2;addressid/833058617;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.10;apprpd/;ref/JDLTWebViewController;psq/9;ads/;psn/28355aff16cec8bcf3e5728dbbc9725656d8c2c2|5;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 14 | 'jdltapp;iPhone;3.1.0;13.5;24ddac73a3de1b91816b7aedef53e97c4c313733;network/4g;ADID/598C6841-76AC-4512-AA97-CBA940548D70;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone11,6;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/12.6;apprpd/;ref/JDLTSubMainPageViewController;psq/5;ads/;psn/24ddac73a3de1b91816b7aedef53e97c4c313733|23;jdv/0|kong|t_1000170135|tuiguang|notset|1614126110904|1614126110;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 15 | 'jdltapp;iPhone;3.1.0;14.4;d7732ba60c8ff73cc3f5ba7290a3aa9551f73a1b;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone12,1;addressid/25239372;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/8.6;apprpd/;ref/JDLTSubMainPageViewController;psq/5;ads/;psn/d7732ba60c8ff73cc3f5ba7290a3aa9551f73a1b|14;jdv/0|kong|t_1001226363_|jingfen|5713234d1e1e4893b92b2de2cb32484d|1614182989528|1614182992;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 16 | 'jdltapp;iPhone;3.1.0;14.4;ca1a32afca36bc9fb37fd03f18e653bce53eaca5;network/wifi;ADID/3AF380AB-CB74-4FE6-9E7C-967693863CA3;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone8,1;addressid/138323416;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/72.12;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/ca1a32afca36bc9fb37fd03f18e653bce53eaca5|109;jdv/0|kong|t_1000536212_|jingfen|c82bfa19e33a4269a5884ffc614790f4|1614141246;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 17 | 'jdltapp;iPhone;3.1.0;14.4;78fc1d919de0c8c2de15725eff508d8ab14f9c82;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,1;addressid/137829713;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/23.11;apprpd/;ref/JDLTSubMainPageViewController;psq/10;ads/;psn/78fc1d919de0c8c2de15725eff508d8ab14f9c82|34;jdv/0|iosapp|t_335139774|appshare|Wxfriends|1612508702380|1612534293;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 18 | 'jdltapp;iPhone;3.1.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,2;addressid/138419019;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/5.7;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/6;ads/;psn/4ee6af0db48fd605adb69b63f00fcbb51c2fc3f0|9;jdv/0|direct|-|none|-|1613705981655|1613823229;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 19 | 'jdltapp;iPhone;3.1.0;14.3;network/wifi;ADID/F9FD7728-2956-4DD1-8EDD-58B07950864C;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,1;addressid/1346909722;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/30.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/40d4d4323eb3987226cae367d6b0d8be50f2c7b3|39;jdv/0|kong|t_1000252057_0|tuiguang|eba7648a0f4445aa9cfa6f35c6f36e15|1613995717959|1613995723;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 20 | 'jdltapp;iPhone;3.1.0;14.4;network/wifi;ADID/5D306F0D-A131-4B26-947E-166CCB9BFFFF;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,6;addressid/138164461;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/7.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/d40e5d4a33c100e8527f779557c347569b49c304|7;jdv/0|kong|t_1001226363_|jingfen|3bf5372cb9cd445bbb270b8bc9a34f00|1608439066693|1608439068;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 21 | 'jdltapp;iPhone;3.1.0;14.3;network/wifi;ADID/31548A9C-8A01-469A-B148-E7D841C91FD0;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/10.5;apprpd/;ref/JDLTSubMainPageViewController;psq/4;ads/;psn/a858fb4b40e432ea32f80729916e6c3e910bb922|12;jdv/0|direct|-|none|-|1613898710373|1613898712;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 22 | 'jdltapp;iPhone;3.1.0;13.5;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,2;addressid/2237496805;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/13.6;apprpd/;ref/JDLTSubMainPageViewController;psq/5;ads/;psn/48e495dcf5dc398b4d46b27e9f15a2b427a154aa|15;jdv/0|direct|-|none|-|1613354874698|1613952828;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 23 | 'jdltapp;iPhone;3.1.0;14.4;6d343c58764a908d4fa56609da4cb3a5cc1396d3;network/wifi;ADID/4965D884-3E61-4C4E-AEA7-9A8CE3742DA7;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,1;addressid/70390480;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.24;apprpd/MyJD_Main;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fafter%2Findex.action%3FcategoryId%3D600%26v%3D6%26entry%3Dm_self_jd;psq/4;ads/;psn/6d343c58764a908d4fa56609da4cb3a5cc1396d3|17;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 24 | 'jdltapp;iPhone;3.1.0;13.6.1;4606ddccdfe8f343f8137de7fea7f91fc4aef3a3;network/4g;ADID/C6FB6E20-D334-45FA-818A-7A4C58305202;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone10,1;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/5.9;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/8;ads/;psn/4606ddccdfe8f343f8137de7fea7f91fc4aef3a3|5;jdv/0|iosapp|t_335139774|liteshare|Qqfriends|1614206359106|1614206366;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 13.6.1;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 25 | 'jdltapp;iPhone;3.1.0;14.4;3b6e79334551fc6f31952d338b996789d157c4e8;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,1;addressid/138051400;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/14.34;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/12;ads/;psn/3b6e79334551fc6f31952d338b996789d157c4e8|46;jdv/0|kong|t_1001707023_|jingfen|e80d7173a4264f4c9a3addcac7da8b5d|1613837384708|1613858760;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 26 | 'jdltapp;iPhone;3.1.0;14.3;c2a8854e622a1b17a6c56c789f832f9d78ef1ba7;network/wifi;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone12,5;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/3.9;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/8;ads/;psn/c2a8854e622a1b17a6c56c789f832f9d78ef1ba7|6;jdv/0|direct|-|none|-|1613541016735|1613823566;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.3;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 | 'jdltapp;iPhone;3.1.0;14.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 28 | 'jdltapp;iPhone;3.1.0;14.4;network/3g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 29 | 'jdltapp;iPhone;3.1.0;14.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', 30 | 'jdltapp;iPhone;3.1.0;13.5;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone8,1;addressid/669949466;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/9.11;apprpd/;ref/JDLTSubMainPageViewController;psq/10;ads/;psn/500a795cb2abae60b877ee4a1930557a800bef1c|11;jdv/;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 31 | 'jdltapp;iPhone;3.1.0;14.3;network/3g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,4;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.47;apprpd/;ref/JDLTSubMainPageViewController;psq/8;ads/;psn/21631ed983b3e854a3154b0336413825ad0d6783|9;jdv/0|direct|-|none|-|1614150725100|1614225882;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 32 | 'jdltapp;iPhone;3.1.0;14.3;network/3g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,4;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.47;apprpd/;ref/JDLTSubMainPageViewController;psq/8;ads/;psn/21631ed983b3e854a3154b0336413825ad0d6783|9;jdv/0|direct|-|none|-|1614150725100|1614225882;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 33 | 'jdltapp;iPhone;3.1.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/3.15;apprpd/;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fchat%2Findex.action%3Fentry%3Djd_m_JiSuCommodity%26pid%3D7763388%26lng%3D118.159665%26lat%3D24.504633%26sid%3D31cddc2d58f6e36bf2c31c4e8a79767w%26un_area%3D16_1315_3486_0;psq/12;ads/;psn/c10e0db6f15dec57a94637365f4c3d43e05bbd48|4;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 34 | 'jdltapp;iPhone;3.1.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/3.15;apprpd/;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fchat%2Findex.action%3Fentry%3Djd_m_JiSuCommodity%26pid%3D7763388%26lng%3D118.159665%26lat%3D24.504633%26sid%3D31cddc2d58f6e36bf2c31c4e8a79767w%26un_area%3D16_1315_3486_0;psq/12;ads/;psn/c10e0db6f15dec57a94637365f4c3d43e05bbd48|4;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 35 | 'jdltapp;iPhone;3.1.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/3.15;apprpd/;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fchat%2Findex.action%3Fentry%3Djd_m_JiSuCommodity%26pid%3D7763388%26lng%3D118.159665%26lat%3D24.504633%26sid%3D31cddc2d58f6e36bf2c31c4e8a79767w%26un_area%3D16_1315_3486_0;psq/12;ads/;psn/c10e0db6f15dec57a94637365f4c3d43e05bbd48|4;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 36 | 'jdltapp;iPhone;3.1.0;14.4;;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,6;hasOCPay/0;appBuild/1017;supportBestPay/0;addressid/2813715704;pv/67.38;apprpd/MyJD_Main;ref/https%3A%2F%2Fh5.m.jd.com%2FbabelDiy%2FZeus%2F2ynE8QDtc2svd36VowmYWBzzDdK6%2Findex.html%3Flng%3D103.957532%26lat%3D30.626962%26sid%3D4fe8ef4283b24723a7bb30ee87c18b2w%26un_area%3D22_1930_49324_52512;psq/4;ads/;psn/5aef178f95931bdbbde849ea9e2fc62b18bc5829|127;jdv/0|direct|-|none|-|1612588090667|1613822580;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 37 | 'jdltapp;iPhone;3.1.0;14.3;;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 38 | 'jdltapp;iPhone;3.1.0;14.3;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 39 | 'jdltapp;iPhone;3.1.0;14.3;;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 40 | 'jdltapp;iPhone;3.1.0;14.3;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 41 | 'jdltapp;iPhone;3.1.0;14.3;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 42 | 'jdltapp;iPhone;3.1.0;14.4;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone12,1;addressid/3104834020;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.6;apprpd/;ref/JDLTSubMainPageViewController;psq/5;ads/;psn/c633e62b5a4ad0fdd93d9862bdcacfa8f3ecef63|6;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 43 | 'jdltapp;iPhone;3.1.0;14.3;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,1;addressid/1346909722;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/30.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/40d4d4323eb3987226cae367d6b0d8be50f2c7b3|39;jdv/0|kong|t_1000252057_0|tuiguang|eba7648a0f4445aa9cfa6f35c6f36e15|1613995717959|1613995723;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 44 | 'jdltapp;iPhone;3.1.0;14.3;network/wifi;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,1;addressid/1346909722;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/30.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/40d4d4323eb3987226cae367d6b0d8be50f2c7b3|39;jdv/0|kong|t_1000252057_0|tuiguang|eba7648a0f4445aa9cfa6f35c6f36e15|1613995717959|1613995723;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 45 | 'jdltapp;iPhone;3.1.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,6;addressid/138164461;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/7.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/d40e5d4a33c100e8527f779557c347569b49c304|7;jdv/0|kong|t_1001226363_|jingfen|3bf5372cb9cd445bbb270b8bc9a34f00|1608439066693|1608439068;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 46 | 'jdltapp;iPhone;3.1.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,6;addressid/138164461;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/7.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/d40e5d4a33c100e8527f779557c347569b49c304|7;jdv/0|kong|t_1001226363_|jingfen|3bf5372cb9cd445bbb270b8bc9a34f00|1608439066693|1608439068;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 47 | 'jdltapp;iPhone;3.1.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,6;addressid/138164461;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/7.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/d40e5d4a33c100e8527f779557c347569b49c304|7;jdv/0|kong|t_1001226363_|jingfen|3bf5372cb9cd445bbb270b8bc9a34f00|1608439066693|1608439068;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 48 | 'jdltapp;iPhone;3.1.0;13.5;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,2;addressid/2237496805;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/13.6;apprpd/;ref/JDLTSubMainPageViewController;psq/5;ads/;psn/48e495dcf5dc398b4d46b27e9f15a2b427a154aa|15;jdv/0|direct|-|none|-|1613354874698|1613952828;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 49 | 'jdltapp;iPhone;3.1.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone8,4;addressid/1477231693;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/21.15;apprpd/MyJD_Main;ref/https%3A%2F%2Fgold.jd.com%2F%3Flng%3D0.000000%26lat%3D0.000000%26sid%3D4584eb84dc00141b0d58e000583a338w%26un_area%3D19_1607_3155_62114;psq/0;ads/;psn/2c822e59db319590266cc83b78c4a943783d0077|46;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 50 | 'jdltapp;iPhone;3.1.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,1;addressid/70390480;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.24;apprpd/MyJD_Main;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fafter%2Findex.action%3FcategoryId%3D600%26v%3D6%26entry%3Dm_self_jd;psq/4;ads/;psn/6d343c58764a908d4fa56609da4cb3a5cc1396d3|17;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 51 | 'jdltapp;iPhone;3.1.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,1;addressid/70390480;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.24;apprpd/MyJD_Main;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fafter%2Findex.action%3FcategoryId%3D600%26v%3D6%26entry%3Dm_self_jd;psq/4;ads/;psn/6d343c58764a908d4fa56609da4cb3a5cc1396d3|17;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 52 | 'jdltapp;iPhone;3.1.0;14.4;network/wifi;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,1;addressid/70390480;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.24;apprpd/MyJD_Main;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fafter%2Findex.action%3FcategoryId%3D600%26v%3D6%26entry%3Dm_self_jd;psq/4;ads/;psn/6d343c58764a908d4fa56609da4cb3a5cc1396d3|17;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 53 | 'jdltapp;iPhone;3.1.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,1;addressid/70390480;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.24;apprpd/MyJD_Main;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fafter%2Findex.action%3FcategoryId%3D600%26v%3D6%26entry%3Dm_self_jd;psq/4;ads/;psn/6d343c58764a908d4fa56609da4cb3a5cc1396d3|17;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 54 | 'jdltapp;iPhone;3.1.0;14.4;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone12,3;hasOCPay/0;appBuild/1017;supportBestPay/0;addressid/;pv/3.49;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/7;ads/;psn/9e0e0ea9c6801dfd53f2e50ffaa7f84c7b40cd15|6;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.1.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1', 55 | ] 56 | /** 57 | * 生成随机数字 58 | * @param {number} min 最小值(包含) 59 | * @param {number} max 最大值(不包含) 60 | */ 61 | function randomNumber(min = 0, max = 100) { 62 | return Math.min(Math.floor(min + Math.random() * (max - min)), max); 63 | } 64 | const USER_AGENT = USER_AGENTS[randomNumber(0, USER_AGENTS.length)]; 65 | 66 | module.exports = { 67 | USER_AGENT 68 | } 69 | -------------------------------------------------------------------------------- /backup/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tsukasa007/my_script/0aa1d665fae9402e026a0c944047f1112ec79897/backup/img.png -------------------------------------------------------------------------------- /backup/img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tsukasa007/my_script/0aa1d665fae9402e026a0c944047f1112ec79897/backup/img1.png -------------------------------------------------------------------------------- /backup/img3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tsukasa007/my_script/0aa1d665fae9402e026a0c944047f1112ec79897/backup/img3.png -------------------------------------------------------------------------------- /backup/ks.js: -------------------------------------------------------------------------------- 1 | /* 2 | # ks 3 | ^https?:\/\/apijs\.ksapisrv\.com\/rest\/nebula\/user\/login\/mobileVerifyCode url script-request-header https://raw.githubusercontent.com/Tsukasa007/my_script/master/backup/ks.js 4 | ^https?:\/\/apijs\.ksapisrv\.com\/rest\/nebula\/user\/login\/token url script-request-header https://raw.githubusercontent.com/Tsukasa007/my_script/master/backup/ks.js 5 | */ 6 | 7 | const $ = new Env("ks") 8 | !(async () => { 9 | let responseBody = JSON.parse($response.body) 10 | console.log(JSON.stringify(responseBody)) 11 | if (responseBody['kuaishou.api_client_salt']) { 12 | $notify("点击复制", "",`${responseBody['kuaishou.api_client_salt']}&${responseBody['kuaishou.api_st']}&`); 13 | }else { 14 | console.log("没有找到!") 15 | } 16 | 17 | })() 18 | .catch((e) => $.logErr(e)) 19 | .finally(() => $.done()) 20 | 21 | 22 | function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} -------------------------------------------------------------------------------- /backup/wskey.js: -------------------------------------------------------------------------------- 1 | /* 2 | 10.0.2以上版本用这个 3 | 杀掉后台后打开京东app获取wskey 4 | 在脚本日志查看值 5 | 6 | [MITM] 7 | hostname = api.m.jd.com 8 | 9 | [rewrite_local] 10 | 11 | 12 | # wskey 13 | 14 | # 京东 15 | ^https?:\/\/api\.m\.jd\.com\/client\.action\?functionId=queryTemplates url script-request-header https://ghproxy.com/https://raw.githubusercontent.com/Tsukasa007/my_script/master/backup/wskey.js 16 | 17 | */ 18 | 19 | const $ = new Env("wskey") 20 | !(async () => { 21 | let cookie = $request.headers.Cookie 22 | let wskey = cookie.match(/(wskey=[^;]*)/)[1] 23 | console.log('================') 24 | console.log(`${wskey}`) 25 | 26 | let jec = decodeURIComponent($request.headers['J-E-C']) 27 | console.log('================') 28 | console.log(`jec=${jec}`) 29 | 30 | jec = JSON.parse(jec) 31 | console.log('================') 32 | jec = jec.cipher.pin 33 | console.log(`jec=${jec}`) 34 | 35 | 36 | 37 | let pin = await pinDecode(jec); 38 | 39 | console.log('================') 40 | console.log(`pt_pin=${pin};${wskey};`) 41 | console.log('================') 42 | 43 | console.log("wskey获取中!") 44 | 45 | $notify("点击复制wskey", "",`pt_pin=${pin};${wskey};`); 46 | })() 47 | .catch((e) => $.logErr(e)) 48 | .finally(() => $.done()) 49 | 50 | 51 | async function pinDecode(pin) { 52 | return new Promise(resolve => { 53 | $.post({ 54 | url: `http://pin.tsukasa.pro:7410/tt/base64Decode`, 55 | // body: `body=${encodeURIComponent(JSON.stringify({'base64':pin}))}`, 56 | body: `${(JSON.stringify({'base64':pin}))}`, 57 | headers: { 58 | 'Content-Type' : 'application/json', 59 | }, 60 | }, async (err, resp, data) => { 61 | try { 62 | if (err) { 63 | console.log(`${JSON.stringify(err)}`) 64 | console.log(`${$.name} API请求失败,请检查网路重试`) 65 | } else { 66 | data = JSON.parse(data); 67 | } 68 | } catch (e) { 69 | $.logErr(e, resp) 70 | } finally { 71 | resolve(data.data); 72 | } 73 | }) 74 | }) 75 | } 76 | 77 | function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} -------------------------------------------------------------------------------- /code_tsukasa.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | 5 | ## 导入通用变量与函数 6 | #dir_shell=/Users/jiahuiyang/IdeaProjects/Test/qinglong_code/shell 7 | #. $dir_shell/share.sh 8 | dir_shell=/ql/shell 9 | . $dir_shell/share.sh 10 | 11 | 12 | CC=$JD_COOKIE 13 | 14 | 15 | 16 | index="1" 17 | split="&" 18 | checkCut=$(echo $CC | grep "${split}") 19 | if [[ "$checkCut" != "" ]] 20 | then 21 | echo "JD_COOKIE [&] 拼接!" 22 | for character in ${CC//&/ }; do 23 | # echo "$index. $character" 24 | CCArray[index]=$character 25 | index=$(($index+1)) 26 | done 27 | else 28 | echo "JD_COOKIE [空格/换行] 拼接!" 29 | for character in $CC; do 30 | # echo "$index. $character" 31 | CCArray[index]=$character 32 | index=$(($index+1)) 33 | done 34 | fi 35 | 36 | 37 | user_sum=$(($index-1)) 38 | 39 | ## 生成pt_pin清单 40 | gen_pt_pin_array() { 41 | local tmp1 tmp2 i pt_pin_temp 42 | for ((user_num = 1; user_num <= $user_sum; user_num++)); do 43 | # tmp1=Cookie$user_num 44 | tmp1=CCArray[user_num] 45 | tmp2=${!tmp1} 46 | i=$(($user_num - 1)) 47 | pt_pin_temp=$(echo $tmp2 | perl -pe "{s|.*pt_pin=([^; ]+)(?=;?).*|\1|; s|%|\\\x|g}") 48 | [[ $pt_pin_temp == *\\x* ]] && pt_pin[i]=$(printf $pt_pin_temp) || pt_pin[i]=$pt_pin_temp 49 | done 50 | } 51 | 52 | ## 导出互助码的通用程序,$1:去掉后缀的脚本名称,$2:config.sh中的后缀,$3:活动中文名称 53 | export_codes_sub() { 54 | local task_name=$1 55 | local config_name=$2 56 | local MaxCount=${config_name#*@} 57 | config_name=${config_name%@*} 58 | local chinese_name=$3 59 | local config_name_my=My$config_name 60 | local config_name_for_other=ForOther$config_name 61 | echo "## MaxCount=$MaxCount" 62 | local i j k m n pt_pin_in_log code tmp_grep tmp_my_code tmp_for_other user_num random_num_list 63 | if cd $dir_log/$task_name &>/dev/null && [[ $(ls) ]]; then 64 | ## 寻找所有互助码以及对应的pt_pin 65 | i=0 66 | pt_pin_in_log=() 67 | code=() 68 | pt_pin_and_code=$(ls -r *.log | xargs awk -v var="的$chinese_name好友互助码" 'BEGIN{FS="[( )】]+"; OFS="&"} $3~var {print $2,$4}') 69 | for line in $pt_pin_and_code; do 70 | pt_pin_in_log[i]=$(echo $line | awk -F "&" '{print $1}') 71 | code[i]=$(echo $line | awk -F "&" '{print $2}') 72 | let i++ 73 | done 74 | 75 | ## 输出My系列变量 76 | if [[ ${#code[*]} -gt 0 ]]; then 77 | for ((m = 0; m < ${#pt_pin[*]}; m++)); do 78 | tmp_my_code="" 79 | j=$((m + 1)) 80 | for ((n = 0; n < ${#code[*]}; n++)); do 81 | if [[ ${pt_pin[m]} == ${pt_pin_in_log[n]} ]]; then 82 | tmp_my_code=${code[n]} 83 | break 84 | fi 85 | done 86 | echo "$config_name_my$j='$tmp_my_code'" 87 | done 88 | else 89 | echo "## 从日志中未找到任何互助码" 90 | fi 91 | 92 | ## 输出ForOther系列变量 93 | if [[ ${#code[*]} -gt 0 ]]; then 94 | echo 95 | case $HelpType in 96 | 0) ## 全部一致 97 | tmp_for_other="" 98 | for ((m = 0; m < ${#pt_pin[*]} && ("$MaxCount" == "$config_name" || m < $MaxCount); m++)); do 99 | j=$((m + 1)) 100 | tmp_for_other="$tmp_for_other@\${$config_name_my$j}" 101 | done 102 | echo "${config_name_for_other}1=\"$tmp_for_other\"" | perl -pe "s|($config_name_for_other\d+=\")@|\1|" 103 | for ((m = 1; m < ${#pt_pin[*]}; m++)); do 104 | j=$((m + 1)) 105 | echo "$config_name_for_other$j=\"\${${config_name_for_other}1}\"" 106 | done 107 | ;; 108 | 109 | 1) ## 均等助力 110 | for ((m = 0; m < ${#pt_pin[*]}; m++)); do 111 | tmp_for_other="" 112 | j=$((m + 1)) 113 | for ((n = $m; n < $(($user_sum + $m)); n++)); do 114 | [[ $m -eq $n ]] && continue 115 | if [[ $((n + 1)) -le $user_sum ]]; then 116 | k=$((n + 1)) 117 | else 118 | k=$((n + 1 - $user_sum)) 119 | fi 120 | tmp_for_other="$tmp_for_other@\${$config_name_my$k}" 121 | done 122 | echo "$config_name_for_other$j=\"$tmp_for_other\"" | perl -pe "s|($config_name_for_other\d+=\")@|\1|" 123 | done 124 | ;; 125 | 126 | 2) ## 本套脚本内账号间随机顺序助力 127 | for ((m = 0; m < ${#pt_pin[*]}; m++)); do 128 | tmp_for_other="" 129 | random_num_list=$(seq $user_sum | sort -R) 130 | j=$((m + 1)) 131 | for n in $random_num_list; do 132 | [[ $j -eq $n ]] && continue 133 | tmp_for_other="$tmp_for_other@\${$config_name_my$n}" 134 | done 135 | echo "$config_name_for_other$j=\"$tmp_for_other\"" | perl -pe "s|($config_name_for_other\d+=\")@|\1|" 136 | done 137 | ;; 138 | 139 | *) ## 按编号优先 140 | for ((m = 0; m < ${#pt_pin[*]}; m++)); do 141 | tmp_for_other="" 142 | j=$((m + 1)) 143 | for ((n = 0; n < ${#pt_pin[*]}; n++)); do 144 | [[ $m -eq $n ]] && continue 145 | k=$((n + 1)) 146 | tmp_for_other="$tmp_for_other@\${$config_name_my$k}" 147 | done 148 | echo "$config_name_for_other$j=\"$tmp_for_other\"" | perl -pe "s|($config_name_for_other\d+=\")@|\1|" 149 | done 150 | ;; 151 | esac 152 | fi 153 | else 154 | echo "## 未运行过 $task_name.js 脚本,未产生日志" 155 | fi 156 | } 157 | 158 | ## 汇总输出 159 | export_all_codes() { 160 | gen_pt_pin_array 161 | echo -e "\n# 从日志提取互助码,编号和配置文件中Cookie编号完全对应,如果为空就是所有日志中都没有。\n\n# 即使某个MyXxx变量未赋值,也可以将其变量名填在ForOtherXxx中,jtask脚本会自动过滤空值。\n" 162 | echo -n "# 你选择的互助码模板为:" 163 | case $HelpType in 164 | 0) 165 | echo "所有账号助力码全部一致。" 166 | ;; 167 | 1) 168 | echo "所有账号机会均等助力。" 169 | ;; 170 | 2) 171 | echo "本套脚本内账号间随机顺序助力。" 172 | ;; 173 | *) 174 | echo "按账号编号优先。" 175 | ;; 176 | esac 177 | for ((i = 0; i < ${#name_js[*]}; i++)); do 178 | echo -e "\n## ${name_chinese[i]}:" 179 | export_codes_sub "${name_js[i]}" "${name_config[i]}" "${name_chinese[i]}" 180 | done 181 | } 182 | 183 | ## 执行并写入日志 184 | log_time=$(date "+%Y-%m-%d-%H-%M-%S") 185 | log_path="$dir_code/$log_time.log" 186 | make_dir "$dir_code" 187 | export_all_codes | perl -pe "{s|京东种豆|种豆|; s|crazyJoy任务|疯狂的JOY|}" | tee $log_path 188 | 189 | 190 | echo "互助文件生成 done! $dir_code/$log_time.log" 191 | task_before_path="$dir_config/task_before.sh" 192 | echo 'task_before_path: ' $task_before_path 193 | 194 | 195 | #start第几行 196 | helpStartLine=$(sed -n '/##helpStart/=' $task_before_path | tail -n1) 197 | 198 | if [ ! -n "$helpStartLine" ] ;then 199 | echo "##helpStart 不存在!" 200 | else 201 | echo "##helpStart 存在!" 202 | #清空help 203 | sed -i '/^##helpStart/,/^\##helpEnd/{/^##helpStart/!{/^\##helpEnd/!d;};}' $task_before_path 204 | #写入 205 | sed -i $helpStartLine'r '$log_path $task_before_path 206 | echo '***** done! *****' 207 | fi 208 | 209 | echo "修改自Tsukasa" 210 | 211 | 212 | 213 | 214 | 215 | -------------------------------------------------------------------------------- /jdCookie.js: -------------------------------------------------------------------------------- 1 | /* 2 | 此文件为Node.js专用。其他用户请忽略 3 | */ 4 | //此处填写京东账号cookie。 5 | let CookieJDs = [ 6 | ] 7 | // 判断环境变量里面是否有京东ck 8 | if (process.env.JD_COOKIE) { 9 | if (process.env.JD_COOKIE.indexOf('&') > -1) { 10 | CookieJDs = process.env.JD_COOKIE.split('&'); 11 | } else if (process.env.JD_COOKIE.indexOf('\n') > -1) { 12 | CookieJDs = process.env.JD_COOKIE.split('\n'); 13 | } else { 14 | CookieJDs = [process.env.JD_COOKIE]; 15 | } 16 | } 17 | if (JSON.stringify(process.env).indexOf('GITHUB')>-1) { 18 | console.log(`请勿使用github action运行此脚本,无论你是从你自己的私库还是其他哪里拉取的源代码,都会导致我被封号\n`); 19 | !(async () => { 20 | await require('./sendNotify').sendNotify('提醒', `请勿使用github action、滥用github资源会封我仓库以及账号`) 21 | await process.exit(0); 22 | })() 23 | } 24 | CookieJDs = [...new Set(CookieJDs.filter(item => !!item))] 25 | console.log(`\n====================共${CookieJDs.length}个京东账号Cookie=========\n`); 26 | console.log(`==================脚本执行- 北京时间(UTC+8):${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString()}=====================\n`) 27 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; 28 | for (let i = 0; i < CookieJDs.length; i++) { 29 | if (!CookieJDs[i].match(/pt_pin=(.+?);/) || !CookieJDs[i].match(/pt_key=(.+?);/)) console.log(`\n提示:京东cookie 【${CookieJDs[i]}】填写不规范,可能会影响部分脚本正常使用。正确格式为: pt_key=xxx;pt_pin=xxx;(分号;不可少)\n`); 30 | const index = (i + 1 === 1) ? '' : (i + 1); 31 | exports['CookieJD' + index] = CookieJDs[i].trim(); 32 | } 33 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 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 | "" 15 | ], 16 | "author": "", 17 | "license": "ISC", 18 | "dependencies": { 19 | "crypto-js": "^4.0.0", 20 | "download": "^8.0.0", 21 | "global-agent": "^3.0.0", 22 | "got": "11.5.1", 23 | "hpagent": "^0.1.2", 24 | "http-server": "^0.12.3", 25 | "js-base64": "^3.7.2", 26 | "jsdom": "^18.0.1", 27 | "normalizeurl": "^1.0.0", 28 | "png-js": "^1.0.0", 29 | "qrcode-terminal": "^0.12.0", 30 | "request": "^2.88.2", 31 | "tencentcloud-sdk-nodejs": "^4.0.235", 32 | "tough-cookie": "^4.0.0", 33 | "tunnel": "0.0.6", 34 | "wl-vue-select": "^0.5.9", 35 | "ws": "^7.4.3" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /report.json: -------------------------------------------------------------------------------- 1 | { 2 | "code":"1232", 3 | "name":"测试", 4 | "enable":false 5 | } 6 | -------------------------------------------------------------------------------- /sendNotify.js: -------------------------------------------------------------------------------- 1 | /* 2 | Last Modified time: 2021-06-19 00:00:00 3 | */ 4 | /** 5 | * sendNotify 推送通知功能 6 | * @param text 通知头 7 | * @param desp 通知体 8 | * @param params 某些推送通知方式点击弹窗可跳转, 例:{ url: 'https://abc.com' } 9 | * @param author 作者仓库等信息 例:`本脚本免费使用 By:xxx` 10 | * @returns {Promise} 11 | */ 12 | const { resolve } = require("path"); 13 | const querystring = require("querystring"); 14 | const $ = new Env(); 15 | const timeout = 15000;//超时时间(单位毫秒) 16 | // =======================================微信server酱通知设置区域=========================================== 17 | //此处填你申请的SCKEY. 18 | //(环境变量名 PUSH_KEY) 19 | let SCKEY = ''; 20 | 21 | // =======================================Bark App通知设置区域=========================================== 22 | //此处填你BarkAPP的信息(IP/设备码,例如:https://api.day.app/XXXXXXXX) 23 | let BARK_PUSH = ''; 24 | //BARK app推送铃声,铃声列表去APP查看复制填写 25 | let BARK_SOUND = ''; 26 | 27 | 28 | // =======================================telegram机器人通知设置区域=========================================== 29 | //此处填你telegram bot 的Token,telegram机器人通知推送必填项.例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw 30 | //(环境变量名 TG_BOT_TOKEN) 31 | let TG_BOT_TOKEN = ''; 32 | //此处填你接收通知消息的telegram用户的id,telegram机器人通知推送必填项.例如:129xxx206 33 | //(环境变量名 TG_USER_ID) 34 | let TG_USER_ID = ''; 35 | //tg推送HTTP代理设置(不懂可忽略,telegram机器人通知推送功能中非必填) 36 | let TG_PROXY_HOST = '';//例如:127.0.0.1(环境变量名:TG_PROXY_HOST) 37 | let TG_PROXY_PORT = '';//例如:1080(环境变量名:TG_PROXY_PORT) 38 | let TG_PROXY_AUTH = '';//tg代理配置认证参数 39 | //Telegram api自建的反向代理地址(不懂可忽略,telegram机器人通知推送功能中非必填),默认tg官方api(环境变量名:TG_API_HOST) 40 | let TG_API_HOST = 'api.telegram.org' 41 | // =======================================钉钉机器人通知设置区域=========================================== 42 | //此处填你钉钉 bot 的webhook,例如:5a544165465465645d0f31dca676e7bd07415asdasd 43 | //(环境变量名 DD_BOT_TOKEN) 44 | let DD_BOT_TOKEN = ''; 45 | //密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串 46 | let DD_BOT_SECRET = ''; 47 | 48 | // =======================================企业微信机器人通知设置区域=========================================== 49 | //此处填你企业微信机器人的 webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770),例如:693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa 50 | //(环境变量名 QYWX_KEY) 51 | let QYWX_KEY = ''; 52 | 53 | // =======================================企业微信应用消息通知设置区域=========================================== 54 | /* 55 | 此处填你企业微信应用消息的值(详见文档 https://work.weixin.qq.com/api/doc/90000/90135/90236) 56 | 环境变量名 QYWX_AM依次填入 corpid,corpsecret,touser(注:多个成员ID使用|隔开),agentid,消息类型(选填,不填默认文本消息类型) 57 | 注意用,号隔开(英文输入法的逗号),例如:wwcff56746d9adwers,B-791548lnzXBE6_BWfxdf3kSTMJr9vFEPKAbh6WERQ,mingcheng,1000001,2COXgjH2UIfERF2zxrtUOKgQ9XklUqMdGSWLBoW_lSDAdafat 58 | 可选推送消息类型(推荐使用图文消息(mpnews)): 59 | - 文本卡片消息: 0 (数字零) 60 | - 文本消息: 1 (数字一) 61 | - 图文消息(mpnews): 素材库图片id, 可查看此教程(http://note.youdao.com/s/HMiudGkb)或者(https://note.youdao.com/ynoteshare1/index.html?id=1a0c8aff284ad28cbd011b29b3ad0191&type=note) 62 | */ 63 | let QYWX_AM = ''; 64 | 65 | // =======================================iGot聚合推送通知设置区域=========================================== 66 | //此处填您iGot的信息(推送key,例如:https://push.hellyw.com/XXXXXXXX) 67 | let IGOT_PUSH_KEY = ''; 68 | 69 | // =======================================push+设置区域======================================= 70 | //官方文档:http://www.pushplus.plus/ 71 | //PUSH_PLUS_TOKEN:微信扫码登录后一对一推送或一对多推送下面的token(您的Token),不提供PUSH_PLUS_USER则默认为一对一推送 72 | //PUSH_PLUS_USER: 一对多推送的“群组编码”(一对多推送下面->您的群组(如无则新建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送) 73 | let PUSH_PLUS_TOKEN = ''; 74 | let PUSH_PLUS_USER = ''; 75 | 76 | // =======================================cq-gohttp设置区域======================================= 77 | // Doc https://docs.go-cqhttp.org/api/ 78 | let go_cqhttp_url = '' // 127.0.0.1:5702 79 | let go_cqhttp_qq = '' // 接收消息QQ或群 80 | let go_cqhttp_method = '' // send_private_msg or send_group_msg 81 | 82 | process.env.go_cqhttp_url ? go_cqhttp_url = process.env.go_cqhttp_url : '' 83 | process.env.go_cqhttp_qq ? go_cqhttp_qq = process.env.go_cqhttp_qq : '' 84 | process.env.go_cqhttp_method ? go_cqhttp_method = process.env.go_cqhttp_method : '' 85 | 86 | //==========================云端环境变量的判断与接收========================= 87 | if (process.env.PUSH_KEY) { 88 | SCKEY = process.env.PUSH_KEY; 89 | } 90 | 91 | if (process.env.QQ_SKEY) { 92 | QQ_SKEY = process.env.QQ_SKEY; 93 | } 94 | 95 | if (process.env.QQ_MODE) { 96 | QQ_MODE = process.env.QQ_MODE; 97 | } 98 | 99 | 100 | if (process.env.BARK_PUSH) { 101 | if (process.env.BARK_PUSH.indexOf('https') > -1 || process.env.BARK_PUSH.indexOf('http') > -1) { 102 | //兼容BARK自建用户 103 | BARK_PUSH = process.env.BARK_PUSH 104 | } else { 105 | BARK_PUSH = `https://api.day.app/${process.env.BARK_PUSH}` 106 | } 107 | if (process.env.BARK_SOUND) { 108 | BARK_SOUND = process.env.BARK_SOUND 109 | } 110 | } else { 111 | if (BARK_PUSH && BARK_PUSH.indexOf('https') === -1 && BARK_PUSH.indexOf('http') === -1) { 112 | //兼容BARK本地用户只填写设备码的情况 113 | BARK_PUSH = `https://api.day.app/${BARK_PUSH}` 114 | } 115 | } 116 | if (process.env.TG_BOT_TOKEN) { 117 | TG_BOT_TOKEN = process.env.TG_BOT_TOKEN; 118 | } 119 | if (process.env.TG_USER_ID) { 120 | TG_USER_ID = process.env.TG_USER_ID; 121 | } 122 | if (process.env.TG_PROXY_AUTH) TG_PROXY_AUTH = process.env.TG_PROXY_AUTH; 123 | if (process.env.TG_PROXY_HOST) TG_PROXY_HOST = process.env.TG_PROXY_HOST; 124 | if (process.env.TG_PROXY_PORT) TG_PROXY_PORT = process.env.TG_PROXY_PORT; 125 | if (process.env.TG_API_HOST) TG_API_HOST = process.env.TG_API_HOST; 126 | 127 | if (process.env.DD_BOT_TOKEN) { 128 | DD_BOT_TOKEN = process.env.DD_BOT_TOKEN; 129 | if (process.env.DD_BOT_SECRET) { 130 | DD_BOT_SECRET = process.env.DD_BOT_SECRET; 131 | } 132 | } 133 | 134 | if (process.env.QYWX_KEY) { 135 | QYWX_KEY = process.env.QYWX_KEY; 136 | } 137 | 138 | if (process.env.QYWX_AM) { 139 | QYWX_AM = process.env.QYWX_AM; 140 | } 141 | 142 | if (process.env.IGOT_PUSH_KEY) { 143 | IGOT_PUSH_KEY = process.env.IGOT_PUSH_KEY 144 | } 145 | 146 | if (process.env.PUSH_PLUS_TOKEN) { 147 | PUSH_PLUS_TOKEN = process.env.PUSH_PLUS_TOKEN; 148 | } 149 | if (process.env.PUSH_PLUS_USER) { 150 | PUSH_PLUS_USER = process.env.PUSH_PLUS_USER; 151 | } 152 | //==========================云端环境变量的判断与接收========================= 153 | 154 | /** 155 | * sendNotify 推送通知功能 156 | * @param text 通知头 157 | * @param desp 通知体 158 | * @param params 某些推送通知方式点击弹窗可跳转, 例:{ url: 'https://abc.com' } 159 | * @param author 作者仓库等信息 例:`本脚本免费使用 By:xxxx` 160 | * @returns {Promise} 161 | */ 162 | async function sendNotify(text, desp, params = {}, author = '\n\n仅供用于学习') { 163 | //提供6种通知 164 | desp += author;//增加作者信息,防止被贩卖等 165 | await Promise.all([ 166 | serverNotify(text, desp),//微信server酱 167 | pushPlusNotify(text, desp)//pushplus(推送加) 168 | ]) 169 | //由于上述两种微信通知需点击进去才能查看到详情,故text(标题内容)携带了账号序号以及昵称信息,方便不点击也可知道是哪个京东哪个活动 170 | text = text.match(/.*?(?=\s?-)/g) ? text.match(/.*?(?=\s?-)/g)[0] : text; 171 | await Promise.all([ 172 | BarkNotify(text, desp, params),//iOS Bark APP 173 | tgBotNotify(text, desp),//telegram 机器人 174 | ddBotNotify(text, desp),//钉钉机器人 175 | qywxBotNotify(text, desp), //企业微信机器人 176 | qywxamNotify(text, desp), //企业微信应用消息推送 177 | iGotNotify(text, desp, params),//iGot 178 | goCQhttp(text, desp) // go-cqhttp 179 | ]) 180 | } 181 | 182 | function goCQhttp(text, desp) { 183 | if (go_cqhttp_url && go_cqhttp_qq && go_cqhttp_method) { 184 | let msg = (text + '\n' + desp).replace("\n\n仅供用于学习", ''); 185 | 186 | let recv_id = '' 187 | if (go_cqhttp_method === 'send_private_msg') { 188 | recv_id = 'user_id' 189 | } else if (go_cqhttp_method === 'send_group_msg') { 190 | recv_id = 'group_id' 191 | } 192 | 193 | return new Promise(resolve => { 194 | $.get({ 195 | url: `http://${go_cqhttp_url}/${go_cqhttp_method}?${recv_id}=${go_cqhttp_qq}&message=${escape(msg)}` 196 | }, (err, resp, data) => { 197 | if (!err) { 198 | try { 199 | // console.log(data); 200 | data = JSON.parse(data); 201 | if (data.retcode === 0 && data.status === 'ok') { 202 | console.log('go-cqhttp发送通知消息成功🎉\n') 203 | } else { 204 | console.log(`go-cqhttp发送通知消息异常\n${JSON.stringify(data)}`) 205 | } 206 | } catch (e) { 207 | $.logErr(e, resp) 208 | } finally { 209 | resolve(200) 210 | } 211 | } 212 | }) 213 | }) 214 | } 215 | } 216 | 217 | function serverNotify(text, desp, time = 2100) { 218 | return new Promise(resolve => { 219 | if (SCKEY) { 220 | //微信server酱推送通知一个\n不会换行,需要两个\n才能换行,故做此替换 221 | desp = desp.replace(/[\n\r]/g, '\n\n'); 222 | const options = { 223 | url: SCKEY.includes('SCT') ? `https://sctapi.ftqq.com/${SCKEY}.send` : `https://sc.ftqq.com/${SCKEY}.send`, 224 | body: `text=${text}&desp=${desp}`, 225 | headers: { 226 | 'Content-Type': 'application/x-www-form-urlencoded' 227 | }, 228 | timeout 229 | } 230 | setTimeout(() => { 231 | $.post(options, (err, resp, data) => { 232 | try { 233 | if (err) { 234 | console.log('发送通知调用API失败!!\n') 235 | console.log(err); 236 | } else { 237 | data = JSON.parse(data); 238 | //server酱和Server酱·Turbo版的返回json格式不太一样 239 | if (data.errno === 0 || data.data.errno === 0) { 240 | console.log('server酱发送通知消息成功🎉\n') 241 | } else if (data.errno === 1024) { 242 | // 一分钟内发送相同的内容会触发 243 | console.log(`server酱发送通知消息异常: ${data.errmsg}\n`) 244 | } else { 245 | console.log(`server酱发送通知消息异常\n${JSON.stringify(data)}`) 246 | } 247 | } 248 | } catch (e) { 249 | $.logErr(e, resp); 250 | } finally { 251 | resolve(data); 252 | } 253 | }) 254 | }, time) 255 | } else { 256 | `` // console.log('\n\n您未提供server酱的SCKEY,取消微信推送消息通知🚫\n'); 257 | resolve() 258 | } 259 | }) 260 | } 261 | 262 | function BarkNotify(text, desp, params = {}) { 263 | return new Promise(resolve => { 264 | if (BARK_PUSH) { 265 | const options = { 266 | url: `${BARK_PUSH}/${encodeURIComponent(text)}/${encodeURIComponent(desp)}?sound=${BARK_SOUND}&${querystring.stringify(params)}`, 267 | headers: { 268 | 'Content-Type': 'application/x-www-form-urlencoded' 269 | }, 270 | timeout 271 | } 272 | $.get(options, (err, resp, data) => { 273 | try { 274 | if (err) { 275 | console.log('Bark APP发送通知调用API失败!!\n') 276 | console.log(err); 277 | } else { 278 | data = JSON.parse(data); 279 | if (data.code === 200) { 280 | console.log('Bark APP发送通知消息成功🎉\n') 281 | } else { 282 | console.log(`${data.message}\n`); 283 | } 284 | } 285 | } catch (e) { 286 | $.logErr(e, resp); 287 | } finally { 288 | resolve(); 289 | } 290 | }) 291 | } else { 292 | // console.log('您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知🚫\n'); 293 | resolve() 294 | } 295 | }) 296 | } 297 | 298 | function tgBotNotify(text, desp) { 299 | return new Promise(resolve => { 300 | if (TG_BOT_TOKEN && TG_USER_ID) { 301 | const options = { 302 | url: `https://${TG_API_HOST}/bot${TG_BOT_TOKEN}/sendMessage`, 303 | body: `chat_id=${TG_USER_ID}&text=${text}\n\n${desp}&disable_web_page_preview=true`, 304 | headers: { 305 | 'Content-Type': 'application/x-www-form-urlencoded' 306 | }, 307 | timeout 308 | } 309 | if (TG_PROXY_HOST && TG_PROXY_PORT) { 310 | const tunnel = require("tunnel"); 311 | const agent = { 312 | https: tunnel.httpsOverHttp({ 313 | proxy: { 314 | host: TG_PROXY_HOST, 315 | port: TG_PROXY_PORT * 1, 316 | proxyAuth: TG_PROXY_AUTH 317 | } 318 | }) 319 | } 320 | Object.assign(options, { agent }) 321 | } 322 | $.post(options, (err, resp, data) => { 323 | try { 324 | if (err) { 325 | console.log('telegram发送通知消息失败!!\n') 326 | console.log(err); 327 | } else { 328 | data = JSON.parse(data); 329 | if (data.ok) { 330 | console.log('Telegram发送通知消息成功🎉。\n') 331 | } else if (data.error_code === 400) { 332 | console.log('请主动给bot发送一条消息并检查接收用户ID是否正确。\n') 333 | } else if (data.error_code === 401) { 334 | console.log('Telegram bot token 填写错误。\n') 335 | } 336 | } 337 | } catch (e) { 338 | $.logErr(e, resp); 339 | } finally { 340 | resolve(data); 341 | } 342 | }) 343 | } else { 344 | // console.log('您未提供telegram机器人推送所需的TG_BOT_TOKEN和TG_USER_ID,取消telegram推送消息通知🚫\n'); 345 | resolve() 346 | } 347 | }) 348 | } 349 | function ddBotNotify(text, desp) { 350 | return new Promise(resolve => { 351 | const options = { 352 | url: `https://oapi.dingtalk.com/robot/send?access_token=${DD_BOT_TOKEN}`, 353 | json: { 354 | "msgtype": "text", 355 | "text": { 356 | "content": ` ${text}\n\n${desp}` 357 | } 358 | }, 359 | headers: { 360 | 'Content-Type': 'application/json' 361 | }, 362 | timeout 363 | } 364 | if (DD_BOT_TOKEN && DD_BOT_SECRET) { 365 | const crypto = require('crypto'); 366 | const dateNow = Date.now(); 367 | const hmac = crypto.createHmac('sha256', DD_BOT_SECRET); 368 | hmac.update(`${dateNow}\n${DD_BOT_SECRET}`); 369 | const result = encodeURIComponent(hmac.digest('base64')); 370 | options.url = `${options.url}×tamp=${dateNow}&sign=${result}`; 371 | $.post(options, (err, resp, data) => { 372 | try { 373 | if (err) { 374 | console.log('钉钉发送通知消息失败!!\n') 375 | console.log(err); 376 | } else { 377 | data = JSON.parse(data); 378 | if (data.errcode === 0) { 379 | console.log('钉钉发送通知消息成功🎉。\n') 380 | } else { 381 | console.log(`${data.errmsg}\n`) 382 | } 383 | } 384 | } catch (e) { 385 | $.logErr(e, resp); 386 | } finally { 387 | resolve(data); 388 | } 389 | }) 390 | } else if (DD_BOT_TOKEN) { 391 | $.post(options, (err, resp, data) => { 392 | try { 393 | if (err) { 394 | console.log('钉钉发送通知消息失败!!\n') 395 | console.log(err); 396 | } else { 397 | data = JSON.parse(data); 398 | if (data.errcode === 0) { 399 | console.log('钉钉发送通知消息完成。\n') 400 | } else { 401 | console.log(`${data.errmsg}\n`) 402 | } 403 | } 404 | } catch (e) { 405 | $.logErr(e, resp); 406 | } finally { 407 | resolve(data); 408 | } 409 | }) 410 | } else { 411 | // console.log('您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知🚫\n'); 412 | resolve() 413 | } 414 | }) 415 | } 416 | 417 | function qywxBotNotify(text, desp) { 418 | return new Promise(resolve => { 419 | const options = { 420 | url: `https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${QYWX_KEY}`, 421 | json: { 422 | msgtype: 'text', 423 | text: { 424 | content: ` ${text}\n\n${desp}`, 425 | }, 426 | }, 427 | headers: { 428 | 'Content-Type': 'application/json', 429 | }, 430 | timeout 431 | }; 432 | if (QYWX_KEY) { 433 | $.post(options, (err, resp, data) => { 434 | try { 435 | if (err) { 436 | console.log('企业微信发送通知消息失败!!\n'); 437 | console.log(err); 438 | } else { 439 | data = JSON.parse(data); 440 | if (data.errcode === 0) { 441 | console.log('企业微信发送通知消息成功🎉。\n'); 442 | } else { 443 | console.log(`${data.errmsg}\n`); 444 | } 445 | } 446 | } catch (e) { 447 | $.logErr(e, resp); 448 | } finally { 449 | resolve(data); 450 | } 451 | }); 452 | } else { 453 | // console.log('您未提供企业微信机器人推送所需的QYWX_KEY,取消企业微信推送消息通知🚫\n'); 454 | resolve(); 455 | } 456 | }); 457 | } 458 | 459 | function ChangeUserId(desp) { 460 | const QYWX_AM_AY = QYWX_AM.split(','); 461 | if (QYWX_AM_AY[2]) { 462 | const userIdTmp = QYWX_AM_AY[2].split("|"); 463 | let userId = ""; 464 | for (let i = 0; i < userIdTmp.length; i++) { 465 | const count = "账号" + (i + 1); 466 | const count2 = "签到号 " + (i + 1); 467 | if (desp.match(count2)) { 468 | userId = userIdTmp[i]; 469 | } 470 | } 471 | if (!userId) userId = QYWX_AM_AY[2]; 472 | return userId; 473 | } else { 474 | return "@all"; 475 | } 476 | } 477 | 478 | function qywxamNotify(text, desp) { 479 | return new Promise(resolve => { 480 | if (QYWX_AM) { 481 | const QYWX_AM_AY = QYWX_AM.split(','); 482 | const options_accesstoken = { 483 | url: `https://qyapi.weixin.qq.com/cgi-bin/gettoken`, 484 | json: { 485 | corpid: `${QYWX_AM_AY[0]}`, 486 | corpsecret: `${QYWX_AM_AY[1]}`, 487 | }, 488 | headers: { 489 | 'Content-Type': 'application/json', 490 | }, 491 | timeout 492 | }; 493 | $.post(options_accesstoken, (err, resp, data) => { 494 | html = desp.replace(/\n/g, "
") 495 | var json = JSON.parse(data); 496 | accesstoken = json.access_token; 497 | let options; 498 | 499 | switch (QYWX_AM_AY[4]) { 500 | case '0': 501 | options = { 502 | msgtype: 'textcard', 503 | textcard: { 504 | title: `${text}`, 505 | description: `${desp}`, 506 | url: '', 507 | btntxt: '更多' 508 | } 509 | } 510 | break; 511 | 512 | case '1': 513 | options = { 514 | msgtype: 'text', 515 | text: { 516 | content: `${text}\n\n${desp}` 517 | } 518 | } 519 | break; 520 | 521 | default: 522 | options = { 523 | msgtype: 'mpnews', 524 | mpnews: { 525 | articles: [ 526 | { 527 | title: `${text}`, 528 | thumb_media_id: `${QYWX_AM_AY[4]}`, 529 | author: `智能助手`, 530 | content_source_url: ``, 531 | content: `${html}`, 532 | digest: `${desp}` 533 | } 534 | ] 535 | } 536 | } 537 | }; 538 | if (!QYWX_AM_AY[4]) { 539 | //如不提供第四个参数,则默认进行文本消息类型推送 540 | options = { 541 | msgtype: 'text', 542 | text: { 543 | content: `${text}\n\n${desp}` 544 | } 545 | } 546 | } 547 | options = { 548 | url: `https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=${accesstoken}`, 549 | json: { 550 | touser: `${ChangeUserId(desp)}`, 551 | agentid: `${QYWX_AM_AY[3]}`, 552 | safe: '0', 553 | ...options 554 | }, 555 | headers: { 556 | 'Content-Type': 'application/json', 557 | }, 558 | } 559 | 560 | $.post(options, (err, resp, data) => { 561 | try { 562 | if (err) { 563 | console.log('成员ID:' + ChangeUserId(desp) + '企业微信应用消息发送通知消息失败!!\n'); 564 | console.log(err); 565 | } else { 566 | data = JSON.parse(data); 567 | if (data.errcode === 0) { 568 | console.log('成员ID:' + ChangeUserId(desp) + '企业微信应用消息发送通知消息成功🎉。\n'); 569 | } else { 570 | console.log(`${data.errmsg}\n`); 571 | } 572 | } 573 | } catch (e) { 574 | $.logErr(e, resp); 575 | } finally { 576 | resolve(data); 577 | } 578 | }); 579 | }); 580 | } else { 581 | // console.log('您未提供企业微信应用消息推送所需的QYWX_AM,取消企业微信应用消息推送消息通知🚫\n'); 582 | resolve(); 583 | } 584 | }); 585 | } 586 | 587 | function iGotNotify(text, desp, params = {}) { 588 | return new Promise(resolve => { 589 | if (IGOT_PUSH_KEY) { 590 | // 校验传入的IGOT_PUSH_KEY是否有效 591 | const IGOT_PUSH_KEY_REGX = new RegExp("^[a-zA-Z0-9]{24}$") 592 | if (!IGOT_PUSH_KEY_REGX.test(IGOT_PUSH_KEY)) { 593 | console.log('您所提供的IGOT_PUSH_KEY无效\n') 594 | resolve() 595 | return 596 | } 597 | const options = { 598 | url: `https://push.hellyw.com/${IGOT_PUSH_KEY.toLowerCase()}`, 599 | body: `title=${text}&content=${desp}&${querystring.stringify(params)}`, 600 | headers: { 601 | 'Content-Type': 'application/x-www-form-urlencoded' 602 | }, 603 | timeout 604 | } 605 | $.post(options, (err, resp, data) => { 606 | try { 607 | if (err) { 608 | console.log('发送通知调用API失败!!\n') 609 | console.log(err); 610 | } else { 611 | if (typeof data === 'string') data = JSON.parse(data); 612 | if (data.ret === 0) { 613 | console.log('iGot发送通知消息成功🎉\n') 614 | } else { 615 | console.log(`iGot发送通知消息失败:${data.errMsg}\n`) 616 | } 617 | } 618 | } catch (e) { 619 | $.logErr(e, resp); 620 | } finally { 621 | resolve(data); 622 | } 623 | }) 624 | } else { 625 | // console.log('您未提供iGot的推送IGOT_PUSH_KEY,取消iGot推送消息通知🚫\n'); 626 | resolve() 627 | } 628 | }) 629 | } 630 | 631 | function pushPlusNotify(text, desp) { 632 | return new Promise(resolve => { 633 | if (PUSH_PLUS_TOKEN) { 634 | desp = desp.replace(/[\n\r]/g, '
'); // 默认为html, 不支持plaintext 635 | const body = { 636 | token: `${PUSH_PLUS_TOKEN}`, 637 | title: `${text}`, 638 | content: `${desp}`, 639 | topic: `${PUSH_PLUS_USER}` 640 | }; 641 | const options = { 642 | url: `http://www.pushplus.plus/send`, 643 | body: JSON.stringify(body), 644 | headers: { 645 | 'Content-Type': ' application/json' 646 | }, 647 | timeout 648 | } 649 | $.post(options, (err, resp, data) => { 650 | try { 651 | if (err) { 652 | console.log(`push+发送${PUSH_PLUS_USER ? '一对多' : '一对一'}通知消息失败!!\n`) 653 | console.log(err); 654 | } else { 655 | data = JSON.parse(data); 656 | if (data.code === 200) { 657 | console.log(`push+发送${PUSH_PLUS_USER ? '一对多' : '一对一'}通知消息完成。\n`) 658 | } else { 659 | console.log(`push+发送${PUSH_PLUS_USER ? '一对多' : '一对一'}通知消息失败:${data.msg}\n`) 660 | } 661 | } 662 | } catch (e) { 663 | $.logErr(e, resp); 664 | } finally { 665 | resolve(data); 666 | } 667 | }) 668 | } else { 669 | // console.log('您未提供push+推送所需的PUSH_PLUS_TOKEN,取消push+推送消息通知🚫\n'); 670 | resolve() 671 | } 672 | }) 673 | } 674 | 675 | module.exports = { 676 | sendNotify, 677 | BARK_PUSH, 678 | HelloWorld: true 679 | } 680 | // prettier-ignore 681 | function Env(t, s) { return new class { constructor(t, s) { this.name = t, this.data = null, this.dataFile = "box.dat", this.logs = [], this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, s), this.log("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } getScript(t) { return new Promise(s => { $.get({ url: t }, (t, e, i) => s(i)) }) } runScript(t, s) { return new Promise(e => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let o = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); o = o ? 1 * o : 20, o = s && s.timeout ? s.timeout : o; const [h, a] = i.split("@"), r = { url: `http://${a}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: o }, headers: { "X-Key": h, Accept: "*/*" } }; $.post(r, (t, s, i) => e(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), s = this.path.resolve(process.cwd(), this.dataFile), e = this.fs.existsSync(t), i = !e && this.fs.existsSync(s); if (!e && !i) return {}; { const i = e ? t : s; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), s = this.path.resolve(process.cwd(), this.dataFile), e = this.fs.existsSync(t), i = !e && this.fs.existsSync(s), o = JSON.stringify(this.data); e ? this.fs.writeFileSync(t, o) : i ? this.fs.writeFileSync(s, o) : this.fs.writeFileSync(t, o) } } lodash_get(t, s, e) { const i = s.replace(/\[(\d+)\]/g, ".$1").split("."); let o = t; for (const t of i) if (o = Object(o)[t], void 0 === o) return e; return o } lodash_set(t, s, e) { return Object(t) !== t ? t : (Array.isArray(s) || (s = s.toString().match(/[^.[\]]+/g) || []), s.slice(0, -1).reduce((t, e, i) => Object(t[e]) === t[e] ? t[e] : t[e] = Math.abs(s[i + 1]) >> 0 == +s[i + 1] ? [] : {}, t)[s[s.length - 1]] = e, t) } getdata(t) { let s = this.getval(t); if (/^@/.test(t)) { const [, e, i] = /^@(.*?)\.(.*?)$/.exec(t), o = e ? this.getval(e) : ""; if (o) try { const t = JSON.parse(o); s = t ? this.lodash_get(t, i, "") : s } catch (t) { s = "" } } return s } setdata(t, s) { let e = !1; if (/^@/.test(s)) { const [, i, o] = /^@(.*?)\.(.*?)$/.exec(s), h = this.getval(i), a = i ? "null" === h ? null : h || "{}" : "{}"; try { const s = JSON.parse(a); this.lodash_set(s, o, t), e = this.setval(JSON.stringify(s), i) } catch (s) { const h = {}; this.lodash_set(h, o, t), e = this.setval(JSON.stringify(h), i) } } else e = $.setval(t, s); return e } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, s) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, s) : this.isQuanX() ? $prefs.setValueForKey(t, s) : this.isNode() ? (this.data = this.loaddata(), this.data[s] = t, this.writedata(), !0) : this.data && this.data[s] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, s = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? $httpClient.get(t, (t, e, i) => { !t && e && (e.body = i, e.statusCode = e.status), s(t, e, i) }) : this.isQuanX() ? $task.fetch(t).then(t => { const { statusCode: e, statusCode: i, headers: o, body: h } = t; s(null, { status: e, statusCode: i, headers: o, body: h }, h) }, t => s(t)) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, s) => { try { const e = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(e, null), s.cookieJar = this.ckjar } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: e, statusCode: i, headers: o, body: h } = t; s(null, { status: e, statusCode: i, headers: o, body: h }, h) }, t => s(t))) } post(t, s = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) $httpClient.post(t, (t, e, i) => { !t && e && (e.body = i, e.statusCode = e.status), s(t, e, i) }); else if (this.isQuanX()) t.method = "POST", $task.fetch(t).then(t => { const { statusCode: e, statusCode: i, headers: o, body: h } = t; s(null, { status: e, statusCode: i, headers: o, body: h }, h) }, t => s(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: e, ...i } = t; this.got.post(e, i).then(t => { const { statusCode: e, statusCode: i, headers: o, body: h } = t; s(null, { status: e, statusCode: i, headers: o, body: h }, h) }, t => s(t)) } } time(t) { let s = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in s) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? s[e] : ("00" + s[e]).substr(("" + s[e]).length))); return t } msg(s = t, e = "", i = "", o) { const h = t => !t || !this.isLoon() && this.isSurge() ? t : "string" == typeof t ? this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : void 0 : "object" == typeof t && (t["open-url"] || t["media-url"]) ? this.isLoon() ? t["open-url"] : this.isQuanX() ? t : void 0 : void 0; $.isMute || (this.isSurge() || this.isLoon() ? $notification.post(s, e, i, h(o)) : this.isQuanX() && $notify(s, e, i, h(o))), this.logs.push("", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="), this.logs.push(s), e && this.logs.push(e), i && this.logs.push(i) } log(...t) { t.length > 0 ? this.logs = [...this.logs, ...t] : console.log(this.logs.join(this.logSeparator)) } logErr(t, s) { const e = !this.isSurge() && !this.isQuanX() && !this.isLoon(); e ? $.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : $.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(s => setTimeout(s, t)) } done(t = {}) { const s = (new Date).getTime(), e = (s - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, s) } 682 | -------------------------------------------------------------------------------- /sendNotify.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # _*_ coding:utf-8 _*_ 3 | 4 | import sys 5 | import os, re 6 | cur_path = os.path.abspath(os.path.dirname(__file__)) 7 | root_path = os.path.split(cur_path)[0] 8 | sys.path.append(root_path) 9 | import requests 10 | import json 11 | import time 12 | import hmac 13 | import hashlib 14 | import base64 15 | import urllib.parse 16 | from requests.adapters import HTTPAdapter 17 | from urllib3.util import Retry 18 | 19 | # 通知服务 20 | BARK = '' # bark服务,自行搜索; secrets可填; 21 | SCKEY = '' # Server酱的SCKEY; secrets可填 22 | TG_BOT_TOKEN = '' # tg机器人的TG_BOT_TOKEN; secrets可填1407203283:AAG9rt-6RDaaX0HBLZQq0laNOh898iFYaRQ 23 | TG_USER_ID = '' # tg机器人的TG_USER_ID; secrets可填 1434078534 24 | TG_API_HOST='' # tg 代理api 25 | TG_PROXY_IP = '' # tg机器人的TG_PROXY_IP; secrets可填 26 | TG_PROXY_PORT = '' # tg机器人的TG_PROXY_PORT; secrets可填 27 | DD_BOT_ACCESS_TOKEN = '' # 钉钉机器人的DD_BOT_ACCESS_TOKEN; secrets可填 28 | DD_BOT_SECRET = '' # 钉钉机器人的DD_BOT_SECRET; secrets可填 29 | QQ_SKEY = '' # qq机器人的QQ_SKEY; secrets可填 30 | QQ_MODE = '' # qq机器人的QQ_MODE; secrets可填 31 | QYWX_AM = '' # 企业微信 32 | PUSH_PLUS_TOKEN = '' # 微信推送Plus+ 33 | 34 | notify_mode = [] 35 | 36 | message_info = '''''' 37 | 38 | # GitHub action运行需要填写对应的secrets 39 | if "BARK" in os.environ and os.environ["BARK"]: 40 | BARK = os.environ["BARK"] 41 | if "SCKEY" in os.environ and os.environ["SCKEY"]: 42 | SCKEY = os.environ["SCKEY"] 43 | if "TG_BOT_TOKEN" in os.environ and os.environ["TG_BOT_TOKEN"] and "TG_USER_ID" in os.environ and os.environ["TG_USER_ID"]: 44 | TG_BOT_TOKEN = os.environ["TG_BOT_TOKEN"] 45 | TG_USER_ID = os.environ["TG_USER_ID"] 46 | if "TG_API_HOST" in os.environ and os.environ["TG_API_HOST"]: 47 | TG_API_HOST = os.environ["TG_API_HOST"] 48 | if "DD_BOT_ACCESS_TOKEN" in os.environ and os.environ["DD_BOT_ACCESS_TOKEN"] and "DD_BOT_SECRET" in os.environ and os.environ["DD_BOT_SECRET"]: 49 | DD_BOT_ACCESS_TOKEN = os.environ["DD_BOT_ACCESS_TOKEN"] 50 | DD_BOT_SECRET = os.environ["DD_BOT_SECRET"] 51 | if "QQ_SKEY" in os.environ and os.environ["QQ_SKEY"] and "QQ_MODE" in os.environ and os.environ["QQ_MODE"]: 52 | QQ_SKEY = os.environ["QQ_SKEY"] 53 | QQ_MODE = os.environ["QQ_MODE"] 54 | # 获取pushplus+ PUSH_PLUS_TOKEN 55 | if "PUSH_PLUS_TOKEN" in os.environ: 56 | if len(os.environ["PUSH_PLUS_TOKEN"]) > 1: 57 | PUSH_PLUS_TOKEN = os.environ["PUSH_PLUS_TOKEN"] 58 | # print("已获取并使用Env环境 PUSH_PLUS_TOKEN") 59 | # 获取企业微信应用推送 QYWX_AM 60 | if "QYWX_AM" in os.environ: 61 | if len(os.environ["QYWX_AM"]) > 1: 62 | QYWX_AM = os.environ["QYWX_AM"] 63 | # print("已获取并使用Env环境 QYWX_AM") 64 | 65 | if BARK: 66 | notify_mode.append('bark') 67 | # print("BARK 推送打开") 68 | if SCKEY: 69 | notify_mode.append('sc_key') 70 | # print("Server酱 推送打开") 71 | if TG_BOT_TOKEN and TG_USER_ID: 72 | notify_mode.append('telegram_bot') 73 | # print("Telegram 推送打开") 74 | if DD_BOT_ACCESS_TOKEN and DD_BOT_SECRET: 75 | notify_mode.append('dingding_bot') 76 | # print("钉钉机器人 推送打开") 77 | if QQ_SKEY and QQ_MODE: 78 | notify_mode.append('coolpush_bot') 79 | # print("QQ机器人 推送打开") 80 | 81 | if PUSH_PLUS_TOKEN: 82 | notify_mode.append('pushplus_bot') 83 | # print("微信推送Plus机器人 推送打开") 84 | if QYWX_AM: 85 | notify_mode.append('wecom_app') 86 | # print("企业微信机器人 推送打开") 87 | 88 | 89 | def message(str_msg): 90 | global message_info 91 | print(str_msg) 92 | message_info = "{}\n{}".format(message_info, str_msg) 93 | sys.stdout.flush() 94 | 95 | def bark(title, content): 96 | print("\n") 97 | if not BARK: 98 | print("bark服务的bark_token未设置!!\n取消推送") 99 | return 100 | print("bark服务启动") 101 | try: 102 | response = requests.get( 103 | f"""https://api.day.app/{BARK}/{title}/{urllib.parse.quote_plus(content)}""").json() 104 | if response['code'] == 200: 105 | print('推送成功!') 106 | else: 107 | print('推送失败!') 108 | except: 109 | print('推送失败!') 110 | 111 | def serverJ(title, content): 112 | print("\n") 113 | if not SCKEY: 114 | print("server酱服务的SCKEY未设置!!\n取消推送") 115 | return 116 | print("serverJ服务启动") 117 | data = { 118 | "text": title, 119 | "desp": content.replace("\n", "\n\n") 120 | } 121 | response = requests.post(f"https://sc.ftqq.com/{SCKEY}.send", data=data).json() 122 | if response['errno'] == 0: 123 | print('推送成功!') 124 | else: 125 | print('推送失败!') 126 | 127 | # tg通知 128 | def telegram_bot(title, content): 129 | try: 130 | print("\n") 131 | bot_token = TG_BOT_TOKEN 132 | user_id = TG_USER_ID 133 | if not bot_token or not user_id: 134 | print("tg服务的bot_token或者user_id未设置!!\n取消推送") 135 | return 136 | print("tg服务启动") 137 | if TG_API_HOST: 138 | if 'http' in TG_API_HOST: 139 | url = f"{TG_API_HOST}/bot{TG_BOT_TOKEN}/sendMessage" 140 | else: 141 | url = f"https://{TG_API_HOST}/bot{TG_BOT_TOKEN}/sendMessage" 142 | else: 143 | url = f"https://api.telegram.org/bot{TG_BOT_TOKEN}/sendMessage" 144 | 145 | headers = {'Content-Type': 'application/x-www-form-urlencoded'} 146 | payload = {'chat_id': str(TG_USER_ID), 'text': f'{title}\n\n{content}', 'disable_web_page_preview': 'true'} 147 | proxies = None 148 | if TG_PROXY_IP and TG_PROXY_PORT: 149 | proxyStr = "http://{}:{}".format(TG_PROXY_IP, TG_PROXY_PORT) 150 | proxies = {"http": proxyStr, "https": proxyStr} 151 | try: 152 | response = requests.post(url=url, headers=headers, params=payload, proxies=proxies).json() 153 | except: 154 | print('推送失败!') 155 | if response['ok']: 156 | print('推送成功!') 157 | else: 158 | print('推送失败!') 159 | except Exception as e: 160 | print(e) 161 | 162 | def dingding_bot(title, content): 163 | timestamp = str(round(time.time() * 1000)) # 时间戳 164 | secret_enc = DD_BOT_SECRET.encode('utf-8') 165 | string_to_sign = '{}\n{}'.format(timestamp, DD_BOT_SECRET) 166 | string_to_sign_enc = string_to_sign.encode('utf-8') 167 | hmac_code = hmac.new(secret_enc, string_to_sign_enc, digestmod=hashlib.sha256).digest() 168 | sign = urllib.parse.quote_plus(base64.b64encode(hmac_code)) # 签名 169 | print('开始使用 钉钉机器人 推送消息...', end='') 170 | url = f'https://oapi.dingtalk.com/robot/send?access_token={DD_BOT_ACCESS_TOKEN}×tamp={timestamp}&sign={sign}' 171 | headers = {'Content-Type': 'application/json;charset=utf-8'} 172 | data = { 173 | 'msgtype': 'text', 174 | 'text': {'content': f'{title}\n\n{content}'} 175 | } 176 | response = requests.post(url=url, data=json.dumps(data), headers=headers, timeout=15).json() 177 | if not response['errcode']: 178 | print('推送成功!') 179 | else: 180 | print('推送失败!') 181 | 182 | def coolpush_bot(title, content): 183 | print("\n") 184 | if not QQ_SKEY or not QQ_MODE: 185 | print("qq服务的QQ_SKEY或者QQ_MODE未设置!!\n取消推送") 186 | return 187 | print("qq服务启动") 188 | url=f"https://qmsg.zendee.cn/{QQ_MODE}/{QQ_SKEY}" 189 | payload = {'msg': f"{title}\n\n{content}".encode('utf-8')} 190 | response = requests.post(url=url, params=payload).json() 191 | if response['code'] == 0: 192 | print('推送成功!') 193 | else: 194 | print('推送失败!') 195 | # push推送 196 | def pushplus_bot(title, content): 197 | try: 198 | print("\n") 199 | if not PUSH_PLUS_TOKEN: 200 | print("PUSHPLUS服务的token未设置!!\n取消推送") 201 | return 202 | print("PUSHPLUS服务启动") 203 | url = 'http://www.pushplus.plus/send' 204 | data = { 205 | "token": PUSH_PLUS_TOKEN, 206 | "title": title, 207 | "content": content 208 | } 209 | body = json.dumps(data).encode(encoding='utf-8') 210 | headers = {'Content-Type': 'application/json'} 211 | response = requests.post(url=url, data=body, headers=headers).json() 212 | if response['code'] == 200: 213 | print('推送成功!') 214 | else: 215 | print('推送失败!') 216 | except Exception as e: 217 | print(e) 218 | # 企业微信 APP 推送 219 | def wecom_app(title, content): 220 | try: 221 | if not QYWX_AM: 222 | print("QYWX_AM 并未设置!!\n取消推送") 223 | return 224 | QYWX_AM_AY = re.split(',', QYWX_AM) 225 | if 4 < len(QYWX_AM_AY) > 5: 226 | print("QYWX_AM 设置错误!!\n取消推送") 227 | return 228 | corpid = QYWX_AM_AY[0] 229 | corpsecret = QYWX_AM_AY[1] 230 | touser = QYWX_AM_AY[2] 231 | agentid = QYWX_AM_AY[3] 232 | try: 233 | media_id = QYWX_AM_AY[4] 234 | except: 235 | media_id = '' 236 | wx = WeCom(corpid, corpsecret, agentid) 237 | # 如果没有配置 media_id 默认就以 text 方式发送 238 | if not media_id: 239 | message = title + '\n\n' + content 240 | response = wx.send_text(message, touser) 241 | else: 242 | response = wx.send_mpnews(title, content, media_id, touser) 243 | if response == 'ok': 244 | print('推送成功!') 245 | else: 246 | print('推送失败!错误信息如下:\n', response) 247 | except Exception as e: 248 | print(e) 249 | 250 | class WeCom: 251 | def __init__(self, corpid, corpsecret, agentid): 252 | self.CORPID = corpid 253 | self.CORPSECRET = corpsecret 254 | self.AGENTID = agentid 255 | 256 | def get_access_token(self): 257 | url = 'https://qyapi.weixin.qq.com/cgi-bin/gettoken' 258 | values = {'corpid': self.CORPID, 259 | 'corpsecret': self.CORPSECRET, 260 | } 261 | req = requests.post(url, params=values) 262 | data = json.loads(req.text) 263 | return data["access_token"] 264 | 265 | def send_text(self, message, touser="@all"): 266 | send_url = 'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=' + self.get_access_token() 267 | send_values = { 268 | "touser": touser, 269 | "msgtype": "text", 270 | "agentid": self.AGENTID, 271 | "text": { 272 | "content": message 273 | }, 274 | "safe": "0" 275 | } 276 | send_msges = (bytes(json.dumps(send_values), 'utf-8')) 277 | respone = requests.post(send_url, send_msges) 278 | respone = respone.json() 279 | return respone["errmsg"] 280 | 281 | def send_mpnews(self, title, message, media_id, touser="@all"): 282 | send_url = 'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=' + self.get_access_token() 283 | send_values = { 284 | "touser": touser, 285 | "msgtype": "mpnews", 286 | "agentid": self.AGENTID, 287 | "mpnews": { 288 | "articles": [ 289 | { 290 | "title": title, 291 | "thumb_media_id": media_id, 292 | "author": "Author", 293 | "content_source_url": "", 294 | "content": message.replace('\n', '
'), 295 | "digest": message 296 | } 297 | ] 298 | } 299 | } 300 | send_msges = (bytes(json.dumps(send_values), 'utf-8')) 301 | respone = requests.post(send_url, send_msges) 302 | respone = respone.json() 303 | return respone["errmsg"] 304 | 305 | def send(title, content): 306 | """ 307 | 使用 bark, telegram bot, dingding bot, serverJ 发送手机推送 308 | :param title: 309 | :param content: 310 | :return: 311 | """ 312 | content += '\n\n开源免费By: https://github.com/curtinlv/JD-Script' 313 | for i in notify_mode: 314 | if i == 'bark': 315 | if BARK: 316 | bark(title=title, content=content) 317 | else: 318 | print('未启用 bark') 319 | continue 320 | if i == 'sc_key': 321 | if SCKEY: 322 | serverJ(title=title, content=content) 323 | else: 324 | print('未启用 Server酱') 325 | continue 326 | elif i == 'dingding_bot': 327 | if DD_BOT_ACCESS_TOKEN and DD_BOT_SECRET: 328 | dingding_bot(title=title, content=content) 329 | else: 330 | print('未启用 钉钉机器人') 331 | continue 332 | elif i == 'telegram_bot': 333 | if TG_BOT_TOKEN and TG_USER_ID: 334 | telegram_bot(title=title, content=content) 335 | else: 336 | print('未启用 telegram机器人') 337 | continue 338 | elif i == 'coolpush_bot': 339 | if QQ_SKEY and QQ_MODE: 340 | coolpush_bot(title=title, content=content) 341 | else: 342 | print('未启用 QQ机器人') 343 | continue 344 | elif i == 'pushplus_bot': 345 | if PUSH_PLUS_TOKEN: 346 | pushplus_bot(title=title, content=content) 347 | else: 348 | print('未启用 PUSHPLUS机器人') 349 | continue 350 | elif i == 'wecom_app': 351 | if QYWX_AM: 352 | wecom_app(title=title, content=content) 353 | else: 354 | print('未启用企业微信应用消息推送') 355 | continue 356 | else: 357 | print('此类推送方式不存在') 358 | 359 | 360 | def main(): 361 | send('title', 'content') 362 | 363 | 364 | if __name__ == '__main__': 365 | main() -------------------------------------------------------------------------------- /smzdm_mission.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | ENV 4 | SMZDM_COOKIE 什么值得买Cookie 多个 &区分 5 | 6 | 什么值得买自动签到任务 7 | 8 | 更新地址:https://github.com/Tsukasa007/my_script 9 | 10 | ============Quantumultx=============== 11 | [task_local] 12 | #什么值得买自动签到 13 | 43 1/8 * * * smzdm_mission.js, tag=什么值得买自动签到, img-url=https://raw.githubusercontent.com/tsukasa007/icon/master/smzdm_mission.png, enabled=true 14 | 15 | ================Loon============== 16 | [Script] 17 | cron "43 1/8 * * *" script-path=smzdm_mission.js,tag=什么值得买自动签到 18 | 19 | ===============Surge================= 20 | 什么值得买自动签到 = type=cron,cronexp="43 1/8 * * *",wake-system=1,timeout=3600,script-path=smzdm_mission.js 21 | 22 | ============小火箭========= 23 | 什么值得买自动签到 = type=cron,script-path=smzdm_mission.js, cronexpr="43 1/8 * * *", timeout=3600, enable=true 24 | */ 25 | const smzdmCookieKey = "smzdm_cookie"; 26 | const scriptName = "什么值得买"; 27 | let clickGoBuyMaxTimes = 12; // 好价点击去购买的次数 28 | let clickLikeProductMaxTimes = 7; // 好价点值次数 29 | let clickLikeArticleMaxTimes = 7; // 好文点赞次数 30 | let clickFavArticleMaxTimes = 7; // 好文收藏次数 31 | 32 | let magicJS = MagicJS(scriptName, "INFO"); 33 | const $ = new Env("什么值得买自动签到"); 34 | magicJS.unifiedPushUrl = magicJS.read("smzdm_unified_push_url") || magicJS.read("magicjs_unified_push_url"); 35 | const notify = $.isNode() ? require('./sendNotify') : ''; 36 | let result = [] 37 | let cookieSMZDMs = [] 38 | if (process.env.SMZDM_COOKIE) { 39 | if (process.env.SMZDM_COOKIE.indexOf('&') > -1) { 40 | cookieSMZDMs = process.env.SMZDM_COOKIE.split('&'); 41 | } else if (process.env.SMZDM_COOKIE.indexOf('\n') > -1) { 42 | cookieSMZDMs = process.env.SMZDM_COOKIE.split('\n'); 43 | } else { 44 | cookieSMZDMs = [process.env.SMZDM_COOKIE]; 45 | } 46 | } 47 | 48 | //签到 49 | function SignIn (cookie) { 50 | return new Promise((resolve) => { 51 | let options = { 52 | url: 'https://zhiyou.smzdm.com/user/checkin/jsonp_checkin', 53 | headers: { 54 | "Accept": "*/*", 55 | "Accept-Encoding": "gzip, deflate, br", 56 | "Accept-Language": "zh-cn", 57 | "Connection": "keep-alive", 58 | "Cookie": cookie, 59 | "Host": "zhiyou.smzdm.com", 60 | "Referer": "https://m.smzdm.com/zhuanti/life/choujiang/", 61 | "User-Agent": 62 | "Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148/smzdm 9.9.0 rv:91 (iPhone 11 Pro Max; iOS 14.2; zh_CN)/iphone_smzdmapp/9.9.0/wkwebview/jsbv_1.0.0", 63 | }, 64 | }; 65 | magicJS.get(options, (err, resp, data) => { 66 | if (err) { 67 | magicJS.logWarning(`每日签到,请求异常:${err}`); 68 | resolve(""); 69 | } else { 70 | magicJS.log(`每日签到成功`); 71 | resolve(""); 72 | } 73 | }); 74 | }); 75 | } 76 | 77 | 78 | // 获取点击去购买和点值的链接 79 | function GetProductList() { 80 | return new Promise((resolve, reject) => { 81 | let getGoBuyOptions = { 82 | url: "https://faxian.smzdm.com/", 83 | headers: { 84 | "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", 85 | "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6", 86 | "Cache-Control": "max-age=0", 87 | "Connection": "keep-alive", 88 | "Host": "www.smzdm.com", 89 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36 Edg/84.0.522.52", 90 | }, 91 | body: "", 92 | }; 93 | magicJS.get(getGoBuyOptions, (err, resp, data) => { 94 | if (err) { 95 | reject(err); 96 | } else { 97 | // 获取每日去购买的链接 98 | let goBuyList = data.match(/https?:\/\/go\.smzdm\.com\/[0-9a-zA-Z]*\/[^"']*_0/gi); 99 | if (!!goBuyList) { 100 | // 去除重复的商品链接 101 | let goBuyDict = {}; 102 | goBuyList.forEach((element) => { 103 | let productCode = element.match(/https?:\/\/go\.smzdm\.com\/[0-9a-zA-Z]*\/([^"']*_0)/)[1]; 104 | goBuyDict[productCode] = element; 105 | }); 106 | goBuyList = Object.values(goBuyDict); 107 | magicJS.logDebug(`当前获取的每日去购买链接: ${JSON.stringify(goBuyList)}`); 108 | } else { 109 | goBuyList = []; 110 | } 111 | 112 | // 获取每日点值的链接 113 | let productUrlList = data.match(/https?:\/\/www\.smzdm\.com\/p\/[0-9]*/gi); 114 | let likeProductList = []; 115 | if (!!productUrlList) { 116 | productUrlList.forEach((element) => { 117 | likeProductList.push(element.match(/https?:\/\/www\.smzdm\.com\/p\/([0-9]*)/)[1]); 118 | }); 119 | } 120 | resolve([goBuyList, likeProductList]); 121 | } 122 | }); 123 | }); 124 | } 125 | 126 | // 获取点赞和收藏的好文Id 127 | function GetDataArticleIdList() { 128 | return new Promise((resolve, reject) => { 129 | let getArticleOptions = { 130 | url: "https://post.smzdm.com/", 131 | headers: { 132 | "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", 133 | "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6", 134 | "Host": "post.smzdm.com", 135 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36 Edg/85.0.564.41", 136 | }, 137 | body: "", 138 | }; 139 | magicJS.get(getArticleOptions, (err, resp, data) => { 140 | if (err) { 141 | magicJS.logWarning(`获取好文列表失败,请求异常:${err}`); 142 | reject("GetArticleListErr"); 143 | } else { 144 | try { 145 | let articleList = data.match(/data-article=".*" data-type="zan"/gi); 146 | let result = []; 147 | articleList.forEach((element) => { 148 | result.push(element.match(/data-article="(.*)" data-type="zan"/)[1]); 149 | }); 150 | resolve(result); 151 | } catch (err) { 152 | magicJS.logWarning(`获取好文列表失败,执行异常:${err}`); 153 | reject("GetArticleListErr"); 154 | } 155 | } 156 | }); 157 | }); 158 | } 159 | 160 | // 点击去购买 161 | function ClickGoBuyButton(cookie, url) { 162 | return new Promise((resolve) => { 163 | let clickGoBuyOptions = { 164 | url: url, 165 | headers: { 166 | Cookie: cookie, 167 | }, 168 | }; 169 | magicJS.get(clickGoBuyOptions, (err, resp, data) => { 170 | resolve(); 171 | }); 172 | }); 173 | } 174 | 175 | // 好价点值 176 | function ClickLikeProduct(cookie, articleId) { 177 | return new Promise((resolve) => { 178 | let ClickLikeProductOptions = { 179 | url: "https://zhiyou.smzdm.com/user/rating/ajax_add", 180 | headers: { 181 | "Accept": "application/json, text/javascript, */*; q=0.01", 182 | "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6", 183 | "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", 184 | "Host": "zhiyou.smzdm.com", 185 | "Origin": "https://faxian.smzdm.com", 186 | "Referer": "https://faxian.smzdm.com/", 187 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36 Edg/85.0.564.41", 188 | "Cookie": cookie, 189 | }, 190 | body: `article_id=${articleId}&channel_id=3&rating=1&client_type=PC&event_key=%E7%82%B9%E5%80%BC&otype=%E5%80%BC&aid=${articleId}&p=16&cid=2&source=%E6%97%A0&atp=3&tagID=%E6%97%A0&sourcePage=https%3A%2F%2Ffaxian.smzdm.com%2F&sourceMode=%E6%97%A0`, 191 | }; 192 | magicJS.post(ClickLikeProductOptions, (err, resp, data) => { 193 | if (err) { 194 | magicJS.logWarning(`好价${articleId}点值失败,请求异常:${articleId}`); 195 | resolve(false); 196 | } else { 197 | try { 198 | let obj = JSON.parse(data); 199 | if (obj.error_code == 0) { 200 | magicJS.logDebug(`好价${articleId}点值成功`); 201 | resolve(true); 202 | } else if (obj.error_code == 1) { 203 | magicJS.logDebug(`好价${articleId}点值重复点值`); 204 | resolve(true); 205 | } else { 206 | magicJS.logWarning(`好价${articleId}点值失败,接口响应异常:${data}`); 207 | resolve(false); 208 | } 209 | } catch (err) { 210 | magicJS.logWarning(`好价${articleId}点值失败,执行异常:${articleId}`); 211 | resolve(false); 212 | } 213 | } 214 | }); 215 | }); 216 | } 217 | 218 | // 好文点赞 219 | function ClickLikeArticle(cookie, articleId) { 220 | return new Promise((resolve) => { 221 | let ClickLikeProductOptions = { 222 | url: "https://zhiyou.smzdm.com/user/rating/ajax_add", 223 | headers: { 224 | "Accept": "application/json, text/javascript, */*; q=0.01", 225 | "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6", 226 | "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", 227 | "Host": "zhiyou.smzdm.com", 228 | "Origin": "https://post.smzdm.com", 229 | "Referer": "https://post.smzdm.com/", 230 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36 Edg/85.0.564.41", 231 | "Cookie": cookie, 232 | }, 233 | body: `article_id=${articleId}&channel_id=11&rating=1&client_type=PC&event_key=%E7%82%B9%E5%80%BC&otype=%E7%82%B9%E8%B5%9E&aid=${articleId}&p=2&cid=11&source=%E6%97%A0&atp=76&tagID=%E6%97%A0&sourcePage=https%3A%2F%2Fpost.smzdm.com%2F&sourceMode=%E6%97%A0`, 234 | }; 235 | magicJS.post(ClickLikeProductOptions, (err, resp, data) => { 236 | if (err) { 237 | magicJS.logWarning(`好文${articleId}点赞失败,请求异常:${articleId}`); 238 | resolve(false); 239 | } else { 240 | try { 241 | let obj = JSON.parse(data); 242 | if (obj.error_code == 0) { 243 | magicJS.logDebug(`好文${articleId}点赞成功`); 244 | resolve(true); 245 | } else if (obj.error_code == 1 && obj.error_msg == "已喜欢") { 246 | magicJS.logDebug(`好文${articleId}点赞失败,重复点值。`); 247 | resolve(false); 248 | } else { 249 | magicJS.logWarning(`好文${articleId}点赞失败,接口响应异常:${data}`); 250 | resolve(false); 251 | } 252 | } catch (err) { 253 | magicJS.logWarning(`好文${articleId}点赞失败,请求异常:${err}`); 254 | resolve(false); 255 | } 256 | } 257 | }); 258 | }); 259 | } 260 | 261 | // 好文收藏/取消收藏 262 | function ClickFavArticle(cookie, articleId) { 263 | return new Promise((resolve) => { 264 | let options = { 265 | url: "https://zhiyou.smzdm.com/user/favorites/ajax_favorite", 266 | headers: { 267 | "Accept": "application/json, text/javascript, */*; q=0.01", 268 | "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6", 269 | "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", 270 | "Host": "zhiyou.smzdm.com", 271 | "Origin": "https://post.smzdm.com", 272 | "Referer": "https://post.smzdm.com/", 273 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36 Edg/85.0.564.41", 274 | "Cookie": cookie, 275 | }, 276 | body: `article_id=${articleId}&channel_id=11&client_type=PC&event_key=%E6%94%B6%E8%97%8F&otype=%E6%94%B6%E8%97%8F&aid=${articleId}&cid=11&p=2&source=%E6%97%A0&atp=76&tagID=%E6%97%A0&sourcePage=https%3A%2F%2Fpost.smzdm.com%2F&sourceMode=%E6%97%A0`, 277 | }; 278 | magicJS.post(options, (err, resp, data) => { 279 | if (err) { 280 | magicJS.logWarning(`好文${articleId}收藏失败,请求异常:${articleId}`); 281 | resolve(false); 282 | } else { 283 | try { 284 | let obj = JSON.parse(data); 285 | if (obj.error_code == 0) { 286 | magicJS.logDebug(`好文${articleId}收藏成功`); 287 | resolve(true); 288 | } else if (obj.error_code == 2) { 289 | magicJS.logDebug(`好文${articleId}取消收藏成功`); 290 | resolve(true); 291 | } else { 292 | magicJS.logWarning(`好文${articleId}收藏失败,接口响应异常:${data}`); 293 | resolve(false); 294 | } 295 | } catch (err) { 296 | magicJS.logWarning(`好文${articleId}收藏失败,请求异常:${err}`); 297 | resolve(false); 298 | } 299 | } 300 | }); 301 | }); 302 | } 303 | 304 | // 获取每日抽奖active_id 305 | function GetLotteryActiveId(cookie) { 306 | return new Promise((resolve) => { 307 | let options = { 308 | url: "https://m.smzdm.com/zhuanti/life/choujiang/", 309 | headers: { 310 | "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 311 | "Accept-Encoding": "gzip, deflate, br", 312 | "Accept-Language": "zh-cn", 313 | "Connection": "keep-alive", 314 | "Cookie": cookie, 315 | "Host": "m.smzdm.com", 316 | "User-Agent": 317 | "Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148/smzdm 9.9.6 rv:93.4 (iPhone13,4; iOS 14.5; zh_CN)/iphone_smzdmapp/9.9.6/wkwebview/jsbv_1.0.0", 318 | }, 319 | }; 320 | magicJS.get(options, (err, resp, data) => { 321 | if (err) { 322 | magicJS.logWarning(`获取每日抽奖Id失败,请求异常:${err}`); 323 | resolve("获取每日抽奖Id失败,请求异常"); 324 | } else { 325 | try { 326 | let activeId = /name\s?=\s?\"lottery_activity_id\"\s+value\s?=\s?\"([a-zA-Z0-9]*)\"/.exec(data); 327 | if (activeId) { 328 | resolve(activeId[1]); 329 | } else { 330 | magicJS.logWarning(`获取每日抽奖activeId失败`); 331 | resolve(""); 332 | } 333 | } catch (err) { 334 | magicJS.logWarning(`获取每日抽奖activeId失败,请求异常:${err}`); 335 | resolve(""); 336 | } 337 | } 338 | }); 339 | }); 340 | } 341 | 342 | // 每日抽奖 343 | function LotteryDraw(cookie, activeId) { 344 | return new Promise((resolve) => { 345 | let options = { 346 | url: `https://zhiyou.smzdm.com/user/lottery/jsonp_draw?callback=jQuery34109305207178886287_${new Date().getTime()}&active_id=${activeId}&_=${new Date().getTime()}`, 347 | headers: { 348 | "Accept": "*/*", 349 | "Accept-Encoding": "gzip, deflate, br", 350 | "Accept-Language": "zh-cn", 351 | "Connection": "keep-alive", 352 | "Cookie": cookie, 353 | "Host": "zhiyou.smzdm.com", 354 | "Referer": "https://m.smzdm.com/zhuanti/life/choujiang/", 355 | "User-Agent": 356 | "Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148/smzdm 9.9.0 rv:91 (iPhone 11 Pro Max; iOS 14.2; zh_CN)/iphone_smzdmapp/9.9.0/wkwebview/jsbv_1.0.0", 357 | }, 358 | }; 359 | magicJS.get(options, (err, resp, data) => { 360 | if (err) { 361 | magicJS.logWarning(`每日抽奖失败,请求异常:${err}`); 362 | resolve("每日抽奖失败,请求异常"); 363 | } else { 364 | try { 365 | let newData = /\((.*)\)/.exec(data); 366 | let obj = JSON.parse(newData[1]); 367 | if (obj.error_code === 0 || obj.error_code === 1 || obj.error_code === 4) { 368 | magicJS.logInfo(`每日抽奖结果:${obj.error_msg}`); 369 | resolve(obj.error_msg); 370 | } else { 371 | magicJS.logWarning(`每日抽奖失败,接口响应异常:${data}`); 372 | resolve("每日抽奖失败,接口响应异常"); 373 | } 374 | } catch (err) { 375 | magicJS.logWarning(`每日抽奖失败,请求异常:${err}`); 376 | resolve("每日抽奖失败,请求异常"); 377 | } 378 | } 379 | }); 380 | }); 381 | } 382 | 383 | // 获取用户信息,新版 384 | function WebGetCurrentInfoNewVersion(smzdmCookie) { 385 | return new Promise((resolve) => { 386 | let options = { 387 | url: "https://zhiyou.smzdm.com/user/exp/", 388 | headers: { 389 | Cookie: smzdmCookie, 390 | }, 391 | body: "", 392 | }; 393 | magicJS.get(options, (err, resp, data) => { 394 | if (err) { 395 | magicJS.logError(`获取用户信息失败,异常信息:${err}`); 396 | resolve([null, null, null, null, null, null, null]); 397 | } else { 398 | try { 399 | // 获取用户名 400 | let userName = data.match(/info-stuff-nickname.*zhiyou\.smzdm\.com\/user[^<]*>([^<]*)(.*)<\/div>/gi); 403 | let pointDetailList = data.match(/
(.*)<\/div>/gi); 404 | let minLength = pointTimeList.length > pointDetailList.length ? pointDetailList.length : pointTimeList.length; 405 | let userPointList = []; 406 | for (let i = 0; i < minLength; i++) { 407 | userPointList.push({ 408 | time: pointTimeList[i].match(/\
(.*)\<\/div\>/)[1], 409 | detail: pointDetailList[i].match(/\
(.*)\<\/div\>/)[1], 410 | }); 411 | } 412 | // 获取用户资源 413 | let assetsNumList = data.match(/assets-part[^<]*>(.*)(.*)(.*)(.*)(.*)(.*) { 433 | let webGetCurrentInfo = { 434 | url: `https://zhiyou.smzdm.com/user/info/jsonp_get_current?with_avatar_ornament=1&callback=jQuery112403507528653716241_${new Date().getTime()}&_=${new Date().getTime()}`, 435 | headers: { 436 | "Accept": "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01", 437 | "Accept-Language": "zh-CN,zh;q=0.9", 438 | "Connection": "keep-alive", 439 | "DNT": "1", 440 | "Host": "zhiyou.smzdm.com", 441 | "Referer": "https://zhiyou.smzdm.com/user/", 442 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36", 443 | "Cookie": smzdmCookie, 444 | }, 445 | }; 446 | magicJS.get(webGetCurrentInfo, (err, resp, data) => { 447 | try { 448 | let obj = JSON.parse(/\((.*)\)/.exec(data)[1]); 449 | if (obj["smzdm_id"] !== 0) { 450 | resolve([ 451 | obj["nickname"], // 昵称 452 | `https:${obj["avatar"]}`, // 头像 453 | obj["vip_level"], // 新版VIP等级 454 | obj["checkin"]["has_checkin"], //是否签到 455 | Number(obj["checkin"]["daily_checkin_num"]), //连续签到天数 456 | Number(obj["unread"]["notice"]["num"]), // 未读消息 457 | Number(obj["level"]), // 旧版等级 458 | Number(obj["exp"]), // 旧版经验 459 | Number(obj["point"]), // 积分 460 | Number(obj["gold"]), // 金币 461 | Number(obj["silver"]), // 碎银子 462 | ]); 463 | } else { 464 | magicJS.logWarning(`获取用户信息异常,Cookie过期或接口变化:${data}`); 465 | resolve([null, null, null, null, null, false, null, null]); 466 | } 467 | } catch (err) { 468 | magicJS.logError(`获取用户信息异常,代码执行异常:${err},接口返回数据:${data}`); 469 | resolve([null, null, null, null, null, false, null, null]); 470 | } 471 | }); 472 | }); 473 | } 474 | 475 | (async () => { 476 | // 通知信息 477 | let title = "什么值得买"; 478 | let subTitle = ""; 479 | let content = ""; 480 | // 获取Cookie 481 | // let smzdmCookie = magicJS.read(smzdmCookieKey); 482 | 483 | if (!!cookieSMZDMs === false) { 484 | // magicJS.logWarning("没有读取到什么值得买有效cookie,请访问zhiyou.smzdm.com进行登录"); 485 | // magicJS.notify(scriptName, "", "❓没有获取到Web端Cookie,请先进行登录。"); 486 | notify.sendNotify(scriptName,"没有读取到什么值得买有效cookie,请访问zhiyou.smzdm.com进行登录") 487 | content+=("\n没有读取到什么值得买有效cookie,请访问zhiyou.smzdm.com进行登录") 488 | } else { 489 | for (let i = 0; i < cookieSMZDMs.length; i++) { 490 | try { 491 | $.index = i+1 492 | content+=("\n========== [Cookie " + $.index + "] Start ========== ") 493 | magicJS.log("\n========== [Cookie " + $.index + "] Start ========== ") 494 | let smzdmCookie = cookieSMZDMs[i] 495 | // 任务完成情况 496 | let clickGoBuyTimes = 0; 497 | let clickLikePrductTimes = 0; 498 | let clickLikeArticleTimes = 0; 499 | let clickFavArticleTimes = 0; 500 | 501 | // 查询签到前用户数据 502 | let [nickName, avatar, beforeVIPLevel, beforeHasCheckin, , beforeNotice, , , beforePoint, beforeGold, beforeSilver] = await WebGetCurrentInfo(smzdmCookie); 503 | if (!nickName) { 504 | magicJS.notify(scriptName, "", "❌Cookie过期或接口变化,请尝试重新登录"); 505 | magicJS.done(); 506 | } else { 507 | let [, , , beforeExp, , beforePrestige] = await WebGetCurrentInfoNewVersion(smzdmCookie); 508 | magicJS.logInfo( 509 | `昵称:${nickName}\nWeb端签到状态:${beforeHasCheckin}\n签到前等级${beforeVIPLevel},积分${beforePoint},经验${beforeExp},金币${beforeGold},碎银子${beforeSilver}, 未读消息${beforeNotice}` 510 | ); 511 | 512 | //web签到 513 | if (!beforeHasCheckin) { 514 | content+="签到!" 515 | await SignIn(smzdmCookie); 516 | } 517 | 518 | // 每日抽奖 519 | let activeId = await GetLotteryActiveId(smzdmCookie); 520 | if (activeId){ 521 | content = await LotteryDraw(smzdmCookie, activeId); 522 | } 523 | 524 | // 获取去购买和好价Id列表 525 | let [, [goBuyList = [], likProductList = []]] = await magicJS.attempt(magicJS.retry(GetProductList, 5, 1000)(), [[], []]); 526 | // 获取好文列表 527 | let [, articleList = []] = await magicJS.attempt(magicJS.retry(GetDataArticleIdList, 5, 1000)(), []); 528 | 529 | // 好价点击去购买,Web端点击已无奖励,放弃 530 | const clickGoBuyAsync = async () => { 531 | let clickGoBuyList = goBuyList.splice(0, clickGoBuyMaxTimes); 532 | if (clickGoBuyList.length > 0) { 533 | for (let i = 0; i < clickGoBuyList.length; i++) { 534 | await ClickGoBuyButton(smzdmCookie, clickGoBuyList[i]); 535 | magicJS.logInfo(`完成第${i + 1}次“每日去购买”任务,点击链接:\n${clickGoBuyList[i]}`); 536 | clickGoBuyTimes += 1; 537 | await magicJS.sleep(3100); 538 | } 539 | } 540 | }; 541 | 542 | // 好价点值 543 | const clickLikeProductAsync = async () => { 544 | let clickLikeProductList = likProductList.splice(0, clickLikeProductMaxTimes); 545 | if (clickLikeProductList.length > 0) { 546 | for (let i = 0; i < clickLikeProductList.length; i++) { 547 | await ClickLikeProduct(smzdmCookie, clickLikeProductList[i]); 548 | magicJS.logInfo(`完成第${i + 1}次“好价点值”任务,好价Id:${clickLikeProductList[i]}`); 549 | clickLikePrductTimes += 1; 550 | await magicJS.sleep(3100); 551 | } 552 | } 553 | }; 554 | 555 | // 好文点赞 556 | const clickLikeArticleAsync = async () => { 557 | let likeArticleList = articleList.splice(0, clickLikeArticleMaxTimes); 558 | if (likeArticleList.length > 0) { 559 | for (let i = 0; i < likeArticleList.length; i++) { 560 | await ClickLikeArticle(smzdmCookie, likeArticleList[i]); 561 | magicJS.logInfo(`完成第${i + 1}次“好文点赞”任务,好文Id:${likeArticleList[i]}`); 562 | clickLikeArticleTimes += 1; 563 | await magicJS.sleep(3100); 564 | } 565 | } 566 | }; 567 | 568 | // 好文收藏 569 | const clickFavArticleAsync = async () => { 570 | let favArticleList = articleList.splice(0, clickFavArticleMaxTimes); 571 | if (favArticleList.length > 0) { 572 | // 好文收藏 573 | for (let i = 0; i < favArticleList.length; i++) { 574 | await ClickFavArticle(smzdmCookie, articleList[i]); 575 | magicJS.logInfo(`完成第${i + 1}次“好文收藏”任务,好文Id:${articleList[i]}`); 576 | clickFavArticleTimes += 1; 577 | await magicJS.sleep(3100); 578 | } 579 | // 取消收藏 580 | for (let i = 0; i < favArticleList.length; i++) { 581 | await ClickFavArticle(smzdmCookie, articleList[i]); 582 | magicJS.logInfo(`取消第${i + 1}次“好文收藏”任务的好文,好文Id:${articleList[i]}`); 583 | await magicJS.sleep(3100); 584 | } 585 | } 586 | }; 587 | 588 | await Promise.all([clickGoBuyAsync(), clickLikeProductAsync()]); 589 | await Promise.all([clickLikeArticleAsync(), clickFavArticleAsync()]); 590 | 591 | // 查询签到后用户数据 592 | await magicJS.sleep(3000); 593 | let [, , afterVIPLevel, afterHasCheckin, afterCheckinNum, afterNotice, , , afterPoint, afterGold, afterSilver] = await WebGetCurrentInfo(smzdmCookie); 594 | let [, afteruserPointList, , afterExp, , afterPrestige] = await WebGetCurrentInfoNewVersion(smzdmCookie); 595 | magicJS.logInfo( 596 | `昵称:${nickName}\nWeb端签到状态:${afterHasCheckin}\n签到后等级${afterVIPLevel},积分${afterPoint},经验${afterExp},金币${afterGold},碎银子${afterSilver},未读消息${afterNotice}` 597 | ); 598 | 599 | // 通知内容 600 | if (afterExp && beforeExp) { 601 | let addPoint = afterPoint - beforePoint; 602 | let addExp = afterExp - beforeExp; 603 | let addGold = afterGold - beforeGold; 604 | // let addPrestige = afterPrestige - beforePrestige; 605 | let addSilver = afterSilver - beforeSilver; 606 | content += !!content ? "\n" : ""; 607 | content += 608 | "积分" + 609 | afterPoint + 610 | (addPoint > 0 ? "(+" + addPoint + ")" : "") + 611 | " 经验" + 612 | afterExp + 613 | (addExp > 0 ? "(+" + addExp + ")" : "") + 614 | " 金币" + 615 | afterGold + 616 | (addGold > 0 ? "(+" + addGold + ")" : "") + 617 | "\n" + 618 | "碎银子" + 619 | afterSilver + 620 | (addSilver > 0 ? "(+" + addSilver + ")" : "") + 621 | // ' 威望' + afterPrestige + (addPrestige > 0 ? '(+' + addPrestige + ')' : '') + 622 | " 未读消息" + 623 | afterNotice; 624 | } 625 | 626 | content += `\n点值 ${clickLikePrductTimes}/${clickLikeProductMaxTimes} 去购买 ${clickGoBuyTimes}/${clickGoBuyMaxTimes}\n点赞 ${clickLikeArticleTimes}/${clickLikeArticleMaxTimes} 收藏 ${clickLikeArticleTimes}/${clickFavArticleTimes}`; 627 | 628 | content += !!content ? "\n" : ""; 629 | if (afteruserPointList.length > 0) { 630 | content += "用户近期经验变动情况(有延迟):"; 631 | afteruserPointList.forEach((element) => { 632 | content += `\n${element["time"]} ${element["detail"]}`; 633 | }); 634 | content += "\n如经验值无变动,请更新Cookie。"; 635 | } else { 636 | content += "没有获取到用户近期的经验变动情况"; 637 | } 638 | 639 | title = `${scriptName} - ${nickName} V${afterVIPLevel}`; 640 | // magicJS.notify(title, subTitle, content, { "media-url": avatar }); 641 | } 642 | } catch (err) { 643 | // magicJS.logError(`执行任务出现异常:${err}`); 644 | result.push(`执行任务出现异常:${err}`) 645 | // magicJS.notify(scriptName, "", "❌执行任务出现,请查阅日志"); 646 | notify.sendNotify( scriptName,`❌执行任务出现,请查阅日志`); 647 | } 648 | content+=("\n========== [Cookie " + $.index + "] End ========== \n\n\n") 649 | magicJS.log("\n========== [Cookie " + $.index + "] End ========== \n\n\n") 650 | result.push(content) 651 | } 652 | } 653 | magicJS.done(); 654 | notify.sendNotify( scriptName,result.join("\n")); 655 | })(); 656 | 657 | // prettier-ignore 658 | function MagicJS(scriptName="MagicJS",logLevel="INFO"){return new class{constructor(){if(this.version="2.2.3.3",this.scriptName=scriptName,this.logLevels={DEBUG:5,INFO:4,NOTIFY:3,WARNING:2,ERROR:1,CRITICAL:0,NONE:-1},this.isLoon="undefined"!=typeof $loon,this.isQuanX="undefined"!=typeof $task,this.isJSBox="undefined"!=typeof $drive,this.isNode="undefined"!=typeof module&&!this.isJSBox,this.isSurge="undefined"!=typeof $httpClient&&!this.isLoon,this.node={request:void 0,fs:void 0,data:{}},this.iOSUserAgent="Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Mobile/15E148 Safari/604.1",this.pcUserAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36 Edg/84.0.522.59",this.logLevel=logLevel,this._barkUrl="",this.isNode){this.node.fs=require("fs"),this.node.request=require("request");try{this.node.fs.accessSync("./magic.json",this.node.fs.constants.R_OK|this.node.fs.constants.W_OK)}catch(err){this.node.fs.writeFileSync("./magic.json","{}",{encoding:"utf8"})}this.node.data=require("./magic.json")}else this.isJSBox&&($file.exists("drive://MagicJS")||$file.mkdir("drive://MagicJS"),$file.exists("drive://MagicJS/magic.json")||$file.write({data:$data({string:"{}"}),path:"drive://MagicJS/magic.json"}))}set barkUrl(url){this._barkUrl=url.replace(/\/+$/g,"")}set logLevel(level){this._logLevel="string"==typeof level?level.toUpperCase():"DEBUG"}get logLevel(){return this._logLevel}get isRequest(){return"undefined"!=typeof $request&&"undefined"==typeof $response}get isResponse(){return"undefined"!=typeof $response}get request(){return"undefined"!=typeof $request?$request:void 0}get response(){return"undefined"!=typeof $response?($response.hasOwnProperty("status")&&($response.statusCode=$response.status),$response.hasOwnProperty("statusCode")&&($response.status=$response.statusCode),$response):void 0}get platform(){return this.isSurge?"Surge":this.isQuanX?"Quantumult X":this.isLoon?"Loon":this.isJSBox?"JSBox":this.isNode?"Node.js":"Unknown"}read(key,session=""){let val="";this.isSurge||this.isLoon?val=$persistentStore.read(key):this.isQuanX?val=$prefs.valueForKey(key):this.isNode?val=this.node.data:this.isJSBox&&(val=$file.read("drive://MagicJS/magic.json").string);try{this.isNode&&(val=val[key]),this.isJSBox&&(val=JSON.parse(val)[key]),session&&("string"==typeof val&&(val=JSON.parse(val)),val=val&&"object"==typeof val?val[session]:null)}catch(err){this.logError(err),val=session?{}:null,this.del(key)}void 0===val&&(val=null);try{val&&"string"==typeof val&&(val=JSON.parse(val))}catch(err){}return this.logDebug(`READ DATA [${key}]${session?`[${session}]`:""}(${typeof val})\n${JSON.stringify(val)}`),val}write(key,val,session=""){let data=session?{}:"";if(session&&(this.isSurge||this.isLoon)?data=$persistentStore.read(key):session&&this.isQuanX?data=$prefs.valueForKey(key):this.isNode?data=this.node.data:this.isJSBox&&(data=JSON.parse($file.read("drive://MagicJS/magic.json").string)),session){try{"string"==typeof data&&(data=JSON.parse(data)),data="object"==typeof data&&data?data:{}}catch(err){this.logError(err),this.del(key),data={}}this.isJSBox||this.isNode?(data[key]&&"object"==typeof data[key]||(data[key]={}),data[key].hasOwnProperty(session)||(data[key][session]=null),void 0===val?delete data[key][session]:data[key][session]=val):void 0===val?delete data[session]:data[session]=val}else this.isNode||this.isJSBox?void 0===val?delete data[key]:data[key]=val:data=void 0===val?null:val;"object"==typeof data&&(data=JSON.stringify(data)),this.isSurge||this.isLoon?$persistentStore.write(data,key):this.isQuanX?$prefs.setValueForKey(data,key):this.isNode?this.node.fs.writeFileSync("./magic.json",data):this.isJSBox&&$file.write({data:$data({string:data}),path:"drive://MagicJS/magic.json"}),this.logDebug(`WRITE DATA [${key}]${session?`[${session}]`:""}(${typeof val})\n${JSON.stringify(val)}`)}del(key,session=""){this.logDebug(`DELETE KEY [${key}]${session?`[${session}]`:""}`),this.write(key,null,session)}notify(title=this.scriptName,subTitle="",body="",opts=""){let convertOptions;if(opts=(_opts=>{let newOpts={};if("string"==typeof _opts)this.isLoon?newOpts={openUrl:_opts}:this.isQuanX?newOpts={"open-url":_opts}:this.isSurge&&(newOpts={url:_opts});else if("object"==typeof _opts)if(this.isLoon)newOpts.openUrl=_opts["open-url"]?_opts["open-url"]:"",newOpts.mediaUrl=_opts["media-url"]?_opts["media-url"]:"";else if(this.isQuanX)newOpts=_opts["open-url"]||_opts["media-url"]?_opts:{};else if(this.isSurge){let openUrl=_opts["open-url"]||_opts.openUrl;newOpts=openUrl?{url:openUrl}:{}}return newOpts})(opts),1==arguments.length&&(title=this.scriptName,subTitle="",body=arguments[0]),this.logNotify(`title:${title}\nsubTitle:${subTitle}\nbody:${body}\noptions:${"object"==typeof opts?JSON.stringify(opts):opts}`),this.isSurge)$notification.post(title,subTitle,body,opts);else if(this.isLoon)opts?$notification.post(title,subTitle,body,opts):$notification.post(title,subTitle,body);else if(this.isQuanX)$notify(title,subTitle,body,opts);else if(this.isNode){if(this._barkUrl){let content=encodeURI(`${title}/${subTitle}\n${body}`);this.get(`${this._barkUrl}/${content}`,()=>{})}}else if(this.isJSBox){let push={title:title,body:subTitle?`${subTitle}\n${body}`:body};$push.schedule(push)}}notifyDebug(title=this.scriptName,subTitle="",body="",opts=""){"DEBUG"===this.logLevel&&(1==arguments.length&&(title=this.scriptName,subTitle="",body=arguments[0]),this.notify(title,subTitle,body,opts))}log(msg,level="INFO"){this.logLevels[this._logLevel]void 0===_options.body?"":`${encodeURIComponent(key)}=${encodeURIComponent(_options.body[key])}`).join("&");_options.url.indexOf("?")<0&&(_options.url+="?"),_options.url.lastIndexOf("&")+1!=_options.url.length&&_options.url.lastIndexOf("?")+1!=_options.url.length&&(_options.url+="&"),_options.url+=qs,delete _options.body}return this.isQuanX?(_options.hasOwnProperty("body")&&"string"!=typeof _options.body&&(_options.body=JSON.stringify(_options.body)),_options.method=method):this.isNode?(delete _options.headers["Accept-Encoding"],"object"==typeof _options.body&&("GET"===method?(_options.qs=_options.body,delete _options.body):"POST"===method&&(_options.json=!0,_options.body=_options.body))):this.isJSBox&&(_options.header=_options.headers,delete _options.headers),_options}adapterHttpResponse(resp){let _resp={body:resp.body,headers:resp.headers,json:()=>JSON.parse(_resp.body)};return resp.hasOwnProperty("statusCode")&&resp.statusCode&&(_resp.status=resp.statusCode),_resp}get(options,callback){let _options=this.adapterHttpOptions(options,"GET");this.logDebug(`HTTP GET: ${JSON.stringify(_options)}`),this.isSurge||this.isLoon?$httpClient.get(_options,callback):this.isQuanX?$task.fetch(_options).then(resp=>{resp.status=resp.statusCode,callback(null,resp,resp.body)},reason=>callback(reason.error,null,null)):this.isNode?this.node.request.get(_options,(err,resp,data)=>{resp=this.adapterHttpResponse(resp),callback(err,resp,data)}):this.isJSBox&&(_options.handler=resp=>{let err=resp.error?JSON.stringify(resp.error):void 0,data="object"==typeof resp.data?JSON.stringify(resp.data):resp.data;callback(err,resp.response,data)},$http.get(_options))}getPromise(options){return new Promise((resolve,reject)=>{magicJS.get(options,(err,resp)=>{err?reject(err):resolve(resp)})})}post(options,callback){let _options=this.adapterHttpOptions(options,"POST");if(this.logDebug(`HTTP POST: ${JSON.stringify(_options)}`),this.isSurge||this.isLoon)$httpClient.post(_options,callback);else if(this.isQuanX)$task.fetch(_options).then(resp=>{resp.status=resp.statusCode,callback(null,resp,resp.body)},reason=>{callback(reason.error,null,null)});else if(this.isNode){let resp=this.node.request.post(_options,callback);resp.status=resp.statusCode,delete resp.statusCode}else this.isJSBox&&(_options.handler=resp=>{let err=resp.error?JSON.stringify(resp.error):void 0,data="object"==typeof resp.data?JSON.stringify(resp.data):resp.data;callback(err,resp.response,data)},$http.post(_options))}get http(){return{get:this.getPromise,post:this.post}}done(value={}){"undefined"!=typeof $done&&$done(value)}isToday(day){if(null==day)return!1;{let today=new Date;return"string"==typeof day&&(day=new Date(day)),today.getFullYear()==day.getFullYear()&&today.getMonth()==day.getMonth()&&today.getDay()==day.getDay()}}isNumber(val){return"NaN"!==parseFloat(val).toString()}attempt(promise,defaultValue=null){return promise.then(args=>[null,args]).catch(ex=>(this.logError(ex),[ex,defaultValue]))}retry(fn,retries=5,interval=0,callback=null){return(...args)=>new Promise((resolve,reject)=>{function _retry(...args){Promise.resolve().then(()=>fn.apply(this,args)).then(result=>{"function"==typeof callback?Promise.resolve().then(()=>callback(result)).then(()=>{resolve(result)}).catch(ex=>{retries>=1?interval>0?setTimeout(()=>_retry.apply(this,args),interval):_retry.apply(this,args):reject(ex),retries--}):resolve(result)}).catch(ex=>{this.logRetry(ex),retries>=1&&interval>0?setTimeout(()=>_retry.apply(this,args),interval):retries>=1?_retry.apply(this,args):reject(ex),retries--})}_retry.apply(this,args)})}formatTime(time,fmt="yyyy-MM-dd hh:mm:ss"){var o={"M+":time.getMonth()+1,"d+":time.getDate(),"h+":time.getHours(),"m+":time.getMinutes(),"s+":time.getSeconds(),"q+":Math.floor((time.getMonth()+3)/3),S:time.getMilliseconds()};/(y+)/.test(fmt)&&(fmt=fmt.replace(RegExp.$1,(time.getFullYear()+"").substr(4-RegExp.$1.length)));for(let k in o)new RegExp("("+k+")").test(fmt)&&(fmt=fmt.replace(RegExp.$1,1==RegExp.$1.length?o[k]:("00"+o[k]).substr((""+o[k]).length)));return fmt}now(){return this.formatTime(new Date,"yyyy-MM-dd hh:mm:ss")}today(){return this.formatTime(new Date,"yyyy-MM-dd")}sleep(time){return new Promise(resolve=>setTimeout(resolve,time))}}(scriptName)}//Tsukasa 659 | // prettier-ignore 660 | function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} 661 | -------------------------------------------------------------------------------- /tmp.json: -------------------------------------------------------------------------------- 1 | { 2 | "success": true, 3 | "code": 0, 4 | "errMsg": "success", 5 | "data": { 6 | "activityId": null, 7 | "level": 1, 8 | "scene": 1, 9 | "hasStartCoin": 0, 10 | "startCoin": 10000, 11 | "guideStep": 0, 12 | "userIcon": "http://storage.360buyimg.com/i.imageUpload/53465846514454435a31353939303936363435303338_mid.jpg", 13 | "joyCoin": 5000, 14 | "bigRewardState": null, 15 | "workPlaceUnlock": 0, 16 | "speed": "1", 17 | "upSpeed": 0, 18 | "maxReward": "{\"rewardImgList\":[\"jfs/t1/190700/6/11734/99836/60e17d8eEab112dc6/e8c61bc2937b53a8.png\",\"jfs/t1/186443/15/11401/42768/60e17da0E497176af/c93969886a78eba2.png\",\"jfs/t1/178771/25/12623/88109/60e17db5E1c47ce94/c6046a8f88d56c07.png\",\"jfs/t1/195669/32/11692/75352/60e17dc0E6645fbf2/06eb9e2c78032b5c.png\",\"jfs/t1/191139/31/11650/79296/60e17dceE20331eb8/89f3741a627c7ade.png\",\"jfs/t1/189168/15/11602/86048/60e17de7E1ea60c0f/bbb08fd7cbbd74f5.png\",\"jfs/t1/186726/21/11692/82381/60e17defE1d3ae134/071e71e93b6d45c8.png\",\"jfs/t1/182570/8/12619/72169/60e17df9E6aac8963/20fd7cd0e08b400d.png\"],\"rewardLocation\":6}", 19 | "leaveJoyCoin": null, 20 | "fastBuyLevel": 1, 21 | "fastBuyCoin": 100, 22 | "invitePin": "CfgxIoNL6R_NkZrLj7lU5w", 23 | "helpType": null, 24 | "helpState": 0, 25 | "serverTime": 1625556827683, 26 | "warningMsg": "", 27 | "successMsg": "" 28 | } 29 | } 30 | 31 | 32 | 33 | { 34 | "success": true, 35 | "code": 0, 36 | "errMsg": "success", 37 | "data": { 38 | "activityId": null, 39 | "level": 1, 40 | "scene": 1, 41 | "hasStartCoin": 0, 42 | "startCoin": 10000, 43 | "guideStep": 0, 44 | "userIcon": null, 45 | "joyCoin": 5000, 46 | "bigRewardState": null, 47 | "workPlaceUnlock": 0, 48 | "speed": "1", 49 | "upSpeed": 0, 50 | "maxReward": "{\"rewardImgList\":[\"jfs/t1/190700/6/11734/99836/60e17d8eEab112dc6/e8c61bc2937b53a8.png\",\"jfs/t1/186443/15/11401/42768/60e17da0E497176af/c93969886a78eba2.png\",\"jfs/t1/178771/25/12623/88109/60e17db5E1c47ce94/c6046a8f88d56c07.png\",\"jfs/t1/195669/32/11692/75352/60e17dc0E6645fbf2/06eb9e2c78032b5c.png\",\"jfs/t1/191139/31/11650/79296/60e17dceE20331eb8/89f3741a627c7ade.png\",\"jfs/t1/189168/15/11602/86048/60e17de7E1ea60c0f/bbb08fd7cbbd74f5.png\",\"jfs/t1/186726/21/11692/82381/60e17defE1d3ae134/071e71e93b6d45c8.png\",\"jfs/t1/182570/8/12619/72169/60e17df9E6aac8963/20fd7cd0e08b400d.png\"],\"rewardLocation\":6}", 51 | "leaveJoyCoin": null, 52 | "fastBuyLevel": 1, 53 | "fastBuyCoin": 100, 54 | "invitePin": "bRAgcTi7xX4kzTvCwgc4j2MzLG9DSLvNhZ-goZjMMAY", 55 | "helpType": null, 56 | "helpState": 0, 57 | "serverTime": 1, 58 | "warningMsg": "", 59 | "successMsg": "" 60 | } 61 | --------------------------------------------------------------------------------