diff options
author | ComradeCrow <comradecrow@vivaldi.net> | 2023-05-06 23:48:40 -0700 |
---|---|---|
committer | ComradeCrow <comradecrow@vivaldi.net> | 2023-05-06 23:48:40 -0700 |
commit | 86ec02fa985112b3ba72ac64f14f452281f29719 (patch) | |
tree | 6cde7e9d947f65f4552260838140c36d32d2ed34 /src/invapi.cpp | |
parent | 3212791b7ac63f01da8bb115e68c43a36c3b67a7 (diff) | |
download | ytcpp-86ec02fa985112b3ba72ac64f14f452281f29719.tar.gz |
working on inv again
Diffstat (limited to 'src/invapi.cpp')
-rw-r--r-- | src/invapi.cpp | 17 |
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 |