aboutsummaryrefslogtreecommitdiff
path: root/plugins/Youtube.hpp
blob: 685d4b08131eb075e0948d1af785027328f43fb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once

#include "Plugin.hpp"

namespace QuickMedia {
    class Youtube : public Plugin {
    public:
        Youtube();
        PluginResult get_front_page(BodyItems &result_items) override;
        SuggestionResult update_search_suggestions(const std::string &text, BodyItems &result_items) override;
        BodyItems get_related_media(const std::string &url) override;
        bool search_suggestions_has_thumbnails() const override { return true; }
        bool search_results_has_thumbnails() const override { return false; }
        std::string autocomplete_search(const std::string &query) override;
        int get_search_delay() const override { return 350; }
        bool search_suggestion_is_search() const override { return true; }
        Page get_page_after_search() const override { return Page::VIDEO_CONTENT; }
    private:
        void search_suggestions_get_continuation(const std::string &url, const std::string &continuation_token, BodyItems &result_items);
        std::vector<CommandArg> get_cookies() const;
    private:
        std::string last_autocomplete_result;
    };
}