about summary refs log tree commit diff stats
path: root/src/invapi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/invapi.cpp')
-rw-r--r--src/invapi.cpp17
1 files changed, 16 insertions, 1 deletions
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<string> getInstances() {
+InvidiousApi::InvidiousApi(const string& url) {
+
+    instanceUrl = url;
+}
+
+vector<string> InvidiousApi::getInstances() {
 
     vector<string> result;
     cpr::Response r = cpr::Get(cpr::Url{"https://api.invidious.io/instances.json"}, 
@@ -31,4 +36,14 @@ vector<string> getInstances() {
         }
     }
     return result;
+}
+
+std::string InvidiousApi::getInstance() {
+
+    return instanceUrl;
+}
+
+void InvidiousApi::setInstance(const std::string& newUrl) {
+
+    instanceUrl = newUrl;
 }
\ No newline at end of file