From d21eea021e7528c0fa2445e0ef3566cb323fe329 Mon Sep 17 00:00:00 2001 From: PRO100KatYT Date: Wed, 20 Jul 2022 08:59:14 +0200 Subject: [PATCH] Discovery Tab fix for latest --- responses/discovery/discovery_frontend.json | 25 ++++++++++++++++----- structure/discovery.js | 22 +++++++++++++++++- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/responses/discovery/discovery_frontend.json b/responses/discovery/discovery_frontend.json index fe3e432..e068ed7 100644 --- a/responses/discovery/discovery_frontend.json +++ b/responses/discovery/discovery_frontend.json @@ -7,9 +7,11 @@ "results": [ { "linkData": { + "namespace": "fn", "mnemonic": "playlist_defaultsolo", "linkType": "BR:Playlist", "active": true, + "disabled": false, "version": 95, "moderationStatus": "Unmoderated", "accountId": "epic", @@ -22,13 +24,17 @@ } } }, + "lastVisited": null, + "linkCode": "playlist_defaultsolo", "isFavorite": false }, { "linkData": { + "namespace": "fn", "mnemonic": "playlist_defaultduo", "linkType": "BR:Playlist", "active": true, + "disabled": false, "version": 95, "moderationStatus": "Unmoderated", "accountId": "epic", @@ -41,13 +47,17 @@ } } }, + "lastVisited": null, + "linkCode": "playlist_defaultduo", "isFavorite": false }, { "linkData": { + "namespace": "fn", "mnemonic": "playlist_trios", "linkType": "BR:Playlist", "active": true, + "disabled": false, "version": 95, "moderationStatus": "Unmoderated", "accountId": "epic", @@ -60,13 +70,17 @@ } } }, + "lastVisited": null, + "linkCode": "playlist_trios", "isFavorite": false }, { "linkData": { + "namespace": "fn", "mnemonic": "playlist_defaultsquad", "linkType": "BR:Playlist", "active": true, + "disabled": false, "version": 95, "moderationStatus": "Unmoderated", "accountId": "epic", @@ -79,13 +93,17 @@ } } }, + "lastVisited": null, + "linkCode": "playlist_defaultsquad", "isFavorite": false }, { "linkData": { + "namespace": "fn", "mnemonic": "campaign", "linkType": "SubGame", "active": true, + "disabled": false, "version": 5, "moderationStatus": "Unmoderated", "accountId": "epic", @@ -129,11 +147,6 @@ "minimumNumberOfPlayers": 1, "joinInProgressTeam": 1 }, - "disallowedPlatforms": [ - "IOS", - "Android", - "Switch" - ], "alt_title": { "de": "Rette die Welt", "ru": "Сражение с Бурей", @@ -178,6 +191,8 @@ "introduction": "Battle to hold back the monster hordes and explore a vast, destructible world. Build huge forts, craft weapons, find loot and level up." } }, + "lastVisited": null, + "linkCode": "campaign", "isFavorite": false } ], diff --git a/structure/discovery.js b/structure/discovery.js index 9c672f6..39867d9 100644 --- a/structure/discovery.js +++ b/structure/discovery.js @@ -2,8 +2,28 @@ const Express = require("express"); const express = Express.Router(); const discovery = require("./../responses/discovery/discovery_frontend.json"); -express.post("/fortnite/api/game/v2/creative/discovery/surface/*", async (req, res) => { +express.post("*discovery/surface/*", async (req, res) => { res.json(discovery); }) +express.post("/links/api/fn/mnemonic", async (req, res) => { + var MnemonicArray = []; + + for (var i in discovery.Panels[0].Pages[0].results) { + MnemonicArray.push(discovery.Panels[0].Pages[0].results[i].linkData) + console.log(discovery.Panels[0].Pages[0].results[i].linkData.mnemonic); + } + + res.json(MnemonicArray); +}) + +express.get("/links/api/fn/mnemonic/*", async (req, res) => { + for (var i in discovery.Panels[0].Pages[0].results) { + console.log(discovery.Panels[0].Pages[0].results[i].linkData.mnemonic); + if (discovery.Panels[0].Pages[0].results[i].linkData.mnemonic == req.url.split("/").slice(-1)[0]) { + res.json(discovery.Panels[0].Pages[0].results[i].linkData); + } + } +}) + module.exports = express; \ No newline at end of file