diff options
Diffstat (limited to 'src/YtdlpWrapper.cpp')
-rw-r--r-- | src/YtdlpWrapper.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/YtdlpWrapper.cpp b/src/YtdlpWrapper.cpp index 9e27a1c..7368c14 100644 --- a/src/YtdlpWrapper.cpp +++ b/src/YtdlpWrapper.cpp @@ -1,4 +1,6 @@ #include <string> +#include <vector> +#include <iostream> #include <pybind11/embed.h> #include <nlohmann/json.hpp> @@ -30,3 +32,16 @@ json YtdlpWrapper::getJsonSearch(const std::string& searchTerm, int limit) { return json::parse(pyDictToJsonString(info)); } +std::vector<Video::video> YtdlpWrapper::searchVideos(const std::string& searchTerm, int limit) { + + std::vector<Video::video> resp; + + json info = getJsonSearch(searchTerm, limit); + + for (json i: info["entries"]) { + std::cout << i["id"] << std::endl; + } + + return resp; +} + |