From afeff3488c58896ad8cc2ca9ba997882b390e027 Mon Sep 17 00:00:00 2001 From: flb Date: Sat, 6 Feb 2021 22:00:25 +0100 Subject: [PATCH] added api url to constants.hpp --- include/constants.hpp | 1 + source/download_cheats_page.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/constants.hpp b/include/constants.hpp index 50d41ec..2f6468a 100644 --- a/include/constants.hpp +++ b/include/constants.hpp @@ -35,6 +35,7 @@ #define CHEATS_URL_TITLES "https://github.com/HamletDuFromage/switch-cheats-db/releases/download/v1.0/titles.zip" #define CHEATS_URL_CONTENTS "https://github.com/HamletDuFromage/switch-cheats-db/releases/download/v1.0/contents.zip" #define LOOKUP_TABLE_URL "https://raw.githubusercontent.com/HamletDuFromage/switch-cheats-db/master/versions.json" +#define CHEATSLIPS_CHEATS_URL "https://www.cheatslips.com/api/v1/cheats/" #define CHEATSLIPS_TOKEN_URL "https://www.cheatslips.com/api/v1/token" #define TOKEN_PATH "/config/aio-switch-updater/token.json" #define CHEATS_FILENAME "/config/aio-switch-updater/cheats.zip" diff --git a/source/download_cheats_page.cpp b/source/download_cheats_page.cpp index 9b0b65f..165982c 100644 --- a/source/download_cheats_page.cpp +++ b/source/download_cheats_page.cpp @@ -20,7 +20,7 @@ DownloadCheatsPage::DownloadCheatsPage(uint64_t tid) : AppletFrame(true, true) if(bid != "") { std::vector headers = {"accept: application/json"}; - json cheatsInfo = getRequest(("https://www.cheatslips.com/api/v1/cheats/" + formatApplicationId(tid) + "/" + bid).c_str(), headers); + json cheatsInfo = getRequest((CHEATSLIPS_CHEATS_URL + formatApplicationId(tid) + "/" + bid).c_str(), headers); if(cheatsInfo.find("cheats") != cheatsInfo.end()) { for (const auto& p : cheatsInfo["cheats"].items()) { json cheat = p.value();