#ifndef VIDEO_H #define VIDEO_H #include #include #include #include namespace Video { struct format { std::string format; std::string url; std::string vcodec; std::string acodec; std::string ext; std::optional quality; std::optional resolution; std::optional height; std::optional width; }; struct thumbnail { std::string url; int preference; std::string id; std::optional resolution; std::optional height; std::optional width; }; struct video { std::string id; std::string title; std::string url; std::string channelId; std::string channelUrl; std::vector formats; std::vector thumbnails; std::optional uploader; std::optional uploaderId; std::optional uploaderUrl; std::optional duration; std::optional viewcount; std::optional description; }; void to_json(nlohmann::json& j, const format& f); void to_json(nlohmann::json& j, const std::vector& v); void to_json(nlohmann::json& j, const thumbnail& t); void to_json(nlohmann::json& j, const std::vector& v); void to_json(nlohmann::json& j, const video& v); void from_json(const nlohmann::json& j, format& f); void from_json(const nlohmann::json& j, std::vector& v); void from_json(const nlohmann::json& j, thumbnail& t); void from_json(const nlohmann::json& j, std::vector& v); void from_json(const nlohmann::json& j, video& v); }; #endif