about summary refs log tree commit diff stats
path: root/src/invapi.cpp
diff options
context:
space:
mode:
authorComradeCrow <comradecrow@vivaldi.net>2023-05-06 23:48:40 -0700
committerComradeCrow <comradecrow@vivaldi.net>2023-05-06 23:48:40 -0700
commit86ec02fa985112b3ba72ac64f14f452281f29719 (patch)
tree6cde7e9d947f65f4552260838140c36d32d2ed34 /src/invapi.cpp
parent3212791b7ac63f01da8bb115e68c43a36c3b67a7 (diff)
downloadytcpp-86ec02fa985112b3ba72ac64f14f452281f29719.tar.gz
working on inv again
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