isundae-yyy 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +45 -0
- package/package.json +22 -0
package/index.js
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
|
3
|
+
const { default: axios } = require('axios')
|
4
|
+
|
5
|
+
const url =
|
6
|
+
'https://cat-match.easygame2021.com/sheep/v1/game/game_over?rank_score=1&rank_state=1&rank_time=12&rank_role=1&skin=1'
|
7
|
+
|
8
|
+
const token =
|
9
|
+
process.argv[2] ||
|
10
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTQzNTYyNjcsIm5iZiI6MTY2MzI1NDA2NywiaWF0IjoxNjYzMjUyMjY3LCJqdGkiOiJDTTpjYXRfbWF0Y2g6bHQxMjM0NTYiLCJvcGVuX2lkIjoiIiwidWlkIjo5OTk1ODk4LCJkZWJ1ZyI6IiIsImxhbmciOiIifQ.HP7yNQcgOx2ptCIunu-SR4c0poHLJB5h6oAX2k7zZYc'
|
11
|
+
|
12
|
+
const n = isNaN(Number(process.argv[3])) ? 10 : Number(process.argv[3])
|
13
|
+
|
14
|
+
const headers = {
|
15
|
+
Host: 'cat-match.easygame2021.com',
|
16
|
+
'Content-Type': 'application/json',
|
17
|
+
'Accept-Encoding': 'gzip,compress,br,deflate',
|
18
|
+
'User-Agent':
|
19
|
+
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 MicroMessenger/7.0.4.501 NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF',
|
20
|
+
t: token
|
21
|
+
}
|
22
|
+
|
23
|
+
async function sheep() {
|
24
|
+
try {
|
25
|
+
const res = await axios.get(url, { headers })
|
26
|
+
return res.data
|
27
|
+
} catch (error) {
|
28
|
+
console.log('💀 失败 =>' + error)
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
;(function (n, t = 100, i = 1) {
|
33
|
+
const s = setInterval(async () => {
|
34
|
+
const res = await sheep()
|
35
|
+
if (res.err_code == 0) {
|
36
|
+
console.log(`✨ 闯关成功: ${i++} 次! ${JSON.stringify(res)}`)
|
37
|
+
if (i >= n) clearInterval(s)
|
38
|
+
} else if (res.err_code == 10003) {
|
39
|
+
console.log(`💀 闯关失败:请检查t的值是否正确`)
|
40
|
+
clearInterval(s)
|
41
|
+
} else {
|
42
|
+
console.log(`💀 不知所措`)
|
43
|
+
}
|
44
|
+
}, t)
|
45
|
+
})(n)
|
package/package.json
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"name": "isundae-yyy",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
8
|
+
},
|
9
|
+
"keywords": [],
|
10
|
+
"author": "",
|
11
|
+
"license": "ISC",
|
12
|
+
"dependencies": {
|
13
|
+
"axios": "^0.27.2",
|
14
|
+
"commander": "^9.4.0"
|
15
|
+
},
|
16
|
+
"devDependencies": {
|
17
|
+
"@types/node": "^18.7.18"
|
18
|
+
},
|
19
|
+
"bin": {
|
20
|
+
"isundae-yyy": "./index.js"
|
21
|
+
}
|
22
|
+
}
|