aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-04-03 20:49:37 +0200
committerdec05eba <dec05eba@protonmail.com>2024-04-03 20:49:37 +0200
commit4c37a5463c23fcdb165228aae096f2bb0a25b98b (patch)
tree6b863d102551e1d19e93d0864b3f3598f86724b4 /plugins
parente8cf95fd56bb6cc16f937d06c3554260fd789a92 (diff)
Autoskip youtube sponsors
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Page.hpp6
-rw-r--r--plugins/Youtube.hpp2
2 files changed, 7 insertions, 1 deletions
diff --git a/plugins/Page.hpp b/plugins/Page.hpp
index 97b0340..044759a 100644
--- a/plugins/Page.hpp
+++ b/plugins/Page.hpp
@@ -134,12 +134,18 @@ namespace QuickMedia {
std::string title;
};
+ struct SponsorSegment {
+ double start_seconds;
+ double end_seconds;
+ };
+
struct VideoInfo {
std::string title;
std::string channel_url;
double duration = 0.0;
std::vector<MediaChapter> chapters;
std::string referer;
+ std::vector<SponsorSegment> sponsor_segments;
};
class VideoPage : public Page {
diff --git a/plugins/Youtube.hpp b/plugins/Youtube.hpp
index ac92526..d7008ae 100644
--- a/plugins/Youtube.hpp
+++ b/plugins/Youtube.hpp
@@ -187,7 +187,7 @@ namespace QuickMedia {
void set_watch_progress(int64_t time_pos_sec, int64_t duration_sec) override;
bool autoplay_next_item() override { return goto_next_item; }
private:
- PluginResult parse_video_response(const Json::Value &json_root, std::string &title, std::string &channel_url, std::vector<MediaChapter> &chapters, std::string &err_str);
+ PluginResult parse_video_response(const Json::Value &json_root, std::string &title, std::string &channel_url, std::vector<MediaChapter> &chapters, std::vector<SponsorSegment> &sponsor_segments, std::string &err_str);
void parse_format(const Json::Value &format_json, bool is_adaptive);
void parse_formats(const Json::Value &streaming_data_json);
private: