feat: add chapter extraction

This commit is contained in:
ThetaDev 2022-09-21 16:36:26 +02:00
parent 8629454b5b
commit ed522e622d
3 changed files with 102 additions and 8 deletions

View file

@ -245,6 +245,8 @@ pub struct VideoDetails {
///
/// https://creativecommons.org/licenses/by/3.0/
pub is_ccommons: bool,
/// Chapters of the video
pub chapters: Vec<Chapter>,
/// Recommended videos
///
/// Note: Recommendations are not available for age-restricted videos
@ -255,6 +257,18 @@ pub struct VideoDetails {
pub latest_comments: Paginator<Comment>,
}
/// Videos can consist of different chapters, which YouTube shows
/// on the seek bar and below the description text.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct Chapter {
/// Chapter title
pub title: String,
/// Chapter position in seconds
pub position: u32,
/// Chapter thumbnail
pub thumbnail: Vec<Thumbnail>,
}
/*
@RECOMMENDATIONS
*/