#include #include #include #include #include #include #include #include #include #include // namespace py = pybind11; using namespace std; using json = nlohmann::json; namespace fs = std::filesystem; void parseSysArgs(int argc, char **argv) { multimap args; string currentArg; for (int i{0}; i < argc; ++i) { if (strncmp(argv[i], "-", 1) == 0) { if (strcmp(argv[i], "--version") == 0) { cout << PROGRAM_NAME << " v" << VERSION << endl; currentArg = ""; } else { currentArg = argv[i]; } } else { if (currentArg == "") { if (strncmp(argv[i], "http://", 7) == 0 || strncmp(argv[i], "https://", 8) == 0) { spawn(argv[i], true); } } else if (currentArg == "-S" || currentArg == "--search") { cout << "searching for: " << argv[i] << endl; currentArg = ""; } // } else { // cout << currentArg << ": " << argv[i] << endl; // } } } } int main(int argc, char **argv) { // validateStructConversions(); parseSysArgs(argc, argv); SqliteInterface sqldb; // InvidiousApi invapi("https://httpbin.org/get"); // invapi.test(); // InvidiousApi::saveInstancesToDb(sqldb); vector instances = InvidiousApi::getInstances(); for (InvidiousApi::instance i: instances) { cout << i.url << " " << i.health << " " << i.location << endl; } }