gj-boomlings-api 1.1.0 → 1.2.0
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/functions/dlLevel.js +59 -29
- package/functions/getLevelByID.js +1 -1
- package/misc/decodeLevel.js +56 -24
- package/misc/demonlist.js +16 -0
- package/package.json +1 -1
package/functions/dlLevel.js
CHANGED
|
@@ -128,35 +128,65 @@ module.exports = {
|
|
|
128
128
|
|
|
129
129
|
const { getLevelByID } = require("./getLevelByID.js");
|
|
130
130
|
let basicInfoAboutLevel = await getLevelByID(id);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
131
|
+
let result = {
|
|
132
|
+
id: Number(id),
|
|
133
|
+
name: name,
|
|
134
|
+
description: description,
|
|
135
|
+
creator: basicInfoAboutLevel.creator,
|
|
136
|
+
level_version: Number(version),
|
|
137
|
+
difficulty: difficultyDecoding[difficulty],
|
|
138
|
+
stars: Number(stars),
|
|
139
|
+
downloads: Number(downloads),
|
|
140
|
+
likes: Number(likes),
|
|
141
|
+
disliked: disliked,
|
|
142
|
+
length: lengthDecoding[length],
|
|
143
|
+
password: password.replace("1", ""),
|
|
144
|
+
demon: demonBoolDecoding[demonBool],
|
|
145
|
+
featured: featured,
|
|
146
|
+
epic: demonBoolDecoding[epic],
|
|
147
|
+
objects: Number(objects),
|
|
148
|
+
uploaded: uploaded,
|
|
149
|
+
updated: updated,
|
|
150
|
+
stars_requested: Number(starsRequested),
|
|
151
|
+
game_version: decodeGameVersion[gameVersion],
|
|
152
|
+
ldm: demonBoolDecoding[ldm],
|
|
153
|
+
copied: Number(copiedID),
|
|
154
|
+
two_p: demonBoolDecoding[twoPlayer],
|
|
155
|
+
coins: Number(coins),
|
|
156
|
+
verified_coins: verifiedCoins,
|
|
157
|
+
song: basicInfoAboutLevel.song,
|
|
158
|
+
}
|
|
159
|
+
if(basicInfoAboutLevel.pointercrate != undefined) {
|
|
160
|
+
result = {
|
|
161
|
+
id: Number(id),
|
|
162
|
+
name: name,
|
|
163
|
+
description: description,
|
|
164
|
+
creator: basicInfoAboutLevel.creator,
|
|
165
|
+
level_version: Number(version),
|
|
166
|
+
difficulty: difficultyDecoding[difficulty],
|
|
167
|
+
stars: Number(stars),
|
|
168
|
+
downloads: Number(downloads),
|
|
169
|
+
likes: Number(likes),
|
|
170
|
+
disliked: disliked,
|
|
171
|
+
length: lengthDecoding[length],
|
|
172
|
+
password: password.replace("1", ""),
|
|
173
|
+
demon: demonBoolDecoding[demonBool],
|
|
174
|
+
featured: featured,
|
|
175
|
+
epic: demonBoolDecoding[epic],
|
|
176
|
+
objects: Number(objects),
|
|
177
|
+
uploaded: uploaded,
|
|
178
|
+
updated: updated,
|
|
179
|
+
stars_requested: Number(starsRequested),
|
|
180
|
+
game_version: decodeGameVersion[gameVersion],
|
|
181
|
+
ldm: demonBoolDecoding[ldm],
|
|
182
|
+
copied: Number(copiedID),
|
|
183
|
+
two_p: demonBoolDecoding[twoPlayer],
|
|
184
|
+
coins: Number(coins),
|
|
185
|
+
verified_coins: verifiedCoins,
|
|
186
|
+
song: basicInfoAboutLevel.song,
|
|
187
|
+
pointercrate: basicInfoAboutLevel.pointercrate
|
|
188
|
+
}
|
|
189
|
+
}
|
|
160
190
|
|
|
161
191
|
return result;
|
|
162
192
|
}
|
package/misc/decodeLevel.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
decodeLevel:
|
|
3
|
-
function(level){
|
|
3
|
+
async function(level){
|
|
4
4
|
const bs = require("js-base64");
|
|
5
5
|
|
|
6
6
|
let spl = level.split(':');
|
|
@@ -134,30 +134,62 @@ module.exports = {
|
|
|
134
134
|
song = songinfo;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
137
|
+
let result;
|
|
138
|
+
const { demonlist } = require("./demonlist.js");
|
|
139
|
+
let dlist = await demonlist(name);
|
|
140
|
+
|
|
141
|
+
if(dlist != null) {
|
|
142
|
+
result = {
|
|
143
|
+
id: Number(id),
|
|
144
|
+
name: name,
|
|
145
|
+
description: bs.decode(desc),
|
|
146
|
+
creator: author,
|
|
147
|
+
level_version: Number(version),
|
|
148
|
+
difficulty: difficultyDecoding[difficulty],
|
|
149
|
+
stars: Number(stars),
|
|
150
|
+
downloads: Number(downloads),
|
|
151
|
+
likes: Number(likes),
|
|
152
|
+
disliked: disliked,
|
|
153
|
+
length: lengthDecoding[length],
|
|
154
|
+
demon: demonBoolDecoding[demonBool],
|
|
155
|
+
featured: featured,
|
|
156
|
+
epic: demonBoolDecoding[epic],
|
|
157
|
+
objects: Number(objs),
|
|
158
|
+
stars_requested: Number(starsRequested),
|
|
159
|
+
game_version: decodeGameVersion[gameVersion],
|
|
160
|
+
copied: Number(copiedID),
|
|
161
|
+
two_p: demonBoolDecoding[twoPlayer],
|
|
162
|
+
coins: Number(coins),
|
|
163
|
+
verified_coins: verifiedCoins,
|
|
164
|
+
song: song,
|
|
165
|
+
pointercrate: dlist
|
|
166
|
+
}
|
|
167
|
+
} else {
|
|
168
|
+
result = {
|
|
169
|
+
id: Number(id),
|
|
170
|
+
name: name,
|
|
171
|
+
description: bs.decode(desc),
|
|
172
|
+
creator: author,
|
|
173
|
+
level_version: Number(version),
|
|
174
|
+
difficulty: difficultyDecoding[difficulty],
|
|
175
|
+
stars: Number(stars),
|
|
176
|
+
downloads: Number(downloads),
|
|
177
|
+
likes: Number(likes),
|
|
178
|
+
disliked: disliked,
|
|
179
|
+
length: lengthDecoding[length],
|
|
180
|
+
demon: demonBoolDecoding[demonBool],
|
|
181
|
+
featured: featured,
|
|
182
|
+
epic: demonBoolDecoding[epic],
|
|
183
|
+
objects: Number(objs),
|
|
184
|
+
stars_requested: Number(starsRequested),
|
|
185
|
+
game_version: decodeGameVersion[gameVersion],
|
|
186
|
+
copied: Number(copiedID),
|
|
187
|
+
two_p: demonBoolDecoding[twoPlayer],
|
|
188
|
+
coins: Number(coins),
|
|
189
|
+
verified_coins: verifiedCoins,
|
|
190
|
+
song: song
|
|
160
191
|
}
|
|
192
|
+
}
|
|
161
193
|
|
|
162
194
|
return result;
|
|
163
195
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
demonlist:
|
|
3
|
+
async function(name) {
|
|
4
|
+
const axios = require("axios");
|
|
5
|
+
let r = await axios.get(`https://pointercrate.com/api/v2/demons/?name=${name}`);
|
|
6
|
+
if(r.data == "[]") return null;
|
|
7
|
+
|
|
8
|
+
const res = {
|
|
9
|
+
"position": r.data[0].position,
|
|
10
|
+
"publisher": r.data[0].publisher.name,
|
|
11
|
+
"verifier": r.data[0].verifier.name,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
}
|