From 86ec02fa985112b3ba72ac64f14f452281f29719 Mon Sep 17 00:00:00 2001 From: ComradeCrow Date: Sat, 6 May 2023 23:48:40 -0700 Subject: working on inv again --- src/invapi.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/invapi.cpp') diff --git a/src/invapi.cpp b/src/invapi.cpp index 3f6a7c2..2b63c7e 100644 --- a/src/invapi.cpp +++ b/src/invapi.cpp @@ -11,7 +11,12 @@ using namespace std; using json = nlohmann::json; -vector getInstances() { +InvidiousApi::InvidiousApi(const string& url) { + + instanceUrl = url; +} + +vector InvidiousApi::getInstances() { vector result; cpr::Response r = cpr::Get(cpr::Url{"https://api.invidious.io/instances.json"}, @@ -31,4 +36,14 @@ vector getInstances() { } } return result; +} + +std::string InvidiousApi::getInstance() { + + return instanceUrl; +} + +void InvidiousApi::setInstance(const std::string& newUrl) { + + instanceUrl = newUrl; } \ No newline at end of file -- cgit 1.4.1-2-gfad0