This commit is contained in:
PRO100KatYT
2021-12-17 19:13:30 +01:00
4 changed files with 262 additions and 749 deletions

View File

@@ -4,6 +4,8 @@
"daily2": "",
"daily3": "",
"daily4": "",
"daily5": "",
"daily6": "",
"featured1": "",
"featured2": ""
}

931
index.js

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,6 @@
{
"season": 15,
"lobby": "LobbySeason15"
"season": 0,
"build": 0.0,
"CL": "",
"lobby": "LobbySeason0"
}

View File

@@ -1,46 +1,54 @@
function CheckLobbyAndSeason(req, seasondata) {
// Works perfectly fine for any version
if (req.headers["user-agent"])
if (req.headers["user-agent"])
{
var season = req.headers["user-agent"].slice(28, 30)
var seasonInt = Number(season)
var CL = "";
if (!Number.isNaN(seasonInt))
{
seasondata.season = seasonInt;
seasondata.lobby = `LobbySeason${seasonInt}`;
if (req.headers["user-agent"]) {
try {
var BuildID = req.headers["user-agent"].split("-")[3].split(",")[0]
if (!Number.isNaN(Number(BuildID))) {
CL = BuildID;
}
if (Number.isNaN(Number(BuildID))) {
var BuildID = req.headers["user-agent"].split("-")[3].split(" ")[0]
if (!Number.isNaN(Number(BuildID))) {
CL = BuildID;
}
}
} catch (err) {
try {
var BuildID = req.headers["user-agent"].split("-")[1].split("+")[0]
if (!Number.isNaN(Number(BuildID))) {
CL = BuildID;
}
} catch (err) {}
}
}
if (Number.isNaN(seasonInt))
{
var season = req.headers["user-agent"].slice(32, 34)
var seasonInt = Number(season)
try {
var Build = req.headers["user-agent"].split("Release-")[1].split("-")[0];
if (!Number.isNaN(seasonInt))
{
seasondata.season = seasonInt;
seasondata.lobby = `LobbySeason${seasonInt}`;
if (Build.split(".").length == 3) {
Value = Build.split(".");
Build = Value[0] + "." + Value[1] + Value[2];
}
if (Number.isNaN(seasonInt))
{
var season = req.headers["user-agent"].slice(52, 54)
var seasonInt = Number(season)
seasondata.season = Number(Build.split(".")[0]);
seasondata.build = Number(Build);
seasondata.CL = CL;
seasondata.lobby = `LobbySeason${seasondata.season}`;
if (!Number.isNaN(seasonInt))
{
seasondata.season = seasonInt;
seasondata.lobby = `LobbySeason${seasonInt}`;
}
if (Number.isNaN(seasonInt))
{
seasondata.season = 2;
seasondata.lobby = "LobbyWinterDecor";
}
if (Number.isNaN(seasondata.season)) {
throw new Error();
}
} catch (err) {
seasondata.season = 2;
seasondata.build = 2.0;
seasondata.CL = CL;
seasondata.lobby = "LobbyWinterDecor";
}
}
}
module.exports = CheckLobbyAndSeason;
module.exports = CheckLobbyAndSeason;