DramaCool.hpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include "Page.hpp"
  3. namespace QuickMedia {
  4. class DramaCoolSearchPage : public Page {
  5. public:
  6. DramaCoolSearchPage(Program *program) : Page(program) {}
  7. const char* get_title() const override { return "Search"; }
  8. bool search_is_filter() override { return false; }
  9. SearchResult search(const std::string &str, BodyItems &result_items) override;
  10. PluginResult submit(const SubmitArgs &args, std::vector<Tab> &result_tabs) override;
  11. };
  12. class DramaCoolEpisodesPage : public Page {
  13. public:
  14. DramaCoolEpisodesPage(Program *program, std::string series_name) : Page(program), series_name(std::move(series_name)) {}
  15. const char* get_title() const override { return "Search"; }
  16. bool search_is_filter() override { return true; }
  17. PluginResult submit(const SubmitArgs &args, std::vector<Tab> &result_tabs) override;
  18. private:
  19. std::string series_name;
  20. };
  21. class DramaCoolVideoPage : public VideoPage {
  22. public:
  23. DramaCoolVideoPage(Program *program, std::string url, std::string series_name, std::string episode_name, std::string referer) : VideoPage(program, std::move(url), false), series_name(std::move(series_name)), episode_name(std::move(episode_name)), referer(std::move(referer)) {}
  24. const char* get_title() const override { return episode_name.c_str(); }
  25. PluginResult load(const SubmitArgs &args, VideoInfo &video_info, std::string &err_str) override;
  26. std::string get_url_timestamp() override;
  27. void set_watch_progress(int64_t time_pos_sec, int64_t duration_sec) override;
  28. private:
  29. std::string get_video_id() const;
  30. private:
  31. std::string series_name;
  32. std::string episode_name;
  33. std::string referer;
  34. };
  35. }