gj-boomlings-api 1.2.0 → 1.2.2
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/LICENSE +2 -2
- package/README.md +92 -22
- package/functions/decURLSafeBase64.js +1 -1
- package/functions/dlLevel.js +15 -4
- package/functions/getMapPacks.js +1 -1
- package/functions/uploadComment.js +3 -1
- package/misc/decodeLevel.js +2 -0
- package/misc/demonlist.js +1 -1
- package/package.json +4 -4
package/LICENSE
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Copyright
|
|
1
|
+
Copyright 2022 shikoshib
|
|
2
2
|
|
|
3
3
|
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
4
4
|
|
|
5
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
5
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -16,45 +16,50 @@ So basically this function downloads the entire level and converts the response
|
|
|
16
16
|
|
|
17
17
|
```js
|
|
18
18
|
const gd = require("gj-boomlings-api");
|
|
19
|
-
gd.dlLevel(
|
|
19
|
+
gd.dlLevel(42584142).then(console.log);
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
Returns:
|
|
23
23
|
|
|
24
24
|
```
|
|
25
25
|
{
|
|
26
|
-
id:
|
|
27
|
-
name: '
|
|
28
|
-
description: '
|
|
29
|
-
creator: '
|
|
30
|
-
level_version:
|
|
26
|
+
id: 42584142,
|
|
27
|
+
name: 'Bloodlust',
|
|
28
|
+
description: 'Your thirst for blood continues? Very well, let the blood spill. Let the demons feed off your unfortunate soul...',
|
|
29
|
+
creator: 'Knobbelboy',
|
|
30
|
+
level_version: 3,
|
|
31
31
|
difficulty: 'Extreme Demon',
|
|
32
32
|
stars: 10,
|
|
33
|
-
downloads:
|
|
34
|
-
likes:
|
|
33
|
+
downloads: 18914789,
|
|
34
|
+
likes: 697155,
|
|
35
35
|
disliked: false,
|
|
36
36
|
length: 'XL',
|
|
37
|
-
password: '
|
|
37
|
+
password: '121296',
|
|
38
38
|
demon: true,
|
|
39
|
-
featured:
|
|
40
|
-
epic:
|
|
41
|
-
objects:
|
|
42
|
-
uploaded: '
|
|
43
|
-
updated: '
|
|
39
|
+
featured: true,
|
|
40
|
+
epic: true,
|
|
41
|
+
objects: 170739,
|
|
42
|
+
uploaded: '4 years',
|
|
43
|
+
updated: '6 months',
|
|
44
44
|
stars_requested: 10,
|
|
45
45
|
game_version: '2.1',
|
|
46
46
|
ldm: false,
|
|
47
|
-
copied:
|
|
47
|
+
copied: 25066306,
|
|
48
48
|
two_p: false,
|
|
49
49
|
coins: 0,
|
|
50
50
|
verified_coins: false,
|
|
51
51
|
song: {
|
|
52
|
-
name: '
|
|
53
|
-
id:
|
|
54
|
-
artist: '
|
|
55
|
-
artistId:
|
|
56
|
-
fileSize: '
|
|
57
|
-
link: '
|
|
52
|
+
name: 'At the Speed of Light',
|
|
53
|
+
id: 467339,
|
|
54
|
+
artist: 'Dimrain47',
|
|
55
|
+
artistId: 52,
|
|
56
|
+
fileSize: '9.56 MB',
|
|
57
|
+
link: 'https://geometrydashcontent.b-cdn.net/songs/467339.mp3'
|
|
58
|
+
},
|
|
59
|
+
pointercrate: {
|
|
60
|
+
position: 49,
|
|
61
|
+
publisher: 'knobbelboy',
|
|
62
|
+
verifier: 'knobbelboy'
|
|
58
63
|
}
|
|
59
64
|
}
|
|
60
65
|
```
|
|
@@ -102,9 +107,74 @@ gd.uploadComment("I love gj-boomlings-api!", 83925274, "gmdshxdow", "*********",
|
|
|
102
107
|
```
|
|
103
108
|
|
|
104
109
|
Posts a comment on the level with the ID of 83925274, with 99 percent, on gmdshxdow's behalf.
|
|
110
|
+
### getMapPacks(page)
|
|
111
|
+
|
|
112
|
+
This function gets the info about the map packs on a specified page (if left out, defaults to 1).
|
|
113
|
+
|
|
114
|
+
```js
|
|
115
|
+
const gd = require("gj-boomlings-api");
|
|
116
|
+
gd.getMapPacks(7).then(console.log);
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Returns:
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
[
|
|
123
|
+
{
|
|
124
|
+
name: 'Demon Pack 13',
|
|
125
|
+
id: 49,
|
|
126
|
+
levels: [ 764038, 897837, 848722 ],
|
|
127
|
+
stars: 10,
|
|
128
|
+
coins: 2,
|
|
129
|
+
difficulty: 'Hard Demon',
|
|
130
|
+
textColor: '#00FF00',
|
|
131
|
+
barColor: '#00FF00'
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'Demon Pack 14',
|
|
135
|
+
id: 50,
|
|
136
|
+
levels: [ 840397, 413504, 839175 ],
|
|
137
|
+
stars: 10,
|
|
138
|
+
coins: 2,
|
|
139
|
+
difficulty: 'Hard Demon',
|
|
140
|
+
textColor: '#00FFFF',
|
|
141
|
+
barColor: '#00FFFF'
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'Demon Pack 15',
|
|
145
|
+
id: 64,
|
|
146
|
+
levels: [ 1018758, 1326086, 1698428 ],
|
|
147
|
+
stars: 10,
|
|
148
|
+
coins: 2,
|
|
149
|
+
difficulty: 'Hard Demon',
|
|
150
|
+
textColor: '#FF0000',
|
|
151
|
+
barColor: '#FF0000'
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'Demon Pack 16',
|
|
155
|
+
id: 65,
|
|
156
|
+
levels: [ 1668421, 1703546, 923264 ],
|
|
157
|
+
stars: 10,
|
|
158
|
+
coins: 2,
|
|
159
|
+
difficulty: 'Hard Demon',
|
|
160
|
+
textColor: '#FFFF00',
|
|
161
|
+
barColor: '#FFFF00'
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: 'Demon Pack 17',
|
|
165
|
+
id: 66,
|
|
166
|
+
levels: [ 1650666, 1474319, 1777565 ],
|
|
167
|
+
stars: 10,
|
|
168
|
+
coins: 2,
|
|
169
|
+
difficulty: 'Hard Demon',
|
|
170
|
+
textColor: '#96FF96',
|
|
171
|
+
barColor: '#96FF96'
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
```
|
|
105
175
|
|
|
106
176
|
**Check out [docs](./docs/) for more info.**
|
|
107
177
|
|
|
108
178
|
---
|
|
109
179
|
|
|
110
|
-
Inspired by [GDBrowser](https://github.com/GDColon/GDBrowser/). Thanks to [Wireshark](https://www.wireshark.org/) and [
|
|
180
|
+
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.
|
|
@@ -3,7 +3,7 @@ module.exports = {
|
|
|
3
3
|
function(string) {
|
|
4
4
|
const bs = require("js-base64");
|
|
5
5
|
if(!string || string == "") throw new Error("No string provided!")
|
|
6
|
-
let str = bs.decode(string.
|
|
6
|
+
let str = bs.decode(string.replaceAll("_", '/').replaceAll("-", '+'));
|
|
7
7
|
if(!bs.isValid(str)) throw new Error("The provided string is not encoded in Base64!")
|
|
8
8
|
return str;
|
|
9
9
|
}
|
package/functions/dlLevel.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
dlLevel:
|
|
3
3
|
async function(level) {
|
|
4
|
-
const bs = require("js-base64")
|
|
4
|
+
const bs = require("js-base64");
|
|
5
|
+
const zlib = require("zlib");
|
|
5
6
|
if(!level || level == "") throw new Error("Please provide a level ID.");
|
|
6
7
|
if(isNaN(level)) throw new Error("The level parameter should be a number.");
|
|
7
8
|
|
|
@@ -37,6 +38,7 @@ module.exports = {
|
|
|
37
38
|
let id = levelInfo[0].split("1:")[1];
|
|
38
39
|
let name = levelInfo[1].split("2:")[1];
|
|
39
40
|
let description = bs.decode(levelInfo[2].split("3:")[1])
|
|
41
|
+
let levelStr = levelInfo[3].split("4:")[1];
|
|
40
42
|
let version = levelInfo[4].split("5:")[1];
|
|
41
43
|
let difficulty = levelInfo[7].split("9:")[1];
|
|
42
44
|
let downloads = levelInfo[8].split("10:")[1];
|
|
@@ -47,7 +49,6 @@ module.exports = {
|
|
|
47
49
|
let stars = levelInfo[15].split("18:")[1];
|
|
48
50
|
let ftrd = levelInfo[16].split("19:")[1];
|
|
49
51
|
let epic = levelInfo[17].split("42:")[1];
|
|
50
|
-
let objects = levelInfo[18].split("45:")[1];
|
|
51
52
|
let length = levelInfo[19].split("15:")[1];
|
|
52
53
|
let copiedID = levelInfo[20].split("30:")[1];
|
|
53
54
|
let twoPlayer = levelInfo[21].split("31:")[1];
|
|
@@ -124,6 +125,15 @@ module.exports = {
|
|
|
124
125
|
"21": "2.1"
|
|
125
126
|
}
|
|
126
127
|
|
|
128
|
+
let objects;
|
|
129
|
+
|
|
130
|
+
zlib.unzip(Buffer.from(levelStr, "base64"), (err, buffer) => {
|
|
131
|
+
const raw_data = buffer.toString();
|
|
132
|
+
const objArray = raw_data.split(";");
|
|
133
|
+
objArray.shift();
|
|
134
|
+
objects = objArray.length - 1;
|
|
135
|
+
});
|
|
136
|
+
|
|
127
137
|
if(description == '') description = "(No description provided)";
|
|
128
138
|
|
|
129
139
|
const { getLevelByID } = require("./getLevelByID.js");
|
|
@@ -144,7 +154,7 @@ module.exports = {
|
|
|
144
154
|
demon: demonBoolDecoding[demonBool],
|
|
145
155
|
featured: featured,
|
|
146
156
|
epic: demonBoolDecoding[epic],
|
|
147
|
-
objects:
|
|
157
|
+
objects: objects,
|
|
148
158
|
uploaded: uploaded,
|
|
149
159
|
updated: updated,
|
|
150
160
|
stars_requested: Number(starsRequested),
|
|
@@ -156,6 +166,7 @@ module.exports = {
|
|
|
156
166
|
verified_coins: verifiedCoins,
|
|
157
167
|
song: basicInfoAboutLevel.song,
|
|
158
168
|
}
|
|
169
|
+
|
|
159
170
|
if(basicInfoAboutLevel.pointercrate != undefined) {
|
|
160
171
|
result = {
|
|
161
172
|
id: Number(id),
|
|
@@ -173,7 +184,7 @@ module.exports = {
|
|
|
173
184
|
demon: demonBoolDecoding[demonBool],
|
|
174
185
|
featured: featured,
|
|
175
186
|
epic: demonBoolDecoding[epic],
|
|
176
|
-
objects:
|
|
187
|
+
objects: objects,
|
|
177
188
|
uploaded: uploaded,
|
|
178
189
|
updated: updated,
|
|
179
190
|
stars_requested: Number(starsRequested),
|
package/functions/getMapPacks.js
CHANGED
|
@@ -57,7 +57,9 @@ module.exports = {
|
|
|
57
57
|
headers: headers
|
|
58
58
|
}).catch(e => {
|
|
59
59
|
let edata = e.response.data;
|
|
60
|
-
if(edata ==
|
|
60
|
+
if(edata == -10) edata = "You're permanently banned from commenting by RobTop!";
|
|
61
|
+
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]}`;
|
|
62
|
+
if(edata == '') edata = "Whoops, the servers have rejected your request!";
|
|
61
63
|
throw new Error(edata)
|
|
62
64
|
})
|
|
63
65
|
|
package/misc/decodeLevel.js
CHANGED
|
@@ -41,6 +41,8 @@ module.exports = {
|
|
|
41
41
|
let disliked = false;
|
|
42
42
|
if(likes.includes("-")) disliked = true;
|
|
43
43
|
|
|
44
|
+
if(bs.decode(desc) == '') desc = "KE5vIGRlc2NyaXB0aW9uIHByb3ZpZGVkKQ=="
|
|
45
|
+
|
|
44
46
|
if(verifiedCoins == "0") verifiedCoins = false;
|
|
45
47
|
if(verifiedCoins == "1") verifiedCoins = true;
|
|
46
48
|
|
package/misc/demonlist.js
CHANGED
|
@@ -3,7 +3,7 @@ module.exports = {
|
|
|
3
3
|
async function(name) {
|
|
4
4
|
const axios = require("axios");
|
|
5
5
|
let r = await axios.get(`https://pointercrate.com/api/v2/demons/?name=${name}`);
|
|
6
|
-
if(r.data ==
|
|
6
|
+
if(r.data[0] == undefined) return null;
|
|
7
7
|
|
|
8
8
|
const res = {
|
|
9
9
|
"position": r.data[0].position,
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gj-boomlings-api",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "A
|
|
3
|
+
"version": "1.2.2",
|
|
4
|
+
"description": "A light-weight Geometry Dash API wrapper",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "
|
|
7
|
+
"test": "node .",
|
|
8
8
|
"start": "node ."
|
|
9
9
|
},
|
|
10
10
|
"author": "shikoshib",
|
|
11
|
+
"license": "ISC",
|
|
11
12
|
"repository": {
|
|
12
13
|
"type": "git",
|
|
13
14
|
"url": "git+https://github.com/shikoshib/gj-boomlings-api.git"
|
|
@@ -25,7 +26,6 @@
|
|
|
25
26
|
"gaming",
|
|
26
27
|
"robtop"
|
|
27
28
|
],
|
|
28
|
-
"license": "ISC",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"axios": "^1.2.1",
|
|
31
31
|
"js-base64": "^3.7.3"
|