gj-boomlings-api 1.3.6 → 1.4.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/.nvmrc +0 -0
- package/README.md +12 -167
- package/config.json +1 -1
- package/functions/blockUser.js +7 -11
- package/functions/deleteAccountPost.js +3 -9
- package/functions/deleteComment.js +3 -9
- package/functions/deleteLevel.js +26 -0
- package/functions/dlLevel.js +5 -40
- package/functions/dlMessage.js +4 -9
- package/functions/getAccountPosts.js +4 -9
- package/functions/getBlockedList.js +56 -0
- package/functions/getCommentHistory.js +8 -11
- package/functions/getComments.js +6 -10
- package/functions/getCreatorScores.js +3 -5
- package/functions/getFriendsList.js +52 -0
- package/functions/getGauntlets.js +2 -7
- package/functions/getLevelByID.js +3 -8
- package/functions/getMapPacks.js +2 -8
- package/functions/getMessages.js +5 -10
- package/functions/getProfile.js +6 -15
- package/functions/getSongInfo.js +2 -6
- package/functions/getTop100.js +3 -5
- package/functions/getUserLevels.js +6 -9
- package/functions/reportLevel.js +3 -7
- package/functions/searchLevels.js +3 -7
- package/functions/searchUsers.js +3 -8
- package/functions/unblockUser.js +7 -11
- package/functions/updateLevelDesc.js +6 -10
- package/functions/uploadAccountPost.js +3 -8
- package/functions/uploadComment.js +4 -11
- package/functions/uploadMessage.js +4 -9
- package/index.js +10 -2
- package/misc/decodeLevel.js +4 -5
- package/misc/demonlist.js +6 -6
- package/misc/gjReq.js +25 -0
- package/package.json +1 -4
package/.nvmrc
CHANGED
|
Binary file
|
package/README.md
CHANGED
|
@@ -2,183 +2,28 @@
|
|
|
2
2
|
<h1>
|
|
3
3
|
<a href="https://www.npmjs.com/package/gj-boomlings-api"><img src="https://shikoshib.github.io/font1.png" width="576"></a>
|
|
4
4
|
</h1>
|
|
5
|
-
A light-weight Geometry Dash API wrapper<br><br><a href="https://
|
|
5
|
+
A light-weight Geometry Dash API wrapper<br><br><a href="https://github.com/shikoshib/gj-boomlings-api/wiki"><b>Documentation</b></a><br><br>
|
|
6
6
|
<a href="https://www.npmjs.com/package/gj-boomlings-api"><img src="https://img.shields.io/npm/v/gj-boomlings-api.svg?maxAge=3600" alt="npm version" /></a>
|
|
7
|
+
<img alt="npm bundle size" src="https://img.shields.io/bundlephobia/min/gj-boomlings-api">
|
|
8
|
+
<a href="https://github.com/shikoshib/gj-boomlings-api/actions/workflows/node.js.yml"><img src="https://github.com/shikoshib/gj-boomlings-api/actions/workflows/node.js.yml/badge.svg" /></a>
|
|
7
9
|
<a href="https://www.npmjs.com/package/gj-boomlings-api"><img src="https://img.shields.io/npm/dt/gj-boomlings-api" /></a>
|
|
8
10
|
<a href="https://snyk.io/test/github/shikoshib/gj-boomlings-api"><img src="https://snyk.io/test/github/shikoshib/gj-boomlings-api/badge.svg" alt="Known Vulnerabilities" /></a>
|
|
9
11
|
<a href="https://packagequality.com/#?package=gj-boomlings-api"><img src="https://packagequality.com/shield/gj-boomlings-api.svg"/></a>
|
|
10
12
|
</div>
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
So basically this function downloads the entire level and converts the response into JSON.
|
|
17
|
-
|
|
18
|
-
```js
|
|
19
|
-
const gd = require("gj-boomlings-api");
|
|
20
|
-
gd.dlLevel(42584142).then(console.log);
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Returns:
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
{
|
|
27
|
-
id: 42584142,
|
|
28
|
-
name: 'Bloodlust',
|
|
29
|
-
description: 'Your thirst for blood continues? Very well, let the blood spill. Let the demons feed off your unfortunate soul...',
|
|
30
|
-
creator: 'Knobbelboy',
|
|
31
|
-
level_version: 3,
|
|
32
|
-
difficulty: 'Extreme Demon',
|
|
33
|
-
stars: 10,
|
|
34
|
-
downloads: 19055472,
|
|
35
|
-
likes: 701448,
|
|
36
|
-
disliked: false,
|
|
37
|
-
length: 'XL',
|
|
38
|
-
password: '21296',
|
|
39
|
-
demon: true,
|
|
40
|
-
featured: true,
|
|
41
|
-
epic: true,
|
|
42
|
-
objects: 170739,
|
|
43
|
-
uploaded: '4 years',
|
|
44
|
-
updated: '6 months',
|
|
45
|
-
stars_requested: 10,
|
|
46
|
-
game_version: '2.1',
|
|
47
|
-
ldm: false,
|
|
48
|
-
copied: 25066306,
|
|
49
|
-
large: true,
|
|
50
|
-
two_p: false,
|
|
51
|
-
coins: 0,
|
|
52
|
-
verified_coins: false,
|
|
53
|
-
song: {
|
|
54
|
-
name: 'At the Speed of Light',
|
|
55
|
-
id: 467339,
|
|
56
|
-
artist: 'Dimrain47',
|
|
57
|
-
artistId: 52,
|
|
58
|
-
fileSize: '9.56 MB',
|
|
59
|
-
link: 'https://geometrydashcontent.b-cdn.net/songs/467339.mp3'
|
|
60
|
-
},
|
|
61
|
-
pointercrate: {
|
|
62
|
-
position: 50,
|
|
63
|
-
publisher: 'knobbelboy',
|
|
64
|
-
verifier: 'knobbelboy'
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
### getProfile(user)
|
|
69
|
-
|
|
70
|
-
With this function, you can get somebody's profile info. You can use a player ID (not the account ID) or a name string, it doesn't matter.
|
|
71
|
-
|
|
72
|
-
```js
|
|
73
|
-
const gd = require("gj-boomlings-api");
|
|
74
|
-
gd.getProfile(16).then(console.log); // returns RobTop's info
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Returns:
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
{
|
|
81
|
-
username: 'RobTop',
|
|
82
|
-
playerID: 16,
|
|
83
|
-
accountID: 71,
|
|
84
|
-
rank: 220553,
|
|
85
|
-
color1: '#7D00FF',
|
|
86
|
-
color2: '#00FFFF',
|
|
87
|
-
stars: 2389,
|
|
88
|
-
diamonds: 2169,
|
|
89
|
-
secretCoins: 3,
|
|
90
|
-
userCoins: 140,
|
|
91
|
-
demons: 5,
|
|
92
|
-
creatorPoints: 0,
|
|
93
|
-
messages: 'none',
|
|
94
|
-
friendRequests: 'none',
|
|
95
|
-
commentHistory: 'all',
|
|
96
|
-
mod: 'elder',
|
|
97
|
-
youtube: 'https://youtube.com/channel/UCz_yk8mDSAnxJq0ar66L4sw',
|
|
98
|
-
twitter: 'https://twitter.com/RobTopGames',
|
|
99
|
-
twitch: 'https://twitch.tv/robtopgames'
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
### uploadComment(comment, id, user, password, percent)
|
|
103
|
-
|
|
104
|
-
You can post comments with this function.
|
|
105
|
-
|
|
106
|
-
For example,
|
|
107
|
-
```js
|
|
108
|
-
const gd = require("gj-boomlings-api");
|
|
109
|
-
gd.uploadComment("I love gj-boomlings-api!", 83925274, "gmdshxdow", "*********", 99).then(console.log);
|
|
110
|
-
// of course you need to replace the asterisks with your password
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Posts a comment on the level with the ID of 83925274, with 99 percent, on gmdshxdow's behalf.
|
|
114
|
-
### getMapPacks(page)
|
|
115
|
-
|
|
116
|
-
This function gets the info about the map packs on a specified page (if left out, defaults to 1).
|
|
117
|
-
|
|
118
|
-
```js
|
|
119
|
-
const gd = require("gj-boomlings-api");
|
|
120
|
-
gd.getMapPacks(7).then(console.log);
|
|
14
|
+
# About
|
|
15
|
+
**gj-boomlings-api** is a light-weight Node.js module that allows you to easily interact with Geometry Dash API.
|
|
16
|
+
# Installation
|
|
17
|
+
**Node.js 18.0.0 or newer is required.**
|
|
121
18
|
```
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
19
|
+
npm i gj-boomlings-api
|
|
20
|
+
yarn add gj-boomlings-api
|
|
125
21
|
```
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
id: 49,
|
|
130
|
-
levels: [ 764038, 897837, 848722 ],
|
|
131
|
-
stars: 10,
|
|
132
|
-
coins: 2,
|
|
133
|
-
difficulty: 'Hard Demon',
|
|
134
|
-
textColor: '#00FF00',
|
|
135
|
-
barColor: '#00FF00'
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
name: 'Demon Pack 14',
|
|
139
|
-
id: 50,
|
|
140
|
-
levels: [ 840397, 413504, 839175 ],
|
|
141
|
-
stars: 10,
|
|
142
|
-
coins: 2,
|
|
143
|
-
difficulty: 'Hard Demon',
|
|
144
|
-
textColor: '#00FFFF',
|
|
145
|
-
barColor: '#00FFFF'
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
name: 'Demon Pack 15',
|
|
149
|
-
id: 64,
|
|
150
|
-
levels: [ 1018758, 1326086, 1698428 ],
|
|
151
|
-
stars: 10,
|
|
152
|
-
coins: 2,
|
|
153
|
-
difficulty: 'Hard Demon',
|
|
154
|
-
textColor: '#FF0000',
|
|
155
|
-
barColor: '#FF0000'
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
name: 'Demon Pack 16',
|
|
159
|
-
id: 65,
|
|
160
|
-
levels: [ 1668421, 1703546, 923264 ],
|
|
161
|
-
stars: 10,
|
|
162
|
-
coins: 2,
|
|
163
|
-
difficulty: 'Hard Demon',
|
|
164
|
-
textColor: '#FFFF00',
|
|
165
|
-
barColor: '#FFFF00'
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
name: 'Demon Pack 17',
|
|
169
|
-
id: 66,
|
|
170
|
-
levels: [ 1650666, 1474319, 1777565 ],
|
|
171
|
-
stars: 10,
|
|
172
|
-
coins: 2,
|
|
173
|
-
difficulty: 'Hard Demon',
|
|
174
|
-
textColor: '#96FF96',
|
|
175
|
-
barColor: '#96FF96'
|
|
176
|
-
}
|
|
177
|
-
]
|
|
22
|
+
## In browser...
|
|
23
|
+
```html
|
|
24
|
+
<script src="https://shikoshib.github.io/gba-max.min.js"></script>
|
|
178
25
|
```
|
|
179
26
|
|
|
180
|
-
**Check out [docs](./docs/) for more info.**
|
|
181
|
-
|
|
182
27
|
---
|
|
183
28
|
|
|
184
29
|
Inspired by [GDBrowser](https://github.com/GDColon/GDBrowser/). Thanks to [Wireshark](https://www.wireshark.org/) and [GD Docs](https://github.com/gd-programming/gd.docs/) for helping me in creating this package.
|
package/config.json
CHANGED
package/functions/blockUser.js
CHANGED
|
@@ -4,16 +4,16 @@ module.exports = {
|
|
|
4
4
|
if(!target || target == "") throw new Error("Please provide a target's player ID or username!");
|
|
5
5
|
if(!username || username == "") throw new Error("Please provide your player ID or username!");
|
|
6
6
|
if(!password || password == "") throw new Error("Please provide your password!");
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
8
9
|
const { searchUsers } = require("./searchUsers.js");
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
let user = await searchUsers(username);
|
|
12
12
|
let targetObj = await searchUsers(target);
|
|
13
13
|
|
|
14
14
|
const {gjp} = require("../misc/gjp.js");
|
|
15
|
-
|
|
16
|
-
const
|
|
15
|
+
|
|
16
|
+
const data = {
|
|
17
17
|
gameVersion: 21,
|
|
18
18
|
binaryVersion: 35,
|
|
19
19
|
gdw: 0,
|
|
@@ -23,12 +23,8 @@ module.exports = {
|
|
|
23
23
|
gjp: gjp(password)
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
let res = await
|
|
27
|
-
|
|
28
|
-
}).catch(e => {
|
|
29
|
-
if(res.data.toString().toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
30
|
-
throw new Error(e)
|
|
31
|
-
})
|
|
26
|
+
let res = await gjReq("blockGJUser20", data);
|
|
27
|
+
if(res.data == -1) throw new Error(-1);
|
|
32
28
|
|
|
33
29
|
return 1;
|
|
34
30
|
}
|
|
@@ -5,8 +5,7 @@ module.exports = {
|
|
|
5
5
|
if(!str || str == "") throw new Error("Please provide a user ID or name!");
|
|
6
6
|
if(!password || password == "") throw new Error("Please provide a password!");
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
const { headers, server } = require("../config.json");
|
|
8
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
10
9
|
const { searchUsers } = require("./searchUsers.js");
|
|
11
10
|
|
|
12
11
|
let user = await searchUsers(str);
|
|
@@ -14,7 +13,7 @@ module.exports = {
|
|
|
14
13
|
const XOR = require("../misc/xor.js");
|
|
15
14
|
const xor = new XOR();
|
|
16
15
|
|
|
17
|
-
let
|
|
16
|
+
let data = {
|
|
18
17
|
gameVersion: 21,
|
|
19
18
|
binaryVersion: 35,
|
|
20
19
|
gdw: 0,
|
|
@@ -24,12 +23,7 @@ module.exports = {
|
|
|
24
23
|
commentID: id,
|
|
25
24
|
};
|
|
26
25
|
|
|
27
|
-
let res = await
|
|
28
|
-
headers: headers
|
|
29
|
-
}).catch(e => {
|
|
30
|
-
throw new Error(e.response.data);
|
|
31
|
-
})
|
|
32
|
-
|
|
26
|
+
let res = await gjReq("deleteGJAccComment20", data);
|
|
33
27
|
if(res.data == -1) throw new Error(-1);
|
|
34
28
|
|
|
35
29
|
return 1;
|
|
@@ -6,8 +6,7 @@ module.exports = {
|
|
|
6
6
|
if(!str || str == "") throw new Error("Please provide a user ID or name!");
|
|
7
7
|
if(!password || password == "") throw new Error("Please provide a password!");
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const { headers, server } = require("../config.json");
|
|
9
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
11
10
|
const { searchUsers } = require("./searchUsers.js");
|
|
12
11
|
|
|
13
12
|
let user = await searchUsers(str);
|
|
@@ -15,7 +14,7 @@ module.exports = {
|
|
|
15
14
|
const XOR = require("../misc/xor.js");
|
|
16
15
|
const xor = new XOR();
|
|
17
16
|
|
|
18
|
-
let
|
|
17
|
+
let data = {
|
|
19
18
|
accountID: user.accountID,
|
|
20
19
|
secret: "Wmfd2893gb7",
|
|
21
20
|
levelID: lvl,
|
|
@@ -23,12 +22,7 @@ module.exports = {
|
|
|
23
22
|
commentID: id,
|
|
24
23
|
};
|
|
25
24
|
|
|
26
|
-
let res = await
|
|
27
|
-
headers: headers
|
|
28
|
-
}).catch(e => {
|
|
29
|
-
throw new Error(e.response.data);
|
|
30
|
-
})
|
|
31
|
-
|
|
25
|
+
let res = await gjReq("deleteGJComment20", data);
|
|
32
26
|
if(res.data == -1) throw new Error(-1);
|
|
33
27
|
|
|
34
28
|
return 1;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
deleteLevel:
|
|
3
|
+
async function(lvl, str, password) {
|
|
4
|
+
if(!lvl || lvl == "") throw new Error("Please provide a level ID!");
|
|
5
|
+
if(!str || str == "") throw new Error("Please provide a user ID or name!");
|
|
6
|
+
if(!password || password == "") throw new Error("Please provide a password!");
|
|
7
|
+
|
|
8
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
9
|
+
const { searchUsers } = require("./searchUsers.js");
|
|
10
|
+
const {gjp} = require("../misc/gjp.js");
|
|
11
|
+
|
|
12
|
+
let user = await searchUsers(str);
|
|
13
|
+
|
|
14
|
+
let data = {
|
|
15
|
+
accountID: user.accountID,
|
|
16
|
+
secret: "Wmfv2898gc9",
|
|
17
|
+
levelID: lvl,
|
|
18
|
+
gjp: gjp(password),
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
let res = await gjReq("deleteGJLevelUser20", data);
|
|
22
|
+
if(res.data == -1) throw new Error(-1);
|
|
23
|
+
|
|
24
|
+
return 1;
|
|
25
|
+
}
|
|
26
|
+
}
|
package/functions/dlLevel.js
CHANGED
|
@@ -6,8 +6,8 @@ module.exports = {
|
|
|
6
6
|
if(!level || level == "") throw new Error("Please provide a level ID.");
|
|
7
7
|
if(isNaN(level)) throw new Error("The level parameter should be a number.");
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const {
|
|
9
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
10
|
+
const { server } = require("../config.json");
|
|
11
11
|
|
|
12
12
|
const XOR = require("../misc/xor.js");
|
|
13
13
|
let xor = new XOR()
|
|
@@ -20,12 +20,7 @@ module.exports = {
|
|
|
20
20
|
secret: "Wmfd2893gb7"
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
let res = await
|
|
24
|
-
headers: headers
|
|
25
|
-
}).catch(e => {
|
|
26
|
-
throw new Error(e.response.data);
|
|
27
|
-
})
|
|
28
|
-
|
|
23
|
+
let res = await gjReq('downloadGJLevel22', data);
|
|
29
24
|
if(res.data == -1) throw new Error("-1 This level is not found.");
|
|
30
25
|
|
|
31
26
|
let spl = res.data.split(":");
|
|
@@ -63,8 +58,7 @@ module.exports = {
|
|
|
63
58
|
|
|
64
59
|
if(password.length == 7) password = password.replace("1", "");
|
|
65
60
|
|
|
66
|
-
let disliked = false;
|
|
67
|
-
if(likes.includes("-")) disliked = true;
|
|
61
|
+
let disliked = likes.includes("-") ? true : false;
|
|
68
62
|
|
|
69
63
|
if(verifiedCoins == "0") verifiedCoins = false;
|
|
70
64
|
if(verifiedCoins == "1") verifiedCoins = true;
|
|
@@ -171,36 +165,7 @@ module.exports = {
|
|
|
171
165
|
}
|
|
172
166
|
|
|
173
167
|
if(getLvl.pointercrate != undefined && server.includes("boomlings.com/database")) {
|
|
174
|
-
result =
|
|
175
|
-
id: Number(id),
|
|
176
|
-
name: name,
|
|
177
|
-
description: description,
|
|
178
|
-
creator: getLvl.creator,
|
|
179
|
-
level_version: Number(version),
|
|
180
|
-
difficulty: difficultyDecoding[difficulty],
|
|
181
|
-
stars: Number(stars),
|
|
182
|
-
downloads: Number(downloads),
|
|
183
|
-
likes: Number(likes),
|
|
184
|
-
disliked: disliked,
|
|
185
|
-
length: lengthDecoding[length],
|
|
186
|
-
password: password.replace("1", ""),
|
|
187
|
-
demon: demonBoolDecoding[demonBool],
|
|
188
|
-
featured: featured,
|
|
189
|
-
epic: demonBoolDecoding[epic],
|
|
190
|
-
objects: objects,
|
|
191
|
-
uploaded: uploaded,
|
|
192
|
-
updated: updated,
|
|
193
|
-
stars_requested: Number(starsRequested),
|
|
194
|
-
game_version: decodeGameVersion[gameVersion],
|
|
195
|
-
ldm: demonBoolDecoding[ldm],
|
|
196
|
-
copied: Number(copiedID),
|
|
197
|
-
large: Number(objs) > 40000 ? true : false,
|
|
198
|
-
two_p: demonBoolDecoding[twoPlayer],
|
|
199
|
-
coins: Number(coins),
|
|
200
|
-
verified_coins: verifiedCoins,
|
|
201
|
-
song: getLvl.song,
|
|
202
|
-
pointercrate: getLvl.pointercrate
|
|
203
|
-
}
|
|
168
|
+
result.pointercrate = getLvl.pointercrate;
|
|
204
169
|
}
|
|
205
170
|
|
|
206
171
|
return result;
|
package/functions/dlMessage.js
CHANGED
|
@@ -6,27 +6,22 @@ module.exports = {
|
|
|
6
6
|
if(!user || user == "") throw new Error("Please provide your player ID or username!");
|
|
7
7
|
if(!pass || pass == "") throw new Error("Please provide your password!");
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const {
|
|
9
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
10
|
+
const {secret} = require("../config.json");
|
|
11
11
|
const { searchUsers } = require("./searchUsers.js");
|
|
12
12
|
const {gjp} = require("../misc/gjp.js");
|
|
13
13
|
const {decMessage} = require("../misc/decMessage.js");
|
|
14
14
|
|
|
15
15
|
let userObj = await searchUsers(user);
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const data = {
|
|
18
18
|
accountID: userObj.accountID,
|
|
19
19
|
gjp: gjp(pass),
|
|
20
20
|
secret: secret,
|
|
21
21
|
messageID: id
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
let res = await
|
|
25
|
-
headers: headers
|
|
26
|
-
}).catch(e => {
|
|
27
|
-
throw new Error(e.response.data)
|
|
28
|
-
})
|
|
29
|
-
|
|
24
|
+
let res = await gjReq("downloadGJMessage20", data);
|
|
30
25
|
if(res.data == -1) throw new Error(-1);
|
|
31
26
|
|
|
32
27
|
return decMessage(res.data);
|
|
@@ -3,8 +3,7 @@ module.exports = {
|
|
|
3
3
|
async function(str, page = 1) {
|
|
4
4
|
if(!str || str == "") throw new Error("Please provide a user ID or name!");
|
|
5
5
|
const { decodeAccountPost } = require("../misc/decodeAccountPost.js");
|
|
6
|
-
const
|
|
7
|
-
const { headers, server } = require("../config.json");
|
|
6
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
8
7
|
const { searchUsers } = require("./searchUsers.js");
|
|
9
8
|
|
|
10
9
|
let user = await searchUsers(str);
|
|
@@ -18,13 +17,9 @@ module.exports = {
|
|
|
18
17
|
page: page - 1
|
|
19
18
|
};
|
|
20
19
|
|
|
21
|
-
let res = await
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if(e.response.data == -1) throw new Error("-1 Not found.");
|
|
25
|
-
if(e.response.data.startsWith("#")) throw new Error("Whoops! Couldn't find anything!");
|
|
26
|
-
throw new Error(e.response.data);
|
|
27
|
-
})
|
|
20
|
+
let res = await gjReq("getGJAccountComments20", ACdata);
|
|
21
|
+
if(res.data == -1) throw new Error("-1 Not found.");
|
|
22
|
+
if(res.data.startsWith("#")) throw new Error("Whoops! Couldn't find anything!");
|
|
28
23
|
|
|
29
24
|
let accPosts = res.data.split("|");
|
|
30
25
|
let result = [];
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getBlockedList:
|
|
3
|
+
async function(str, pass) {
|
|
4
|
+
if(!str || str == "") throw new Error("Please provide your player ID or username!");
|
|
5
|
+
if(!pass || pass == "") throw new Error("Please provide your password!");
|
|
6
|
+
|
|
7
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
8
|
+
const {gjp} = require("../misc/gjp.js");
|
|
9
|
+
const { searchUsers } = require("./searchUsers.js");
|
|
10
|
+
|
|
11
|
+
let user = await searchUsers(str);
|
|
12
|
+
|
|
13
|
+
const data = {
|
|
14
|
+
accountID: user.accountID,
|
|
15
|
+
gjp: gjp(pass),
|
|
16
|
+
secret: "Wmfd2893gb7",
|
|
17
|
+
type: 1
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let res = await gjReq("getGJUserList20", data);
|
|
21
|
+
if(res.data == -1) throw new Error(-1);
|
|
22
|
+
if(res.data == -2) throw new Error("No players have been found in the blocklist.");
|
|
23
|
+
|
|
24
|
+
let players = res.data.split("|");
|
|
25
|
+
let result = [];
|
|
26
|
+
|
|
27
|
+
let colors = require("../misc/colors.json");
|
|
28
|
+
const { rgbToHEX } = require("../misc/rgbToHEX.js");
|
|
29
|
+
|
|
30
|
+
players.forEach(p => {
|
|
31
|
+
let username = p.split(":")[1];
|
|
32
|
+
let playerID = p.split(":")[3];
|
|
33
|
+
let p1 = p.split(":")[7];
|
|
34
|
+
let p2 = p.split(":")[9];
|
|
35
|
+
let accID = p.split(":")[15];
|
|
36
|
+
let msg = p.split(":")[17];
|
|
37
|
+
|
|
38
|
+
let msgState = {
|
|
39
|
+
"0": "all",
|
|
40
|
+
"1": "friends",
|
|
41
|
+
"2": "none"
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
result.push({
|
|
45
|
+
username: username,
|
|
46
|
+
playerID: Number(playerID),
|
|
47
|
+
accountID: Number(accID),
|
|
48
|
+
color1: rgbToHEX(colors[p1]),
|
|
49
|
+
color2: rgbToHEX(colors[p2]),
|
|
50
|
+
messages: msgState[msg]
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -2,13 +2,15 @@ module.exports = {
|
|
|
2
2
|
getCommentHistory:
|
|
3
3
|
async function(str, page = 1, mode = 1) {
|
|
4
4
|
if(!str || str == "") throw new Error("Please provide a player ID or name!");
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
if(page && isNaN(page)) throw new Error("Please provide a page!");
|
|
6
|
+
if(mode && isNaN(mode)) throw new Error("Please provide a mode ID! 0 for recent, 1 for most liked.");
|
|
7
|
+
|
|
8
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
7
9
|
const {decCommentFromHistory} = require("../misc/decCommentFromHistory.js");
|
|
8
10
|
const {getProfile} = require("./getProfile.js");
|
|
9
11
|
|
|
10
12
|
const user = await getProfile(str);
|
|
11
|
-
if(user.commentHistory != "all") throw new Error("Whoops! This user has disabled viewing his comment history!")
|
|
13
|
+
if(user.commentHistory != "all") throw new Error("Whoops! This user has disabled viewing his comment history!");
|
|
12
14
|
|
|
13
15
|
const CHData = {
|
|
14
16
|
gameVersion: 21,
|
|
@@ -16,16 +18,11 @@ module.exports = {
|
|
|
16
18
|
gdw: 0,
|
|
17
19
|
secret: "Wmfd2893gb7",
|
|
18
20
|
userID: user.playerID,
|
|
19
|
-
page: page - 1,
|
|
20
|
-
mode:
|
|
21
|
+
page: Number(page) - 1,
|
|
22
|
+
mode: Number(mode)
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
let res = await
|
|
24
|
-
headers: headers
|
|
25
|
-
}).catch(e => {
|
|
26
|
-
throw new Error(e.response.data);
|
|
27
|
-
})
|
|
28
|
-
|
|
25
|
+
let res = await gjReq("getGJCommentHistory", CHData);
|
|
29
26
|
if(res.data == -1) throw new Error("-1 Not found.");
|
|
30
27
|
|
|
31
28
|
let comments = res.data.split("|");
|
package/functions/getComments.js
CHANGED
|
@@ -3,26 +3,22 @@ module.exports = {
|
|
|
3
3
|
async function(level, page = 1, mode = 1) {
|
|
4
4
|
if(!level || level == "") throw new Error("Please provide a level ID!");
|
|
5
5
|
if(isNaN(level)) throw new Error("A level ID should be a number.");
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
if(mode && isNaN(mode)) throw new Error("Please provide a mode ID! 0 for recent, 1 for most liked.");
|
|
7
|
+
|
|
8
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
8
9
|
const { decodeGJComment } = require("../misc/decodeGJComment.js");
|
|
9
10
|
|
|
10
11
|
const data = {
|
|
11
12
|
levelID: level,
|
|
12
|
-
page: page - 1,
|
|
13
|
-
mode: mode,
|
|
13
|
+
page: Number(page) - 1,
|
|
14
|
+
mode: Number(mode),
|
|
14
15
|
secret: "Wmfd2893gb7",
|
|
15
16
|
gameVersion: 21,
|
|
16
17
|
binaryVersion: 35,
|
|
17
18
|
gdw: 0
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
let res = await
|
|
21
|
-
headers: headers
|
|
22
|
-
}).catch(e => {
|
|
23
|
-
throw new Error(e.response.data);
|
|
24
|
-
})
|
|
25
|
-
|
|
21
|
+
let res = await gjReq("getGJComments21", data);
|
|
26
22
|
if(res.data.startsWith("#")) throw new Error("-1 No comments have been found.");
|
|
27
23
|
|
|
28
24
|
let comments = res.data.split("|");
|
|
@@ -2,8 +2,8 @@ module.exports = {
|
|
|
2
2
|
getCreatorScores:
|
|
3
3
|
async function() {
|
|
4
4
|
const { decScoresUser } = require("../misc/decScoresUser.js");
|
|
5
|
-
const
|
|
6
|
-
const {
|
|
5
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
6
|
+
const { secret } = require("../config.json");
|
|
7
7
|
|
|
8
8
|
const data = {
|
|
9
9
|
secret: secret,
|
|
@@ -11,9 +11,7 @@ module.exports = {
|
|
|
11
11
|
count: 100
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
let res = await
|
|
15
|
-
headers: headers
|
|
16
|
-
})
|
|
14
|
+
let res = await gjReq("getGJScores20", data);
|
|
17
15
|
|
|
18
16
|
let players = res.data.split("|");
|
|
19
17
|
let emptyElem = players.indexOf(100);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getFriendsList:
|
|
3
|
+
async function(str, pass) {
|
|
4
|
+
if(!str || str == "") throw new Error("Please provide your player ID or username!");
|
|
5
|
+
if(!pass || pass == "") throw new Error("Please provide your password!");
|
|
6
|
+
|
|
7
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
8
|
+
const {gjp} = require("../misc/gjp.js");
|
|
9
|
+
const { searchUsers } = require("./searchUsers.js");
|
|
10
|
+
|
|
11
|
+
let user = await searchUsers(str);
|
|
12
|
+
|
|
13
|
+
const data = {
|
|
14
|
+
accountID: user.accountID,
|
|
15
|
+
gjp: gjp(pass),
|
|
16
|
+
secret: "Wmfd2893gb7"
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let res = await gjReq("getGJUserList20", data);
|
|
20
|
+
let players = res.data.split("|");
|
|
21
|
+
let result = [];
|
|
22
|
+
|
|
23
|
+
let colors = require("../misc/colors.json");
|
|
24
|
+
const { rgbToHEX } = require("../misc/rgbToHEX.js");
|
|
25
|
+
|
|
26
|
+
players.forEach(p => {
|
|
27
|
+
let username = p.split(":")[1];
|
|
28
|
+
let playerID = p.split(":")[3];
|
|
29
|
+
let p1 = p.split(":")[7];
|
|
30
|
+
let p2 = p.split(":")[9];
|
|
31
|
+
let accID = p.split(":")[15];
|
|
32
|
+
let msg = p.split(":")[17];
|
|
33
|
+
|
|
34
|
+
let msgState = {
|
|
35
|
+
"0": "all",
|
|
36
|
+
"1": "friends",
|
|
37
|
+
"2": "none"
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
result.push({
|
|
41
|
+
username: username,
|
|
42
|
+
playerID: Number(playerID),
|
|
43
|
+
accountID: Number(accID),
|
|
44
|
+
color1: rgbToHEX(colors[p1]),
|
|
45
|
+
color2: rgbToHEX(colors[p2]),
|
|
46
|
+
messages: msgState[msg]
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
getGauntlets:
|
|
3
3
|
async function() {
|
|
4
|
-
const
|
|
5
|
-
const {headers, server} = require("../config.json");
|
|
4
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
6
5
|
const { decodeGJGauntlet } = require("../misc/decodeGJGauntlet.js")
|
|
7
6
|
|
|
8
7
|
const data = {
|
|
@@ -12,11 +11,7 @@ module.exports = {
|
|
|
12
11
|
gdw: 0
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
let res = await
|
|
16
|
-
headers: headers
|
|
17
|
-
}).catch(e => {
|
|
18
|
-
throw new Error(e.response.data);
|
|
19
|
-
})
|
|
14
|
+
let res = await gjReq("getGJGauntlets21", data)
|
|
20
15
|
|
|
21
16
|
let gauntlets = res.data.split("|");
|
|
22
17
|
let result = [];
|
|
@@ -5,8 +5,8 @@ module.exports = {
|
|
|
5
5
|
if(isNaN(id)) throw new Error("The level ID should be a number!");
|
|
6
6
|
|
|
7
7
|
const {decodeLevel} = require("../misc/decodeLevel.js");
|
|
8
|
-
const
|
|
9
|
-
const {
|
|
8
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
9
|
+
const {secret} = require("../config.json");
|
|
10
10
|
|
|
11
11
|
const data = {
|
|
12
12
|
secret: secret,
|
|
@@ -17,12 +17,7 @@ module.exports = {
|
|
|
17
17
|
type: 0
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
let res = await
|
|
21
|
-
headers: headers
|
|
22
|
-
}).catch(e => {
|
|
23
|
-
throw new Error(e.response.data);
|
|
24
|
-
})
|
|
25
|
-
|
|
20
|
+
let res = await gjReq("getGJLevels21", data);
|
|
26
21
|
if(res.data == -1) throw new Error("-1 Not found.");
|
|
27
22
|
|
|
28
23
|
return await decodeLevel(res.data);
|
package/functions/getMapPacks.js
CHANGED
|
@@ -3,19 +3,13 @@ module.exports = {
|
|
|
3
3
|
async function(page = 1) {
|
|
4
4
|
const { decodeMapPack } = require("../misc/decodeMapPack.js");
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
const { headers, server } = require("../config.json");
|
|
6
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
8
7
|
const data = {
|
|
9
8
|
secret: "Wmfd2893gb7",
|
|
10
9
|
page: Number(page) - 1
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
let res = await
|
|
14
|
-
headers: headers
|
|
15
|
-
}).catch(e => {
|
|
16
|
-
throw new Error(e.response.data);
|
|
17
|
-
})
|
|
18
|
-
|
|
12
|
+
let res = await gjReq("getGJMapPacks21", data);
|
|
19
13
|
if(res.data.startsWith("#")) throw new Error("-1 Not found.");
|
|
20
14
|
|
|
21
15
|
let packs = res.data.split("|");
|
package/functions/getMessages.js
CHANGED
|
@@ -5,27 +5,22 @@ module.exports = {
|
|
|
5
5
|
if(!pass || pass == "") throw new Error("Please provide your password!");
|
|
6
6
|
if(Number(page) == NaN) throw new Error("The page should be a number!");
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
const {
|
|
8
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
9
|
+
const {secret} = require("../config.json");
|
|
10
10
|
const {gjp} = require("../misc/gjp.js");
|
|
11
11
|
const {decMsg} = require("../misc/decMsg.js");
|
|
12
12
|
const { searchUsers } = require("./searchUsers.js");
|
|
13
13
|
|
|
14
14
|
let userObj = await searchUsers(user);
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const data = {
|
|
17
17
|
accountID: userObj.accountID,
|
|
18
18
|
gjp: gjp(pass),
|
|
19
19
|
secret: secret,
|
|
20
|
-
page: page - 1
|
|
20
|
+
page: Number(page) - 1
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
let res = await
|
|
24
|
-
headers: headers
|
|
25
|
-
}).catch(e => {
|
|
26
|
-
throw new Error(e.response.data)
|
|
27
|
-
})
|
|
28
|
-
|
|
23
|
+
let res = await gjReq("getGJMessages20", data);
|
|
29
24
|
if(res.data == -1) throw new Error(-1);
|
|
30
25
|
|
|
31
26
|
let msgs = res.data.split("|");
|
package/functions/getProfile.js
CHANGED
|
@@ -2,8 +2,7 @@ module.exports = {
|
|
|
2
2
|
getProfile:
|
|
3
3
|
async function(str) {
|
|
4
4
|
if(!str || str == "") throw new Error("Please provide a user ID or name!");
|
|
5
|
-
const
|
|
6
|
-
const { headers, server } = require("../config.json");
|
|
5
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
7
6
|
const { searchUsers } = require("./searchUsers.js");
|
|
8
7
|
|
|
9
8
|
let user = await searchUsers(str);
|
|
@@ -16,12 +15,7 @@ module.exports = {
|
|
|
16
15
|
secret: "Wmfd2893gb7"
|
|
17
16
|
};
|
|
18
17
|
|
|
19
|
-
let res = await
|
|
20
|
-
headers: headers
|
|
21
|
-
}).catch(e => {
|
|
22
|
-
throw new Error(e.response.data);
|
|
23
|
-
})
|
|
24
|
-
|
|
18
|
+
let res = await gjReq("getGJUserInfo20", data);
|
|
25
19
|
if(res.data == -1) throw new Error("-1 This user is not found.");
|
|
26
20
|
|
|
27
21
|
let spl = res.data.split(':');
|
|
@@ -52,13 +46,10 @@ module.exports = {
|
|
|
52
46
|
let twitch = userInfo[27].split("45:")[1];
|
|
53
47
|
let modState = userInfo[28].split("49:")[1];
|
|
54
48
|
|
|
55
|
-
let ytLnk = `https://youtube.com/channel/${youtube}
|
|
56
|
-
let twitterLnk = `https://twitter.com/${twitter}
|
|
57
|
-
let twitchLnk = `https://twitch.tv/${twitch}
|
|
58
|
-
|
|
59
|
-
if(youtube == "") ytLnk = null;
|
|
60
|
-
if(twitter == "") twitterLnk = null;
|
|
61
|
-
if(twitch == "") twitchLnk = null;
|
|
49
|
+
let ytLnk = youtube != "" ? `https://youtube.com/channel/${youtube}` : null;
|
|
50
|
+
let twitterLnk = twitter != "" ? `https://twitter.com/${twitter}` : null;
|
|
51
|
+
let twitchLnk = twitch != "" ? `https://twitch.tv/${twitch}` : null;
|
|
52
|
+
|
|
62
53
|
if(youtube.endsWith("123")) ytLnk = `https://youtube.com/channel/${youtube.split("123")[0]}`;
|
|
63
54
|
if(twitter.endsWith("123")) twitterLnk = `https://twitter.com/${twitter.split("123")[0]}`;
|
|
64
55
|
if(twitch.endsWith("123")) twitchLnk = `https://twitch.tv/${twitch.split("123")[0]}`;
|
package/functions/getSongInfo.js
CHANGED
|
@@ -3,18 +3,14 @@ module.exports = {
|
|
|
3
3
|
async function(song) {
|
|
4
4
|
if(!song || song == "") throw new Error("Please provide a song ID.");
|
|
5
5
|
if(isNaN(song)) throw new Error("A song ID must be a number.")
|
|
6
|
-
const
|
|
7
|
-
const {headers, server} = require("../config.json")
|
|
6
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
8
7
|
|
|
9
8
|
const data = {
|
|
10
9
|
songID: song,
|
|
11
10
|
secret: "Wmfd2893gb7"
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
let res = await
|
|
15
|
-
headers: headers
|
|
16
|
-
})
|
|
17
|
-
|
|
13
|
+
let res = await gjReq('getGJSongInfo', data);
|
|
18
14
|
if(res.data == -2) throw new Error(`-2. Couldn't find a song with ID ${song}.`)
|
|
19
15
|
|
|
20
16
|
const result = {
|
package/functions/getTop100.js
CHANGED
|
@@ -2,8 +2,8 @@ module.exports = {
|
|
|
2
2
|
getTop100:
|
|
3
3
|
async function() {
|
|
4
4
|
const { decScoresUser } = require("../misc/decScoresUser.js");
|
|
5
|
-
const
|
|
6
|
-
const {
|
|
5
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
6
|
+
const { secret } = require("../config.json");
|
|
7
7
|
|
|
8
8
|
const data = {
|
|
9
9
|
secret: secret,
|
|
@@ -11,9 +11,7 @@ module.exports = {
|
|
|
11
11
|
count: 100
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
let res = await
|
|
15
|
-
headers: headers
|
|
16
|
-
})
|
|
14
|
+
let res = await gjReq("getGJScores20", data);
|
|
17
15
|
|
|
18
16
|
let players = res.data.split("|");
|
|
19
17
|
let emptyElem = players.indexOf(100);
|
|
@@ -3,25 +3,22 @@ module.exports = {
|
|
|
3
3
|
async function(str, page = 1) {
|
|
4
4
|
if(!str || str == "") throw new Error("Please provide a username or player ID!");
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
const {
|
|
6
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
7
|
+
const { secret } = require("../config.json");
|
|
8
8
|
const { decodeLevelRes } = require("../misc/decodeLevelRes.js");
|
|
9
9
|
const { searchUsers } = require("./searchUsers.js");
|
|
10
10
|
|
|
11
|
-
let user =
|
|
11
|
+
let user = str;
|
|
12
|
+
if(isNaN(str)) user = await (await searchUsers(str)).playerID;
|
|
12
13
|
|
|
13
14
|
const data = {
|
|
14
15
|
type: 5,
|
|
15
|
-
str: user
|
|
16
|
+
str: user,
|
|
16
17
|
secret: secret,
|
|
17
18
|
page: Number(page) - 1
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
let res = await
|
|
21
|
-
headers: headers
|
|
22
|
-
}).catch(e => {
|
|
23
|
-
throw new Error(e.response.data);
|
|
24
|
-
})
|
|
21
|
+
let res = await gjReq("getGJLevels21", data)
|
|
25
22
|
|
|
26
23
|
let levels = res.data.split("#")[0].split("|");
|
|
27
24
|
let creators = res.data.split("#")[1].split("|");
|
package/functions/reportLevel.js
CHANGED
|
@@ -4,19 +4,15 @@ module.exports = {
|
|
|
4
4
|
if(!level || level == "") throw new Error("Please provide a level ID.");
|
|
5
5
|
if(isNaN(Number(level))) throw new Error("The level ID should be a number.");
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
const {headers, server} = require("../config.json");
|
|
7
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
9
8
|
|
|
10
9
|
const data = {
|
|
11
10
|
levelID: level.toString().trim(),
|
|
12
11
|
secret: "Wmfd2893gb7"
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
let res = await
|
|
16
|
-
|
|
17
|
-
}).catch(e => {
|
|
18
|
-
throw new Error(e.response.data)
|
|
19
|
-
})
|
|
14
|
+
let res = await gjReq("reportGJLevel", data);
|
|
15
|
+
|
|
20
16
|
return res.data;
|
|
21
17
|
}
|
|
22
18
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
searchLevels:
|
|
3
3
|
async function(query, page = 1) {
|
|
4
|
-
const
|
|
5
|
-
const {
|
|
4
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
5
|
+
const { secret } = require("../config.json");
|
|
6
6
|
|
|
7
7
|
const { decodeLevelRes } = require("../misc/decodeLevelRes.js");
|
|
8
8
|
|
|
@@ -13,11 +13,7 @@ module.exports = {
|
|
|
13
13
|
secret: secret
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
let res = await
|
|
17
|
-
headers: headers
|
|
18
|
-
}).catch(e => {
|
|
19
|
-
throw new Error(e.response.data);
|
|
20
|
-
})
|
|
16
|
+
let res = await gjReq("getGJLevels21", data)
|
|
21
17
|
|
|
22
18
|
let levels = res.data.split("#")[0].split("|");
|
|
23
19
|
let creators = res.data.split("#")[1].split("|");
|
package/functions/searchUsers.js
CHANGED
|
@@ -3,18 +3,13 @@ module.exports = {
|
|
|
3
3
|
async function(str) {
|
|
4
4
|
if(!str || str == '') throw new Error("Please provide a query!");
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
const { headers, server, secret } = require("../config.json");
|
|
6
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
8
7
|
const { decodeUserResult } = require("../misc/decodeUserResult.js");
|
|
9
8
|
|
|
10
|
-
let res = await
|
|
9
|
+
let res = await gjReq("getGJUsers20", {
|
|
11
10
|
str: str,
|
|
12
11
|
secret: "Wmfd2893gb7"
|
|
13
|
-
}
|
|
14
|
-
headers: headers
|
|
15
|
-
}).catch(e => {
|
|
16
|
-
throw new Error(e.response.data)
|
|
17
|
-
});
|
|
12
|
+
})
|
|
18
13
|
|
|
19
14
|
if(res.data == -1) throw new Error(`Couldn't find a "${str}" user.`)
|
|
20
15
|
|
package/functions/unblockUser.js
CHANGED
|
@@ -4,16 +4,16 @@ module.exports = {
|
|
|
4
4
|
if(!target || target == "") throw new Error("Please provide a target's player ID or username!");
|
|
5
5
|
if(!username || username == "") throw new Error("Please provide your player ID or username!");
|
|
6
6
|
if(!password || password == "") throw new Error("Please provide your password!");
|
|
7
|
-
|
|
8
|
-
const {
|
|
7
|
+
|
|
8
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
9
9
|
const { searchUsers } = require("./searchUsers.js");
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
let user = await searchUsers(username);
|
|
12
12
|
let targetObj = await searchUsers(target);
|
|
13
13
|
|
|
14
14
|
const {gjp} = require("../misc/gjp.js");
|
|
15
|
-
|
|
16
|
-
const
|
|
15
|
+
|
|
16
|
+
const data = {
|
|
17
17
|
gameVersion: 21,
|
|
18
18
|
binaryVersion: 35,
|
|
19
19
|
gdw: 0,
|
|
@@ -23,12 +23,8 @@ module.exports = {
|
|
|
23
23
|
gjp: gjp(password)
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
let res = await
|
|
27
|
-
|
|
28
|
-
}).catch(e => {
|
|
29
|
-
if(res.data.toString().toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
30
|
-
throw new Error(e)
|
|
31
|
-
})
|
|
26
|
+
let res = await gjReq("unblockGJUser20", data)
|
|
27
|
+
if(res.data == -1) throw new Error(-1);
|
|
32
28
|
|
|
33
29
|
return 1;
|
|
34
30
|
}
|
|
@@ -8,9 +8,9 @@ module.exports = {
|
|
|
8
8
|
if(!desc) desc = "(No description provided)";
|
|
9
9
|
if(!user || user == "") throw new Error("Please provide a user ID or name!");
|
|
10
10
|
if(!password || password == "") throw new Error("Please provide a password!");
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const {
|
|
11
|
+
|
|
12
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
13
|
+
const { secret } = require("../config.json");
|
|
14
14
|
const { searchUsers } = require("./searchUsers.js");
|
|
15
15
|
|
|
16
16
|
let userObj = await searchUsers(user);
|
|
@@ -26,13 +26,9 @@ module.exports = {
|
|
|
26
26
|
secret: secret
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
let res = await
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if(e.response.data == -1) throw new Error("-1 Failed to update the description.")
|
|
33
|
-
throw new Error(e.response.data);
|
|
34
|
-
})
|
|
35
|
-
|
|
29
|
+
let res = await gjReq("updateGJDesc20", uLDdata);
|
|
30
|
+
if(res.data == -1) throw new Error("-1 Failed to update the description.");
|
|
31
|
+
|
|
36
32
|
return 1;
|
|
37
33
|
}
|
|
38
34
|
}
|
|
@@ -6,8 +6,7 @@ module.exports = {
|
|
|
6
6
|
if(!str || str == "") throw new Error("Please provide a user ID or name!");
|
|
7
7
|
if(!password || password == "") throw new Error("Please provide a password!");
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const { headers, server } = require("../config.json");
|
|
9
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
11
10
|
const { searchUsers } = require("./searchUsers.js");
|
|
12
11
|
|
|
13
12
|
let user = await searchUsers(str);
|
|
@@ -28,12 +27,8 @@ module.exports = {
|
|
|
28
27
|
cType: 1
|
|
29
28
|
};
|
|
30
29
|
|
|
31
|
-
let res = await
|
|
32
|
-
|
|
33
|
-
}).catch(e => {
|
|
34
|
-
if(e.response.status == 500) throw new Error("500 Error: couldn't post!");
|
|
35
|
-
throw new Error(e.response.data);
|
|
36
|
-
})
|
|
30
|
+
let res = await gjReq("uploadGJAccComment20", uACdata);
|
|
31
|
+
if(res.status == 500) throw new Error("500 Error: couldn't post!");
|
|
37
32
|
|
|
38
33
|
return res.data;
|
|
39
34
|
}
|
|
@@ -9,8 +9,7 @@ module.exports = {
|
|
|
9
9
|
|
|
10
10
|
const { gjp } = require("../misc/gjp.js");
|
|
11
11
|
const { encB64 } = require("../misc/encB64.js");
|
|
12
|
-
const
|
|
13
|
-
const { headers, server } = require("../config.json");
|
|
12
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
14
13
|
const crypto = require('crypto')
|
|
15
14
|
const { searchUsers } = require("./searchUsers.js");
|
|
16
15
|
|
|
@@ -37,17 +36,11 @@ module.exports = {
|
|
|
37
36
|
secret: "Wmfd2893gb7"
|
|
38
37
|
}
|
|
39
38
|
|
|
40
|
-
let res = await
|
|
41
|
-
headers: headers
|
|
42
|
-
}).catch(e => {
|
|
43
|
-
let edata = e.response.data;
|
|
44
|
-
if(edata == -10) edata = "You're permanently banned from commenting by RobTop!";
|
|
45
|
-
if(edata.startsWith("temp_")) edata = `You're temporarily banned from commenting by RobTop or Elder Moderators!\nRemaining duration: ${edata.split("_")[1].split("_")[0]}\nReason: ${edata.split("_")[2]}`;
|
|
46
|
-
if(edata == '') edata = "Whoops, the servers have rejected your request!";
|
|
47
|
-
throw new Error(edata)
|
|
48
|
-
})
|
|
39
|
+
let res = await gjReq("uploadGJComment21", uCdata);
|
|
49
40
|
|
|
50
41
|
if(res.data == -1) throw new Error("Whoops, the servers have rejected your request!");
|
|
42
|
+
if(res.data == -10) throw new Error("You're permanently banned from commenting!");
|
|
43
|
+
if(res.data.startsWith("temp_")) throw new Error(`You're temporarily banned from commenting!\nRemaining duration: ${edata.split("_")[1]} seconds\nReason: ${edata.split("_")[2]}`);
|
|
51
44
|
|
|
52
45
|
return res.data;
|
|
53
46
|
}
|
|
@@ -9,8 +9,8 @@ module.exports = {
|
|
|
9
9
|
|
|
10
10
|
const { gjp } = require("../misc/gjp.js");
|
|
11
11
|
const { encB64 } = require("../misc/encB64.js");
|
|
12
|
-
const
|
|
13
|
-
const {
|
|
12
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
13
|
+
const { secret } = require("../config.json");
|
|
14
14
|
const { searchUsers } = require("./searchUsers.js");
|
|
15
15
|
|
|
16
16
|
let receiverObj = await searchUsers(receiver);
|
|
@@ -19,7 +19,7 @@ module.exports = {
|
|
|
19
19
|
const XOR = require("../misc/xor.js");
|
|
20
20
|
const xor = new XOR();
|
|
21
21
|
|
|
22
|
-
const
|
|
22
|
+
const data = {
|
|
23
23
|
accountID: userObj.accountID,
|
|
24
24
|
toAccountID: receiverObj.accountID,
|
|
25
25
|
gjp: gjp(pass),
|
|
@@ -28,12 +28,7 @@ module.exports = {
|
|
|
28
28
|
secret: secret
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
let res = await
|
|
32
|
-
headers: headers
|
|
33
|
-
}).catch(e => {
|
|
34
|
-
throw new Error(e.response.data)
|
|
35
|
-
});
|
|
36
|
-
|
|
31
|
+
let res = await gjReq("uploadGJMessage20", data);
|
|
37
32
|
if(res.data == -1) throw new Error(-1);
|
|
38
33
|
|
|
39
34
|
return 1;
|
package/index.js
CHANGED
|
@@ -29,8 +29,11 @@ const { getMessages } = require("./functions/getMessages.js");
|
|
|
29
29
|
const { dlMessage } = require("./functions/dlMessage.js");
|
|
30
30
|
const { uploadMessage } = require("./functions/uploadMessage.js");
|
|
31
31
|
const { searchUsers } = require("./functions/searchUsers.js");
|
|
32
|
+
const { getFriendsList } = require("./functions/getFriendsList.js");
|
|
33
|
+
const { getBlockedList } = require("./functions/getBlockedList.js");
|
|
34
|
+
const { deleteLevel } = require("./functions/deleteLevel.js");
|
|
32
35
|
|
|
33
|
-
module.exports.dlLevel = dlLevel
|
|
36
|
+
module.exports.dlLevel = dlLevel;
|
|
34
37
|
module.exports.getSongInfo = getSongInfo;
|
|
35
38
|
module.exports.getOfficialSongInfo = getOfficialSongInfo;
|
|
36
39
|
module.exports.getDailyLevel = getDailyLevel;
|
|
@@ -57,4 +60,9 @@ module.exports.unblockUser = unblockUser;
|
|
|
57
60
|
module.exports.getMessages = getMessages;
|
|
58
61
|
module.exports.dlMessage = dlMessage;
|
|
59
62
|
module.exports.uploadMessage = uploadMessage;
|
|
60
|
-
module.exports.searchUsers = searchUsers;
|
|
63
|
+
module.exports.searchUsers = searchUsers;
|
|
64
|
+
module.exports.getFriendsList = getFriendsList;
|
|
65
|
+
module.exports.getBlockedList = getBlockedList;
|
|
66
|
+
module.exports.deleteLevel = deleteLevel;
|
|
67
|
+
|
|
68
|
+
getUserLevels("2565").then(console.log)
|
package/misc/decodeLevel.js
CHANGED
|
@@ -129,9 +129,6 @@ module.exports = {
|
|
|
129
129
|
|
|
130
130
|
song = songinfo;
|
|
131
131
|
}
|
|
132
|
-
|
|
133
|
-
const { demonlist } = require("./demonlist.js");
|
|
134
|
-
let dlist = await demonlist(name);
|
|
135
132
|
|
|
136
133
|
let result = {
|
|
137
134
|
id: Number(id),
|
|
@@ -159,8 +156,10 @@ module.exports = {
|
|
|
159
156
|
song: song
|
|
160
157
|
}
|
|
161
158
|
|
|
162
|
-
if(
|
|
163
|
-
|
|
159
|
+
if(["Extreme Demon", "Insane Demon"].includes(difficultyDecoding[difficulty])) {
|
|
160
|
+
const { demonlist } = require("./demonlist.js");
|
|
161
|
+
const dlist = await demonlist(name.trim());
|
|
162
|
+
if(dlist != null) result.pointercrate = dlist;
|
|
164
163
|
}
|
|
165
164
|
|
|
166
165
|
return result;
|
package/misc/demonlist.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
demonlist:
|
|
3
3
|
async function(name) {
|
|
4
|
-
|
|
5
|
-
let
|
|
6
|
-
if(
|
|
4
|
+
let r = await fetch(`https://pointercrate.com/api/v2/demons/?name=${name}`);
|
|
5
|
+
let lvlObj = await r.json();
|
|
6
|
+
if(lvlObj == undefined) return null;
|
|
7
7
|
|
|
8
8
|
const res = {
|
|
9
|
-
"position":
|
|
10
|
-
"publisher":
|
|
11
|
-
"verifier":
|
|
9
|
+
"position": lvlObj[0].position,
|
|
10
|
+
"publisher": lvlObj[0].publisher.name,
|
|
11
|
+
"verifier": lvlObj[0].verifier.name,
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
return res;
|
package/misc/gjReq.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
gjReq:
|
|
3
|
+
async function(endpoint, data) {
|
|
4
|
+
const { server } = require("../config.json");
|
|
5
|
+
|
|
6
|
+
let r = await fetch(`${server}${endpoint.endsWith(".php") ? endpoint.split(".php")[0] : endpoint}.php`, {
|
|
7
|
+
method: 'POST',
|
|
8
|
+
headers: {
|
|
9
|
+
"Content-Type":"application/x-www-form-urlencoded",
|
|
10
|
+
"user-agent":"",
|
|
11
|
+
"Accept-Encoding":"*",
|
|
12
|
+
"Accept":"*/*"
|
|
13
|
+
},
|
|
14
|
+
body: new URLSearchParams(data)
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
let res = await r.text()
|
|
18
|
+
if(res.toLowerCase() == "error code: 1005") throw new Error("1005 Error: Your IP is banned from making requests to this server.");
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
data: res,
|
|
22
|
+
status: r.status
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gj-boomlings-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "A light-weight Geometry Dash API wrapper",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,8 +30,5 @@
|
|
|
30
30
|
"engines": {
|
|
31
31
|
"npm": ">=8.19.2 <10.0.0",
|
|
32
32
|
"node": ">=18.0.0 <20.0.0"
|
|
33
|
-
},
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"axios": "^1.2.1"
|
|
36
33
|
}
|
|
37
34
|
}
|