gj-boomlings-api 1.5.2 → 1.5.3
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/README.md +0 -1
- package/functions/dlLevel.js +1 -158
- package/functions/getLevelByID.js +1 -161
- package/functions/getProfile.js +6 -108
- package/functions/getTab.js +6 -95
- package/index.js +1 -1
- package/misc/decB64.js +1 -3
- package/misc/demonlist.js +1 -16
- package/misc/encB64.js +1 -6
- package/misc/gjReq.js +1 -25
- package/misc/gjWReq.js +1 -10
- package/misc/gjp.js +1 -8
- package/misc/rgbToHEX.js +1 -17
- package/package.json +1 -1
package/README.md
CHANGED
package/functions/dlLevel.js
CHANGED
|
@@ -4,162 +4,5 @@ module.exports = {
|
|
|
4
4
|
* @param {*} level - The level ID to download.
|
|
5
5
|
*/
|
|
6
6
|
dlLevel:
|
|
7
|
-
async function(level) {
|
|
8
|
-
const {decB64} = require("../misc/decB64.js");
|
|
9
|
-
const zlib = require("zlib");
|
|
10
|
-
if(!level) throw new Error("Please provide a level ID.");
|
|
11
|
-
if(isNaN(level)) throw new Error("The level parameter should be a number.");
|
|
12
|
-
|
|
13
|
-
const {gjReq} = require("../misc/gjReq.js");
|
|
14
|
-
const {gjWReq} = require("../misc/gjWReq.js");
|
|
15
|
-
const { server } = require("../config.json");
|
|
16
|
-
|
|
17
|
-
const XOR = require("../misc/xor.js");
|
|
18
|
-
let xor = new XOR()
|
|
19
|
-
|
|
20
|
-
const data = {
|
|
21
|
-
levelID: level.toString().trim(),
|
|
22
|
-
secret: "Wmfd2893gb7"
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
let res = await gjReq('downloadGJLevel22', data);
|
|
26
|
-
if(res.data == -1) throw new Error("-1 This level is not found.");
|
|
27
|
-
|
|
28
|
-
if(res.data == "error code: 1005") {
|
|
29
|
-
res = await gjWReq("dlLevel", level);
|
|
30
|
-
if(res.status == 403) throw new Error(res.data.error);
|
|
31
|
-
return res.data;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
let spl = res.data.split(":");
|
|
35
|
-
let levelInfo = [];
|
|
36
|
-
for(let i =0;i<spl.length;i++) {
|
|
37
|
-
if(i%2!=0) {
|
|
38
|
-
levelInfo.push(spl[i-1]+`:`+spl[i]);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
let id = levelInfo[0].split("1:")[1];
|
|
43
|
-
let name = levelInfo[1].split("2:")[1];
|
|
44
|
-
let description = decB64(levelInfo[2].split("3:")[1])
|
|
45
|
-
let levelStr = levelInfo[3].split("4:")[1];
|
|
46
|
-
let version = levelInfo[4].split("5:")[1];
|
|
47
|
-
let difficulty = levelInfo[7].split("9:")[1];
|
|
48
|
-
let downloads = levelInfo[8].split("10:")[1];
|
|
49
|
-
let gameVersion = levelInfo[10].split("13:")[1];
|
|
50
|
-
let likes = levelInfo[11].split("14:")[1];
|
|
51
|
-
let demonBool = levelInfo[12].split("17:")[1];
|
|
52
|
-
let stars = levelInfo[15].split("18:")[1];
|
|
53
|
-
let ftrd = levelInfo[16].split("19:")[1];
|
|
54
|
-
let epic = levelInfo[17].split("42:")[1];
|
|
55
|
-
let objs = levelInfo[18].split("45:")[1];
|
|
56
|
-
let length = levelInfo[19].split("15:")[1];
|
|
57
|
-
let copiedID = levelInfo[20].split("30:")[1];
|
|
58
|
-
let twoPlayer = levelInfo[21].split("31:")[1];
|
|
59
|
-
let uploaded = levelInfo[22].split("28:")[1];
|
|
60
|
-
let updated = levelInfo[23].split("29:")[1];
|
|
61
|
-
let coins = levelInfo[26].split("37:")[1];
|
|
62
|
-
let verifiedCoins = levelInfo[27].split("38:")[1];
|
|
63
|
-
let starsRequested = levelInfo[28].split("39:")[1];
|
|
64
|
-
let ldm = levelInfo[31].split("40:")[1];
|
|
65
|
-
let password = xor.decrypt(levelInfo[32].split("27:")[1].split("#")[0], 26364);
|
|
66
|
-
|
|
67
|
-
if(password.length == 7) password = password.replace("1", "");
|
|
68
|
-
|
|
69
|
-
let disliked = likes.includes("-") ? true : false;
|
|
70
|
-
|
|
71
|
-
let featured = Boolean(Number(ftrd));
|
|
72
|
-
|
|
73
|
-
let difficultyDecoding = {
|
|
74
|
-
"-10": "Auto",
|
|
75
|
-
"0": "Unrated",
|
|
76
|
-
"10": "Easy",
|
|
77
|
-
"20": "Normal",
|
|
78
|
-
"30": "Hard",
|
|
79
|
-
"40": "Harder",
|
|
80
|
-
"50": "Insane"
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if(Boolean(Number(demonBool))) {
|
|
84
|
-
difficultyDecoding = {
|
|
85
|
-
"10": "Easy Demon",
|
|
86
|
-
"20": "Medium Demon",
|
|
87
|
-
"30": "Hard Demon",
|
|
88
|
-
"40": "Insane Demon",
|
|
89
|
-
"50": "Extreme Demon"
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const lengthDecoding = {
|
|
94
|
-
"0": "Tiny",
|
|
95
|
-
"1": "Short",
|
|
96
|
-
"2": "Medium",
|
|
97
|
-
"3": "Long",
|
|
98
|
-
"4": "XL"
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const decodeGameVersion = {
|
|
102
|
-
"1": "Pre-1.7",
|
|
103
|
-
"2": "Pre-1.7",
|
|
104
|
-
"3": "Pre-1.7",
|
|
105
|
-
"4": "Pre-1.7",
|
|
106
|
-
"5": "Pre-1.7",
|
|
107
|
-
"6": "Pre-1.7",
|
|
108
|
-
"7": "Pre-1.7",
|
|
109
|
-
"10": "1.7",
|
|
110
|
-
"18": "1.8",
|
|
111
|
-
"19": "1.9",
|
|
112
|
-
"20": "2.0",
|
|
113
|
-
"21": "2.1"
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
let objects;
|
|
117
|
-
|
|
118
|
-
zlib.unzip(Buffer.from(levelStr, "base64"), (err, buffer) => {
|
|
119
|
-
const raw_data = buffer.toString();
|
|
120
|
-
const objArray = raw_data.split(";");
|
|
121
|
-
objArray.shift();
|
|
122
|
-
objects = objArray.length - 1;
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
if(description == '') description = "(No description provided)";
|
|
126
|
-
|
|
127
|
-
const { getLevelByID } = require("./getLevelByID.js");
|
|
128
|
-
let getLvl = await getLevelByID(id);
|
|
129
|
-
let result = {
|
|
130
|
-
id: Number(id),
|
|
131
|
-
name: name,
|
|
132
|
-
description: description,
|
|
133
|
-
creator: getLvl.creator,
|
|
134
|
-
level_version: Number(version),
|
|
135
|
-
difficulty: difficultyDecoding[difficulty],
|
|
136
|
-
stars: Number(stars),
|
|
137
|
-
downloads: Number(downloads),
|
|
138
|
-
likes: Number(likes),
|
|
139
|
-
disliked: disliked,
|
|
140
|
-
length: lengthDecoding[length],
|
|
141
|
-
password: password,
|
|
142
|
-
demon: Boolean(Number(demonBool)),
|
|
143
|
-
featured: featured,
|
|
144
|
-
epic: Boolean(Number(epic)),
|
|
145
|
-
objects: objects,
|
|
146
|
-
uploaded: uploaded,
|
|
147
|
-
updated: updated,
|
|
148
|
-
stars_requested: Number(starsRequested),
|
|
149
|
-
game_version: decodeGameVersion[gameVersion],
|
|
150
|
-
ldm: Boolean(Number(ldm)),
|
|
151
|
-
copied: Number(copiedID),
|
|
152
|
-
large: Number(objs) > 40000 ? true : false,
|
|
153
|
-
two_p: Boolean(Number(twoPlayer)),
|
|
154
|
-
coins: Number(coins),
|
|
155
|
-
verified_coins: Boolean(Number(verifiedCoins)),
|
|
156
|
-
song: getLvl.song,
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
if(getLvl.pointercrate != undefined && server.includes("boomlings.com/database")) {
|
|
160
|
-
result.pointercrate = getLvl.pointercrate;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return result;
|
|
164
|
-
}
|
|
7
|
+
async function(level){const{decB64}=require("../misc/decB64.js");const zlib=require("zlib");if(!level)throw new Error("Please provide a level ID.");if(isNaN(level))throw new Error("The level parameter should be a number.");const{gjReq}=require("../misc/gjReq.js");const{gjWReq}=require("../misc/gjWReq.js");const{server}=require("../config.json");const XOR=require("../misc/xor.js");let xor=new XOR;const data={levelID:level.toString().trim(),secret:"Wmfd2893gb7"};let res=await gjReq("downloadGJLevel22",data);if(res.data==-1)throw new Error("-1 This level is not found.");if(res.data=="error code: 1005"){res=await gjWReq("dlLevel",level);if(res.status==403)throw new Error(res.data.error);return res.data}let spl=res.data.split(":");let levelInfo=[];for(let i=0;i<spl.length;i++){if(i%2!=0){levelInfo.push(spl[i-1]+`:`+spl[i])}}let id=levelInfo[0].split("1:")[1];let name=levelInfo[1].split("2:")[1];let description=decB64(levelInfo[2].split("3:")[1]);let levelStr=levelInfo[3].split("4:")[1];let version=levelInfo[4].split("5:")[1];let difficulty=levelInfo[7].split("9:")[1];let downloads=levelInfo[8].split("10:")[1];let gameVersion=levelInfo[10].split("13:")[1];let likes=levelInfo[11].split("14:")[1];let demonBool=levelInfo[12].split("17:")[1];let stars=levelInfo[15].split("18:")[1];let ftrd=levelInfo[16].split("19:")[1];let epic=levelInfo[17].split("42:")[1];let objs=levelInfo[18].split("45:")[1];let length=levelInfo[19].split("15:")[1];let copiedID=levelInfo[20].split("30:")[1];let twoPlayer=levelInfo[21].split("31:")[1];let uploaded=levelInfo[22].split("28:")[1];let updated=levelInfo[23].split("29:")[1];let coins=levelInfo[26].split("37:")[1];let verifiedCoins=levelInfo[27].split("38:")[1];let starsRequested=levelInfo[28].split("39:")[1];let ldm=levelInfo[31].split("40:")[1];let password=xor.decrypt(levelInfo[32].split("27:")[1].split("#")[0],26364);if(password.length==7)password=password.replace("1","");let disliked=likes.includes("-")?true:false;let featured=Boolean(Number(ftrd));let difficultyDecoding={"-10":"Auto",0:"Unrated",10:"Easy",20:"Normal",30:"Hard",40:"Harder",50:"Insane"};if(Boolean(Number(demonBool))){difficultyDecoding={10:"Easy Demon",20:"Medium Demon",30:"Hard Demon",40:"Insane Demon",50:"Extreme Demon"}}const lengthDecoding={0:"Tiny",1:"Short",2:"Medium",3:"Long",4:"XL"};const decodeGameVersion={1:"Pre-1.7",2:"Pre-1.7",3:"Pre-1.7",4:"Pre-1.7",5:"Pre-1.7",6:"Pre-1.7",7:"Pre-1.7",10:"1.7",18:"1.8",19:"1.9",20:"2.0",21:"2.1"};let objects;zlib.unzip(Buffer.from(levelStr,"base64"),(err,buffer)=>{const raw_data=buffer.toString();const objArray=raw_data.split(";");objArray.shift();objects=objArray.length-1});const{getLevelByID}=require("./getLevelByID.js");let getLvl=await getLevelByID(id);let result={id:Number(id),name:name,description:!description?"(No description provided)":description,creator:getLvl.creator,level_version:Number(version),difficulty:difficultyDecoding[difficulty],stars:Number(stars),downloads:Number(downloads),likes:Number(likes),disliked:disliked,length:lengthDecoding[length],password:password,demon:Boolean(Number(demonBool)),featured:featured,epic:Boolean(Number(epic)),objects:objects,uploaded:uploaded,updated:updated,stars_requested:Number(starsRequested),game_version:decodeGameVersion[gameVersion],ldm:Boolean(Number(ldm)),copied:Number(copiedID),large:Number(objs)>4e4?true:false,two_p:Boolean(Number(twoPlayer)),coins:Number(coins),verified_coins:Boolean(Number(verifiedCoins)),song:getLvl.song};if(getLvl.pointercrate!=undefined&&server.includes("boomlings.com/database")){result.pointercrate=getLvl.pointercrate}return result}
|
|
165
8
|
}
|
|
@@ -8,165 +8,5 @@ module.exports = {
|
|
|
8
8
|
* @param {*} id - The level ID.
|
|
9
9
|
*/
|
|
10
10
|
getLevelByID:
|
|
11
|
-
async function (id) {
|
|
12
|
-
if (!id) throw new Error("Please provide a level ID!");
|
|
13
|
-
if (isNaN(id)) throw new Error("The level ID should be a number!");
|
|
14
|
-
|
|
15
|
-
const { gjReq } = require("../misc/gjReq.js");
|
|
16
|
-
const { gjWReq } = require("../misc/gjWReq.js");
|
|
17
|
-
const { secret } = require("../config.json");
|
|
18
|
-
const { decB64 } = require("../misc/decB64.js");
|
|
19
|
-
|
|
20
|
-
const data = {
|
|
21
|
-
secret: secret,
|
|
22
|
-
str: id,
|
|
23
|
-
type: 0
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
let res = await gjReq("getGJLevels21", data);
|
|
27
|
-
if (res.data == -1) throw new Error("-1 Not found.");
|
|
28
|
-
|
|
29
|
-
if (res.data == "error code: 1005") {
|
|
30
|
-
res = await gjWReq("getLevelByID", id);
|
|
31
|
-
if (res.status == 403) throw new Error(res.data.error);
|
|
32
|
-
return res.data;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async function decodeLevel(l) {
|
|
36
|
-
let spl = l.split(':');
|
|
37
|
-
let lInfo = [];
|
|
38
|
-
for (let i = 0; i < spl.length; i++) {
|
|
39
|
-
if (i % 2 != 0) {
|
|
40
|
-
lInfo.push(spl[i - 1] + `:` + spl[i]);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
let id = lInfo[0].split("1:")[1];
|
|
45
|
-
let name = lInfo[1].split("2:")[1];
|
|
46
|
-
let version = lInfo[2].split("5:")[1];
|
|
47
|
-
let difficulty = lInfo[5].split("9:")[1];
|
|
48
|
-
let downloads = lInfo[6].split("10:")[1];
|
|
49
|
-
let officialSong = lInfo[7].split("12:")[1];
|
|
50
|
-
let gameVersion = lInfo[8].split("13:")[1];
|
|
51
|
-
let likes = lInfo[9].split("14:")[1];
|
|
52
|
-
let demonBool = lInfo[10].split("17:")[1];
|
|
53
|
-
let stars = lInfo[13].split("18:")[1];
|
|
54
|
-
let ftrd = lInfo[14].split("19:")[1];
|
|
55
|
-
let epic = lInfo[15].split("42:")[1];
|
|
56
|
-
let objs = lInfo[16].split("45:")[1];
|
|
57
|
-
let desc = lInfo[17].split("3:")[1];
|
|
58
|
-
let length = lInfo[18].split("15:")[1];
|
|
59
|
-
let copiedID = lInfo[19].split("30:")[1];
|
|
60
|
-
let twoPlayer = lInfo[20].split("31:")[1];
|
|
61
|
-
let coins = lInfo[21].split("37:")[1];
|
|
62
|
-
let verifiedCoins = lInfo[22].split("38:")[1];
|
|
63
|
-
let starsRequested = lInfo[23].split("39:")[1];
|
|
64
|
-
let customSong = lInfo[26].split("35:")[1].split("#")[0];
|
|
65
|
-
let author = lInfo.length == 29 ? lInfo[27].split(":")[0] : "-";
|
|
66
|
-
|
|
67
|
-
let disliked = likes.includes("-") ? true : false;
|
|
68
|
-
|
|
69
|
-
if (desc.includes("/")) desc = desc.split("/")[0];
|
|
70
|
-
if (decB64(desc) == '') desc = "KE5vIGRlc2NyaXB0aW9uIHByb3ZpZGVkKQ=="
|
|
71
|
-
|
|
72
|
-
let featured = Boolean(Number(ftrd));
|
|
73
|
-
|
|
74
|
-
let difficultyDecoding = {
|
|
75
|
-
"-10": "Auto",
|
|
76
|
-
"0": "Unrated",
|
|
77
|
-
"10": "Easy",
|
|
78
|
-
"20": "Normal",
|
|
79
|
-
"30": "Hard",
|
|
80
|
-
"40": "Harder",
|
|
81
|
-
"50": "Insane"
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (Boolean(Number(demonBool))) {
|
|
85
|
-
difficultyDecoding = {
|
|
86
|
-
"10": "Easy Demon",
|
|
87
|
-
"20": "Medium Demon",
|
|
88
|
-
"30": "Hard Demon",
|
|
89
|
-
"40": "Insane Demon",
|
|
90
|
-
"50": "Extreme Demon"
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const lengthDecoding = {
|
|
95
|
-
"0": "Tiny",
|
|
96
|
-
"1": "Short",
|
|
97
|
-
"2": "Medium",
|
|
98
|
-
"3": "Long",
|
|
99
|
-
"4": "XL"
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const decodeGameVersion = {
|
|
103
|
-
"10": "1.7",
|
|
104
|
-
"18": "1.8",
|
|
105
|
-
"19": "1.9",
|
|
106
|
-
"20": "2.0",
|
|
107
|
-
"21": "2.1",
|
|
108
|
-
undefined: "Pre-1.7"
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const { getOfficialSongInfo } = require("../functions/getOfficialSongInfo.js");
|
|
112
|
-
|
|
113
|
-
let song;
|
|
114
|
-
if (Number(officialSong) > 0) song = getOfficialSongInfo(Number(officialSong) + 1);
|
|
115
|
-
if (Number(officialSong) == 0 && Number(customSong) == 0) song = getOfficialSongInfo(1);
|
|
116
|
-
if (Number(customSong) > 0) {
|
|
117
|
-
let songName = l.split("~|~2~|~")[1].split("~|~3~|~")[0]
|
|
118
|
-
let songId = Number(l.split("#1~|~")[1].split("~|~2~|~")[0])
|
|
119
|
-
let artist = l.split("~|~4~|~")[1].split("~|~5~|~")[0]
|
|
120
|
-
let artistId = Number(l.split("~|~3~|~")[1].split("~|~4~|~")[0])
|
|
121
|
-
let size = `${l.split("~|~5~|~")[1].split("~|~6~|~")[0]} MB`
|
|
122
|
-
let link = decodeURIComponent(l.split("~|~10~|~")[1].split("~|~7~|~")[0])
|
|
123
|
-
|
|
124
|
-
let songinfo = {
|
|
125
|
-
"name": songName,
|
|
126
|
-
"id": songId,
|
|
127
|
-
"artist": artist,
|
|
128
|
-
"artistId": artistId,
|
|
129
|
-
"fileSize": size,
|
|
130
|
-
"link": link
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
song = songinfo;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
let result = {
|
|
137
|
-
id: Number(id),
|
|
138
|
-
name: name,
|
|
139
|
-
description: decB64(desc),
|
|
140
|
-
creator: author,
|
|
141
|
-
level_version: Number(version),
|
|
142
|
-
difficulty: difficultyDecoding[difficulty],
|
|
143
|
-
stars: Number(stars),
|
|
144
|
-
downloads: Number(downloads),
|
|
145
|
-
likes: Number(likes),
|
|
146
|
-
disliked: disliked,
|
|
147
|
-
length: lengthDecoding[length],
|
|
148
|
-
demon: Boolean(Number(demonBool)),
|
|
149
|
-
featured: featured,
|
|
150
|
-
epic: Boolean(Number(epic)),
|
|
151
|
-
objects: Number(objs),
|
|
152
|
-
stars_requested: Number(starsRequested),
|
|
153
|
-
game_version: decodeGameVersion[gameVersion],
|
|
154
|
-
copied: Number(copiedID),
|
|
155
|
-
large: Number(objs) > 40000 ? true : false,
|
|
156
|
-
two_p: Boolean(Number(twoPlayer)),
|
|
157
|
-
coins: Number(coins),
|
|
158
|
-
verified_coins: Boolean(Number(verifiedCoins)),
|
|
159
|
-
song: song
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if (["Extreme Demon", "Insane Demon"].includes(difficultyDecoding[difficulty])) {
|
|
163
|
-
const { demonlist } = require("../misc/demonlist.js");
|
|
164
|
-
const dlist = await demonlist(name.trim());
|
|
165
|
-
if (dlist != null) result.pointercrate = dlist;
|
|
166
|
-
}
|
|
167
|
-
return result;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return await decodeLevel(res.data);
|
|
171
|
-
}
|
|
11
|
+
async function (id){if(!id)throw new Error("Please provide a level ID!");if(isNaN(id))throw new Error("The level ID should be a number!");const{gjReq}=require("../misc/gjReq.js");const{gjWReq}=require("../misc/gjWReq.js");const{secret}=require("../config.json");const{decB64}=require("../misc/decB64.js");const data={secret:secret,str:id,type:0};let res=await gjReq("getGJLevels21",data);if(res.data==-1)throw new Error("-1 Not found.");if(res.data=="error code: 1005"){res=await gjWReq("getLevelByID",id);if(res.status==403)throw new Error(res.data.error);return res.data}async function decodeLevel(l){let spl=l.split(":");let lInfo=[];for(let i=0;i<spl.length;i++){if(i%2!=0){lInfo.push(spl[i-1]+`:`+spl[i])}}let id=lInfo[0].split("1:")[1];let name=lInfo[1].split("2:")[1];let version=lInfo[2].split("5:")[1];let difficulty=lInfo[5].split("9:")[1];let downloads=lInfo[6].split("10:")[1];let officialSong=lInfo[7].split("12:")[1];let gameVersion=lInfo[8].split("13:")[1];let likes=lInfo[9].split("14:")[1];let demonBool=lInfo[10].split("17:")[1];let stars=lInfo[13].split("18:")[1];let ftrd=lInfo[14].split("19:")[1];let epic=lInfo[15].split("42:")[1];let objs=lInfo[16].split("45:")[1];let desc=lInfo[17].split("3:")[1];let length=lInfo[18].split("15:")[1];let copiedID=lInfo[19].split("30:")[1];let twoPlayer=lInfo[20].split("31:")[1];let coins=lInfo[21].split("37:")[1];let verifiedCoins=lInfo[22].split("38:")[1];let starsRequested=lInfo[23].split("39:")[1];let customSong=lInfo[26].split("35:")[1].split("#")[0];let author=lInfo.length==29?lInfo[27].split(":")[0]:"-";let disliked=likes.includes("-")?true:false;if(desc.includes("/"))desc=desc.split("/")[0];if(decB64(desc)=="")desc="KE5vIGRlc2NyaXB0aW9uIHByb3ZpZGVkKQ==";let featured=Boolean(Number(ftrd));let difficultyDecoding={"-10":"Auto",0:"Unrated",10:"Easy",20:"Normal",30:"Hard",40:"Harder",50:"Insane"};if(Boolean(Number(demonBool))){difficultyDecoding={10:"Easy Demon",20:"Medium Demon",30:"Hard Demon",40:"Insane Demon",50:"Extreme Demon"}}const lengthDecoding={0:"Tiny",1:"Short",2:"Medium",3:"Long",4:"XL"};const decodeGameVersion={10:"1.7",18:"1.8",19:"1.9",20:"2.0",21:"2.1",undefined:"Pre-1.7"};const{getOfficialSongInfo}=require("../functions/getOfficialSongInfo.js");let song;if(Number(officialSong)>0)song=getOfficialSongInfo(Number(officialSong)+1);if(Number(officialSong)==0&&Number(customSong)==0)song=getOfficialSongInfo(1);if(Number(customSong)>0){let songName=l.split("~|~2~|~")[1].split("~|~3~|~")[0];let songId=Number(l.split("#1~|~")[1].split("~|~2~|~")[0]);let artist=l.split("~|~4~|~")[1].split("~|~5~|~")[0];let artistId=Number(l.split("~|~3~|~")[1].split("~|~4~|~")[0]);let size=`${l.split("~|~5~|~")[1].split("~|~6~|~")[0]} MB`;let link=decodeURIComponent(l.split("~|~10~|~")[1].split("~|~7~|~")[0]);song={name:songName,id:songId,artist:artist,artistId:artistId,fileSize:size,link:link}}let result={id:Number(id),name:name,description:decB64(desc),creator:author,level_version:Number(version),difficulty:difficultyDecoding[difficulty],stars:Number(stars),downloads:Number(downloads),likes:Number(likes),disliked:disliked,length:lengthDecoding[length],demon:Boolean(Number(demonBool)),featured:featured,epic:Boolean(Number(epic)),objects:Number(objs),stars_requested:Number(starsRequested),game_version:decodeGameVersion[gameVersion],copied:Number(copiedID),large:Number(objs)>4e4?true:false,two_p:Boolean(Number(twoPlayer)),coins:Number(coins),verified_coins:Boolean(Number(verifiedCoins)),song:song};if(["Extreme Demon","Insane Demon"].includes(difficultyDecoding[difficulty])){const{demonlist}=require("../misc/demonlist.js");const dlist=await demonlist(name.trim());if(dlist!=null)result.pointercrate=dlist}return result}return await decodeLevel(res.data)}
|
|
172
12
|
}
|
package/functions/getProfile.js
CHANGED
|
@@ -1,109 +1,7 @@
|
|
|
1
|
-
module.exports
|
|
1
|
+
module.exports={
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
getProfile:
|
|
7
|
-
|
|
8
|
-
if(!str) throw new Error("Please provide a user ID or name!");
|
|
9
|
-
const {gjReq} = require("../misc/gjReq.js");
|
|
10
|
-
const {gjWReq} = require("../misc/gjWReq.js");
|
|
11
|
-
const { searchUsers } = require("./searchUsers.js");
|
|
12
|
-
|
|
13
|
-
let user = await searchUsers(str);
|
|
14
|
-
|
|
15
|
-
let data = {
|
|
16
|
-
targetAccountID: user.accountID,
|
|
17
|
-
secret: "Wmfd2893gb7"
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
let res = await gjReq("getGJUserInfo20", data);
|
|
21
|
-
if(res.data == -1) throw new Error("-1 This user is not found.");
|
|
22
|
-
|
|
23
|
-
if(res.data == "error code: 1005") {
|
|
24
|
-
res = await gjWReq("getProfile", str);
|
|
25
|
-
if(res.status == 403) throw new Error(res.data.error);
|
|
26
|
-
return res.data;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
let spl = res.data.split(':');
|
|
30
|
-
let userInfo = [];
|
|
31
|
-
for(let i =0;i<spl.length;i++) {
|
|
32
|
-
if(i%2!=0) {
|
|
33
|
-
userInfo.push(spl[i-1]+`:`+spl[i]);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
let username = userInfo[0].split("1:")[1];
|
|
38
|
-
let playerID = userInfo[1].split("2:")[1];
|
|
39
|
-
let goldCoins = userInfo[2].split("13:")[1];
|
|
40
|
-
let silverCoins = userInfo[3].split("17:")[1];
|
|
41
|
-
let p1col = userInfo[4].split("10:")[1];
|
|
42
|
-
let p2col = userInfo[5].split("11:")[1];
|
|
43
|
-
let stars = userInfo[6].split("3:")[1];
|
|
44
|
-
let diamonds = userInfo[7].split("46:")[1];
|
|
45
|
-
let demons = userInfo[8].split("4:")[1];
|
|
46
|
-
let cps = userInfo[9].split("8:")[1]; // clicks per second lmao
|
|
47
|
-
let msgState = userInfo[10].split("18:")[1];
|
|
48
|
-
let friendsState = userInfo[11].split("19:")[1];
|
|
49
|
-
let commentHistoryState = userInfo[12].split("50:")[1];
|
|
50
|
-
let youtube = userInfo[13].split("20:")[1];
|
|
51
|
-
let rank = userInfo[23].split("30:")[1];
|
|
52
|
-
let accountID = userInfo[24].split("16:")[1];
|
|
53
|
-
let twitter = userInfo[26].split("44:")[1];
|
|
54
|
-
let twitch = userInfo[27].split("45:")[1];
|
|
55
|
-
let modState = userInfo[28].split("49:")[1];
|
|
56
|
-
|
|
57
|
-
let ytLnk = youtube != "" ? `https://youtube.com/channel/${youtube}` : null;
|
|
58
|
-
let twitterLnk = twitter != "" ? `https://twitter.com/${twitter}` : null;
|
|
59
|
-
let twitchLnk = twitch != "" ? `https://twitch.tv/${twitch}` : null;
|
|
60
|
-
|
|
61
|
-
if(youtube.endsWith("123")) ytLnk = `https://youtube.com/channel/${youtube.split("123")[0]}`;
|
|
62
|
-
if(twitter.endsWith("123")) twitterLnk = `https://twitter.com/${twitter.split("123")[0]}`;
|
|
63
|
-
if(twitch.endsWith("123")) twitchLnk = `https://twitch.tv/${twitch.split("123")[0]}`;
|
|
64
|
-
|
|
65
|
-
let msgStateDecoding = {
|
|
66
|
-
"0": "all",
|
|
67
|
-
"1": "friends",
|
|
68
|
-
"2": "none"
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
let stateBinaryDecoding = {
|
|
72
|
-
"0": "all",
|
|
73
|
-
"1": "none"
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
let modDecoding = {
|
|
77
|
-
"0": "none",
|
|
78
|
-
"1": "mod",
|
|
79
|
-
"2": "elder"
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
let colors = require("../misc/colors.json");
|
|
83
|
-
const { rgbToHEX } = require("../misc/rgbToHEX.js");
|
|
84
|
-
|
|
85
|
-
const result = {
|
|
86
|
-
username: username,
|
|
87
|
-
playerID: Number(playerID),
|
|
88
|
-
accountID: Number(accountID),
|
|
89
|
-
rank: Number(rank),
|
|
90
|
-
color1: rgbToHEX(colors[p1col]),
|
|
91
|
-
color2: rgbToHEX(colors[p2col]),
|
|
92
|
-
stars: Number(stars),
|
|
93
|
-
diamonds: Number(diamonds),
|
|
94
|
-
secretCoins: Number(goldCoins),
|
|
95
|
-
userCoins: Number(silverCoins),
|
|
96
|
-
demons: Number(demons),
|
|
97
|
-
creatorPoints: Number(cps),
|
|
98
|
-
messages: msgStateDecoding[msgState],
|
|
99
|
-
friendRequests: stateBinaryDecoding[friendsState],
|
|
100
|
-
commentHistory: msgStateDecoding[commentHistoryState],
|
|
101
|
-
mod: modDecoding[modState],
|
|
102
|
-
youtube: ytLnk,
|
|
103
|
-
twitter: twitterLnk,
|
|
104
|
-
twitch: twitchLnk
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return result;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
3
|
+
* Gets a user's profile info.
|
|
4
|
+
* @param {*} str - A user's player ID or username.
|
|
5
|
+
*/
|
|
6
|
+
getProfile:async function(str){if(!str)throw new Error("Please provide a user ID or name!");const{gjReq}=require("../misc/gjReq.js");const{gjWReq}=require("../misc/gjWReq.js");const{searchUsers}=require("./searchUsers.js");let user=await searchUsers(str);let data={targetAccountID:user.accountID,secret:"Wmfd2893gb7"};let res=await gjReq("getGJUserInfo20",data);if(res.data==-1)throw new Error("-1 This user is not found.");if(res.data=="error code: 1005"){res=await gjWReq("getProfile",str);if(res.status==403)throw new Error(res.data.error);return res.data}let spl=res.data.split(":");let userInfo=[];for(let i=0;i<spl.length;i++){if(i%2!=0){userInfo.push(spl[i-1]+`:`+spl[i])}}let username=userInfo[0].split("1:")[1];let playerID=userInfo[1].split("2:")[1];let goldCoins=userInfo[2].split("13:")[1];let silverCoins=userInfo[3].split("17:")[1];let p1col=userInfo[4].split("10:")[1];let p2col=userInfo[5].split("11:")[1];let stars=userInfo[6].split("3:")[1];let diamonds=userInfo[7].split("46:")[1];let demons=userInfo[8].split("4:")[1];let cps=userInfo[9].split("8:")[1];// clicks per second lmao
|
|
7
|
+
let msgState=userInfo[10].split("18:")[1];let friendsState=userInfo[11].split("19:")[1];let commentHistoryState=userInfo[12].split("50:")[1];let youtube=userInfo[13].split("20:")[1];let rank=userInfo[23].split("30:")[1];let accountID=userInfo[24].split("16:")[1];let twitter=userInfo[26].split("44:")[1];let twitch=userInfo[27].split("45:")[1];let modState=userInfo[28].split("49:")[1];let ytLnk=youtube!=""?`https://youtube.com/channel/${youtube}`:null;let twitterLnk=twitter!=""?`https://twitter.com/${twitter}`:null;let twitchLnk=twitch!=""?`https://twitch.tv/${twitch}`:null;if(youtube.endsWith("123"))ytLnk=`https://youtube.com/channel/${youtube.split("123")[0]}`;if(twitter.endsWith("123"))twitterLnk=`https://twitter.com/${twitter.split("123")[0]}`;if(twitch.endsWith("123"))twitchLnk=`https://twitch.tv/${twitch.split("123")[0]}`;let msgStateDecoding={0:"all",1:"friends",2:"none"};let stateBinaryDecoding={0:"all",1:"none"};let modDecoding={0:"none",1:"mod",2:"elder"};let colors=require("../misc/colors.json");const{rgbToHEX}=require("../misc/rgbToHEX.js");const result={username:username,playerID:Number(playerID),accountID:Number(accountID),rank:Number(rank),color1:rgbToHEX(colors[p1col]),color2:rgbToHEX(colors[p2col]),stars:Number(stars),diamonds:Number(diamonds),secretCoins:Number(goldCoins),userCoins:Number(silverCoins),demons:Number(demons),creatorPoints:Number(cps),messages:msgStateDecoding[msgState],friendRequests:stateBinaryDecoding[friendsState],commentHistory:msgStateDecoding[commentHistoryState],mod:modDecoding[modState],youtube:ytLnk,twitter:twitterLnk,twitch:twitchLnk};return result}};
|
package/functions/getTab.js
CHANGED
|
@@ -1,96 +1,7 @@
|
|
|
1
|
-
module.exports
|
|
1
|
+
module.exports={
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
getTab:
|
|
8
|
-
async function(tab, page = 1) {
|
|
9
|
-
let validTabs = {
|
|
10
|
-
"trending": 3,
|
|
11
|
-
"recent": 4,
|
|
12
|
-
"featured": 6,
|
|
13
|
-
"magic": 7,
|
|
14
|
-
"awarded": 11,
|
|
15
|
-
"epic": 16,
|
|
16
|
-
"hall of fame": 16
|
|
17
|
-
}
|
|
18
|
-
if(!validTabs[tab.toLowerCase()]) throw new Error('Please provide a valid tab! Possible tabs: "trending", "recent", "featured", "magic", "awarded", "epic".')
|
|
19
|
-
|
|
20
|
-
const {gjReq} = require("../misc/gjReq.js");
|
|
21
|
-
const {gjWReq} = require("../misc/gjWReq.js");
|
|
22
|
-
const { secret } = require("../config.json");
|
|
23
|
-
|
|
24
|
-
let GJDecode = require("../misc/GJDecode.js");
|
|
25
|
-
const { decodeLevelRes } = new GJDecode();
|
|
26
|
-
|
|
27
|
-
const data = {
|
|
28
|
-
type: validTabs[tab.toLowerCase()],
|
|
29
|
-
page: Number(page) - 1,
|
|
30
|
-
secret: secret
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
let res = await gjReq("getGJLevels21", data);
|
|
34
|
-
|
|
35
|
-
if(res.data == "error code: 1005") {
|
|
36
|
-
res = await gjWReq("getTab", `${tab}?page=${page}`);
|
|
37
|
-
if(res.status == 403) throw new Error(res.data.error);
|
|
38
|
-
return res.data;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
let levels = res.data.split("#")[0].split("|");
|
|
42
|
-
let creators = res.data.split("#")[1].split("|");
|
|
43
|
-
let songs = res.data.split("#")[2].split(":");
|
|
44
|
-
|
|
45
|
-
let result = [];
|
|
46
|
-
|
|
47
|
-
let encCreators = {};
|
|
48
|
-
let encSongs = {};
|
|
49
|
-
|
|
50
|
-
creators.forEach(c => {
|
|
51
|
-
let playerID = c.split(":")[0];
|
|
52
|
-
let username = c.split(":")[1];
|
|
53
|
-
encCreators[playerID] = username;
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
songs.forEach(s => {
|
|
57
|
-
let songId = s.split("~|~")[1];
|
|
58
|
-
let songName = s.split("~|~")[3];
|
|
59
|
-
let songArtistID = s.split("~|~")[5];
|
|
60
|
-
let songArtist = s.split("~|~")[7];
|
|
61
|
-
let size = s.split("~|~")[9];
|
|
62
|
-
let link = s.split("~|~")[13];
|
|
63
|
-
|
|
64
|
-
encSongs[songId] = {
|
|
65
|
-
"name": songName,
|
|
66
|
-
"id": Number(songId),
|
|
67
|
-
"artist": songArtist,
|
|
68
|
-
"artistId": Number(songArtistID),
|
|
69
|
-
"fileSize": `${size} MB`,
|
|
70
|
-
"link": decodeURIComponent(link)
|
|
71
|
-
};
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
for(const l of levels) {
|
|
75
|
-
let decLvl = decodeLevelRes(l);
|
|
76
|
-
const { getOfficialSongInfo } = require("./getOfficialSongInfo.js");
|
|
77
|
-
|
|
78
|
-
let lvl = decLvl.res;
|
|
79
|
-
let officialSongID = Number(decLvl.officialSong);
|
|
80
|
-
let songID = Number(decLvl.customSong);
|
|
81
|
-
let playerId = decLvl.playerID;
|
|
82
|
-
let song;
|
|
83
|
-
|
|
84
|
-
if(officialSongID == 0 && songID != 0 || officialSongID != 0 && songID != 0) song = encSongs[songID.toString()];
|
|
85
|
-
if(officialSongID != 0 && songID == 0) song = getOfficialSongInfo(officialSongID + 1);
|
|
86
|
-
if(officialSongID == 0 && songID == 0) song = getOfficialSongInfo(1);
|
|
87
|
-
|
|
88
|
-
lvl['creator'] = encCreators[playerId] != undefined ? encCreators[playerId] : "-";
|
|
89
|
-
lvl['song'] = song;
|
|
90
|
-
|
|
91
|
-
result.push(lvl);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return result;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
3
|
+
* Gets the levels in a specified tab. Possible tabs: `"trending"`, `"recent"`, `"featured"`, `"magic"`, `"awarded"`, `"epic"`.
|
|
4
|
+
* @param {*} tab - The tab to get levels from.
|
|
5
|
+
* @param {*} page - The page.
|
|
6
|
+
*/
|
|
7
|
+
getTab:async function(tab,page=1){let validTabs={trending:3,recent:4,featured:6,magic:7,awarded:11,epic:16,"hall of fame":16};if(!validTabs[tab.toLowerCase()])throw new Error('Please provide a valid tab! Possible tabs: "trending", "recent", "featured", "magic", "awarded", "epic".');const{gjReq}=require("../misc/gjReq.js");const{gjWReq}=require("../misc/gjWReq.js");const{secret}=require("../config.json");let GJDecode=require("../misc/GJDecode.js");const{decodeLevelRes}=new GJDecode;const data={type:validTabs[tab.toLowerCase()],page:Number(page)-1,secret:secret};let res=await gjReq("getGJLevels21",data);if(res.data=="error code: 1005"){res=await gjWReq("getTab",`${tab}?page=${page}`);if(res.status==403)throw new Error(res.data.error);return res.data}let levels=res.data.split("#")[0].split("|");let creators=res.data.split("#")[1].split("|");let songs=res.data.split("#")[2].split(":");let result=[];let encCreators={};let encSongs={};creators.forEach(c=>{let playerID=c.split(":")[0];let username=c.split(":")[1];encCreators[playerID]=username});songs.forEach(s=>{let songId=s.split("~|~")[1];let songName=s.split("~|~")[3];let songArtistID=s.split("~|~")[5];let songArtist=s.split("~|~")[7];let size=s.split("~|~")[9];let link=s.split("~|~")[13];encSongs[songId]={name:songName,id:Number(songId),artist:songArtist,artistId:Number(songArtistID),fileSize:`${size} MB`,link:decodeURIComponent(link)}});for(const l of levels){let decLvl=decodeLevelRes(l);const{getOfficialSongInfo}=require("./getOfficialSongInfo.js");let lvl=decLvl.res;let officialSongID=Number(decLvl.officialSong);let songID=Number(decLvl.customSong);let playerId=decLvl.playerID;let song;if(officialSongID==0&&songID!=0||officialSongID!=0&&songID!=0)song=encSongs[songID.toString()];if(officialSongID!=0&&songID==0)song=getOfficialSongInfo(officialSongID+1);if(officialSongID==0&&songID==0)song=getOfficialSongInfo(1);lvl["creator"]=encCreators[playerId]!=undefined?encCreators[playerId]:"-";lvl["song"]=song;result.push(lvl)}return result}};
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const{dlLevel}=require("./functions/dlLevel.js");const{getSongInfo}=require("./functions/getSongInfo.js");const{getOfficialSongInfo}=require("./functions/getOfficialSongInfo.js");const{getDailyLevel}=require("./functions/getDailyLevel.js");const{getWeeklyDemon}=require("./functions/getWeeklyDemon.js");const{getProfile}=require("./functions/getProfile.js");const{reportLevel}=require("./functions/reportLevel.js");const{getComments}=require("./functions/getComments.js");const{getCommentHistory}=require("./functions/getCommentHistory.js");const{getGauntlets}=require("./functions/getGauntlets.js");const{getAccountPosts}=require("./functions/getAccountPosts.js");const{uploadAccountPost}=require("./functions/uploadAccountPost.js");const{uploadComment}=require("./functions/uploadComment.js");const{getMapPacks}=require("./functions/getMapPacks.js");const{blockUser}=require("./functions/blockUser.js");const{getLevelByID}=require("./functions/getLevelByID.js");const{getTop100}=require("./functions/getTop100.js");const{getCreatorScores}=require("./functions/getCreatorScores.js");const{updateLevelDesc}=require("./functions/updateLevelDesc.js");const{deleteAccountPost}=require("./functions/deleteAccountPost.js");const{getUserLevels}=require("./functions/getUserLevels.js");const{searchLevels}=require("./functions/searchLevels.js");const{deleteComment}=require("./functions/deleteComment.js");const{unblockUser}=require("./functions/unblockUser.js");const{getMessages}=require("./functions/getMessages.js");const{dlMessage}=require("./functions/dlMessage.js");const{uploadMessage}=require("./functions/uploadMessage.js");const{searchUsers}=require("./functions/searchUsers.js");const{getFriendsList}=require("./functions/getFriendsList.js");const{getBlockedList}=require("./functions/getBlockedList.js");const{deleteLevel}=require("./functions/deleteLevel.js");const{gjReq}=require("./misc/gjReq.js");const{getTab}=require("./functions/getTab.js");const{getLevelScores}=require("./functions/getLevelScores.js");module.exports={dlLevel:dlLevel,getSongInfo:getSongInfo,getOfficialSongInfo:getOfficialSongInfo,getDailyLevel:getDailyLevel,getWeeklyDemon:getWeeklyDemon,getProfile:getProfile,reportLevel:reportLevel,getComments:getComments,getCommentHistory:getCommentHistory,getGauntlets:getGauntlets,getAccountPosts:getAccountPosts,uploadAccountPost:uploadAccountPost,uploadComment:uploadComment,getMapPacks:getMapPacks,blockUser:blockUser,getLevelByID:getLevelByID,getTop100:getTop100,getCreatorScores:getCreatorScores,updateLevelDesc:updateLevelDesc,deleteAccountPost:deleteAccountPost,getUserLevels:getUserLevels,searchLevels:searchLevels,deleteComment:deleteComment,unblockUser:unblockUser,getMessages:getMessages,dlMessage:dlMessage,uploadMessage:uploadMessage,searchUsers:searchUsers,getFriendsList:getFriendsList,getBlockedList:getBlockedList,deleteLevel:deleteLevel,gjReq:gjReq,getTab:getTab,getLevelScores:getLevelScores};
|
|
2
|
-
|
|
2
|
+
getLevelByID(91047303).then(console.log);
|
package/misc/decB64.js
CHANGED
package/misc/demonlist.js
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
demonlist:
|
|
3
|
-
async function (name) {
|
|
4
|
-
let r = await fetch(`https://pointercrate.com/api/v2/demons/?name=${name}`);
|
|
5
|
-
let lvlObj = await r.json();
|
|
6
|
-
if (!lvlObj.length) return null;
|
|
7
|
-
|
|
8
|
-
const res = {
|
|
9
|
-
"position": lvlObj[0].position,
|
|
10
|
-
"publisher": lvlObj[0].publisher.name,
|
|
11
|
-
"verifier": lvlObj[0].verifier.name,
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return res;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
1
|
+
module.exports={demonlist:async function(name){let r=await fetch(`https://pointercrate.com/api/v2/demons/?name=${name}`);let lvlObj=await r.json();if(!lvlObj.length)return null;return{position:lvlObj[0].position,publisher:lvlObj[0].publisher.name,verifier:lvlObj[0].verifier.name}}};
|
package/misc/encB64.js
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
module.exports
|
|
2
|
-
encB64:
|
|
3
|
-
function(string) {
|
|
4
|
-
return btoa(unescape(encodeURIComponent(string))).replace(/\//g, '_').replace(/\+/g, '-');
|
|
5
|
-
}
|
|
6
|
-
}
|
|
1
|
+
module.exports={encB64:function(string){return btoa(unescape(encodeURIComponent(string))).replace(/\//g,"_").replace(/\+/g,"-")}};
|
package/misc/gjReq.js
CHANGED
|
@@ -1,25 +1 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
gjReq:
|
|
3
|
-
async function(endpoint, data) {
|
|
4
|
-
const { server } = require("../config.json");
|
|
5
|
-
let headers = {
|
|
6
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
7
|
-
"User-Agent": " ",
|
|
8
|
-
"Accept-Encoding": "*",
|
|
9
|
-
"Accept": "*/*"
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
let r = await fetch(`${server}${endpoint.endsWith(".php") ? endpoint.split(".php")[0] : endpoint}.php`, {
|
|
13
|
-
method: 'POST',
|
|
14
|
-
headers: headers,
|
|
15
|
-
body: new URLSearchParams(data)
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
let res = await r.text()
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
data: res,
|
|
22
|
-
status: r.status
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
1
|
+
module.exports={gjReq:async function(endpoint,data){const{server}=require("../config.json");let headers={"Content-Type":"application/x-www-form-urlencoded","User-Agent":" ","Accept-Encoding":"*",Accept:"*/*"};let r=await fetch(`${server}${endpoint.endsWith(".php")?endpoint.split(".php")[0]:endpoint}.php`,{method:"POST",headers:headers,body:new URLSearchParams(data)});let res=await r.text();return{data:res,status:r.status}}};
|
package/misc/gjWReq.js
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
gjWReq:
|
|
3
|
-
async function(endpoint, data = "") {
|
|
4
|
-
let r = await fetch(`https://gbaweb.vercel.app/${endpoint}/${data}`)
|
|
5
|
-
let res = await r.text()
|
|
6
|
-
if(res.includes("{") || res.includes("[")) res = JSON.parse(res);
|
|
7
|
-
|
|
8
|
-
return {data: res, status: r.status};
|
|
9
|
-
}
|
|
10
|
-
}
|
|
1
|
+
module.exports={gjWReq:async function(endpoint,data=""){let r=await fetch(`https://gbaweb.vercel.app/${endpoint}/${data}`);let res=await r.text();if(res.includes("{")||res.includes("["))res=JSON.parse(res);return{data:res,status:r.status}}};
|
package/misc/gjp.js
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
module.exports =
|
|
2
|
-
gjp:
|
|
3
|
-
function(password) {
|
|
4
|
-
const XOR = require("./xor.js");
|
|
5
|
-
const xor = new XOR();
|
|
6
|
-
return xor.encrypt(password, 37526).toString();
|
|
7
|
-
}
|
|
8
|
-
}
|
|
1
|
+
module.exports={gjp:function(password){const XOR=require("./xor.js");const xor=new XOR;return xor.encrypt(password,37526).toString()}};
|
package/misc/rgbToHEX.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
rgbToHEX:
|
|
3
|
-
function(color) {
|
|
4
|
-
if(!color) color = "255,255,255"
|
|
5
|
-
let r = color.split(",")[0];
|
|
6
|
-
let g = color.split(",")[1];
|
|
7
|
-
let b = color.split(",")[2];
|
|
8
|
-
|
|
9
|
-
if(b.includes("#")) b = b.split("#")[0];
|
|
10
|
-
|
|
11
|
-
let rHex = Number(r).toString(16);
|
|
12
|
-
let gHex = Number(g).toString(16);
|
|
13
|
-
let bHex = Number(b).toString(16);
|
|
14
|
-
|
|
15
|
-
return `#${rHex.length == 1 ? "0" + rHex : rHex}${gHex.length == 1 ? "0" + gHex : gHex}${bHex.length == 1 ? "0" + bHex : bHex}`.toUpperCase();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
1
|
+
module.exports={rgbToHEX:function(color){if(!color)color="255,255,255";let r=color.split(",")[0];let g=color.split(",")[1];let b=color.split(",")[2];if(b.includes("#"))b=b.split("#")[0];let rHex=Number(r).toString(16);let gHex=Number(g).toString(16);let bHex=Number(b).toString(16);return`#${rHex.length==1?"0"+rHex:rHex}${gHex.length==1?"0"+gHex:gHex}${bHex.length==1?"0"+bHex:bHex}`.toUpperCase()}};
|