diff options
author | ComradeCrow <comradecrow@vivaldi.net> | 2023-04-18 20:44:50 -0700 |
---|---|---|
committer | ComradeCrow <comradecrow@vivaldi.net> | 2023-04-18 20:44:50 -0700 |
commit | df6ccef6603d81fe140bfd7c726a1b1e1f72f097 (patch) | |
tree | 7bfe644bc55d41084fa7f03e34df5a7e6efff1b3 /src/YtdlpWrapper.hpp | |
parent | 772637e0947286e54ab97b8d55ad2c05fe9a1c86 (diff) | |
download | ytcpp-df6ccef6603d81fe140bfd7c726a1b1e1f72f097.tar.gz |
start adding structs
Diffstat (limited to 'src/YtdlpWrapper.hpp')
-rw-r--r-- | src/YtdlpWrapper.hpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/YtdlpWrapper.hpp b/src/YtdlpWrapper.hpp index f7cc256..9dbd3a2 100644 --- a/src/YtdlpWrapper.hpp +++ b/src/YtdlpWrapper.hpp @@ -4,12 +4,45 @@ #include <pybind11/embed.h> #include <nlohmann/json.hpp> +namespace Video { + + struct format { + + std::optional<float> quality; + std::string url; + std::string vcodec; + std::string acodec; + }; + + struct thumbnail { + + std::string url; + std::int preference; + std::int id; + std::optional<std::string> resolution; + } + + struct video { + + std::string id; + std::string title; + std::string url; + std::string channel; + std::int duration; + std::optional<int> viewcount; + std::optional<std::string> description; + + } +} + class YtdlpWrapper { + public: - nlohmann::json getJsonSearch(const string& searchTerm, int limit = 1); + nlohmann::json getJsonSearch(const std::string& searchTerm, int limit = 1); private: pybind11::object get_ytdl(); pybind11::object ytdl = pybind11::none(); + pybind11::scoped_interpreter guard{}; }; |