From ae6fb457ca385540e0f9b1347ef9c3c84815b16d Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 3 Nov 2020 20:29:20 +0100 Subject: Youtube add channel page, fix search pagination (update to correct continuation token) --- plugins/Youtube.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'plugins/Youtube.hpp') diff --git a/plugins/Youtube.hpp b/plugins/Youtube.hpp index bdb9c8b..e2dd201 100644 --- a/plugins/Youtube.hpp +++ b/plugins/Youtube.hpp @@ -1,6 +1,7 @@ #pragma once #include "Page.hpp" +#include namespace QuickMedia { class YoutubeSearchPage : public Page { @@ -17,6 +18,24 @@ namespace QuickMedia { std::string search_url; std::string continuation_token; int current_page = 0; + std::unordered_set added_videos; + }; + + class YoutubeChannelPage : public Page { + public: + YoutubeChannelPage(Program *program, std::string url, std::string continuation_token, std::string title) : Page(program), url(std::move(url)), continuation_token(std::move(continuation_token)), title(std::move(title)) {} + const char* get_title() const override { return title.c_str(); } + PluginResult get_page(const std::string &str, int page, BodyItems &result_items) override; + PluginResult submit(const std::string &title, const std::string &url, std::vector &result_tabs) override; + + std::unordered_set added_videos; + private: + PluginResult search_get_continuation(const std::string &url, const std::string &continuation_token, BodyItems &result_items); + private: + const std::string url; + std::string continuation_token; + const std::string title; + int current_page = 0; }; class YoutubeVideoPage : public Page { -- cgit v1.2.3