diff options
author | ComradeCrow <comradecrow@vivaldi.net> | 2023-04-25 20:28:08 -0700 |
---|---|---|
committer | ComradeCrow <comradecrow@vivaldi.net> | 2023-04-25 20:28:08 -0700 |
commit | cf0ab4d19100846a9850a3cc39110d8d8cfd1607 (patch) | |
tree | 8077c8eacaf3d7f6161d8bff232ec0571a07c797 /src/main.cpp | |
parent | 407a6f2507c784918a1c77ade4114c706f2c1e34 (diff) | |
download | ytcpp-cf0ab4d19100846a9850a3cc39110d8d8cfd1607.tar.gz |
broken
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index 8c9503d..059657c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,11 +1,12 @@ // #include <cpr/cpr.h> -// #include <nlohmann/json.hpp> +#include <nlohmann/json.hpp> // #include <pybind11/embed.h> // #include <sqlite3.h> // #include <string> -// #include <iostream> +#include <iostream> // #include <exception> // #include <vector> +#include <fstream> #include "tui.hpp" #include "invapi.hpp" @@ -15,11 +16,35 @@ // namespace py = pybind11; using namespace std; +using json = nlohmann::json; + +void validateStructConversions() { + + std::ifstream inputFile{"./raycharles.json"}; + auto size = inputFile.tellg(); + cout << size << endl; + std::string str(size, '\0'); // construct string to stream size + inputFile.seekg(0); + if(inputFile.read(&str[0], size)) + std::cout << str << '\n'; + + // json info = json::parse(inputFile); + // Video::video v = info["entries"].get<Video::video>(); + // json j = v; + // cout << j << endl; +} int main(int argc, char **argv) { - YtdlpWrapper yt; - yt.searchVideos("the very thought of you", 5); + validateStructConversions(); + + // YtdlpWrapper yt; + // vector<Video::video> response = yt.searchVideos("factorio"); + // for (Video::video i: response) { + + // cout << i.id << ", " << i.url << ", " << endl; + // } + // nlohmann::json j = yt.getJsonSearch("the very thought of you"); // cout << j << endl; |