diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-11-12 23:53:29 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-12 23:53:29 +0100 |
commit | 3e55199544908a8026b4fe621b2b6af7770ce4a4 (patch) | |
tree | cdb68c3820d28ba59a9ebf3d320ee37729bb8065 /plugins | |
parent | 5c27b5fbaa0f1693bf4605a3e6fc57d0f066c0ec (diff) |
Add youtube description
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Youtube.hpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/Youtube.hpp b/plugins/Youtube.hpp index 23f7e20..d3a57a6 100644 --- a/plugins/Youtube.hpp +++ b/plugins/Youtube.hpp @@ -23,6 +23,14 @@ namespace QuickMedia { YoutubeFormat base; }; + struct YoutubeVideoDetails { + std::string title; + std::string author; + std::string rating; + std::string views; + std::string description; + }; + // Returns |url| if the url is already a youtube url std::string invidious_url_to_youtube_url(const std::string &url); bool youtube_url_extract_id(const std::string &youtube_url, std::string &youtube_video_id); @@ -52,6 +60,12 @@ namespace QuickMedia { std::unordered_set<std::string> added_videos; }; + class YoutubeDescriptionPage : public Page { + public: + YoutubeDescriptionPage(Program *program) : Page(program) {} + const char* get_title() const override { return "Description"; } + }; + class YoutubeCommentsPage : public LazyFetchPage { public: YoutubeCommentsPage(Program *program, const std::string &video_url, const std::string &continuation_token) : LazyFetchPage(program), video_url(video_url), continuation_token(continuation_token) {} @@ -144,6 +158,7 @@ namespace QuickMedia { const char* get_title() const override { return ""; } BodyItems get_related_media(const std::string &url) override; PluginResult get_related_pages(const BodyItems &related_videos, const std::string &channel_url, std::vector<Tab> &result_tabs) override; + int get_related_pages_first_tab() override { return 1; } void set_url(std::string new_url) override; std::string get_url_timestamp() override { return timestamp; } std::string get_video_url(int max_height, bool &has_embedded_audio, std::string &ext) override; @@ -166,5 +181,6 @@ namespace QuickMedia { std::string playback_url; std::string watchtime_url; std::string tracking_url; + YoutubeVideoDetails video_details; }; } |