use serde::Deserialize; #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct Channel { pub id: String, pub name: String, pub avatar_url: String, pub banner_url: Option, pub description: String, pub nextpage: Option, pub nextbody: Option, pub related_streams: Vec, } #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct Playlist { pub name: String, pub thumbnail_url: String, pub banner_url: Option, pub uploader: String, pub uploader_url: String, pub uploader_avatar: Option, pub videos: i32, pub nextpage: Option, pub nextbody: Option, pub related_streams: Vec, } #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct StreamsPage { pub nextpage: Option, pub nextbody: Option, pub related_streams: Vec, } #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct RelatedStream { pub url: String, pub title: String, pub thumbnail: String, pub uploader_avatar: Option, pub uploader_name: String, pub uploader_url: String, pub uploaded_date: Option, pub uploader_verified: bool, pub duration: i32, pub views: i64, pub uploaded: i64, } #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct VideoInfo { pub title: String, pub description: String, pub dash: Option, pub upload_date: String, pub uploader: String, pub uploader_url: String, pub uploader_avatar: String, pub thumbnail_url: String, pub hls: String, pub duration: i32, pub views: i64, pub likes: i64, pub lbry_id: Option, pub dislikes: i64, pub audio_streams: Vec, pub video_streams: Vec, pub related_streams: Vec, pub subtitles: Vec, pub livestream: bool, } #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Stream { pub url: String, pub format: String, pub quality: String, pub mime_type: String, pub codec: Option, pub video_only: bool, pub bitrate: i32, pub init_start: i32, pub init_end: i32, pub index_start: i32, pub index_end: i32, pub width: i32, pub height: i32, pub fps: i32, } #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Subtitle { pub url: String, pub mime_type: String, pub name: String, pub code: String, pub auto_generated: bool, } #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CommentsInfo { pub comments: Vec, pub nextpage: Option, } #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Comment { pub author: String, pub thumbnail: String, pub comment_id: String, pub comment_text: String, pub commented_time: String, pub commentor_url: String, pub like_count: i64, pub hearted: bool, pub pinned: bool, pub verified: bool, } #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct ChannelSearch { pub items: Vec, pub nextpage: Option, pub suggestion: Option, pub corrected: bool, } #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct ChannelSearchItem { pub name: String, pub thumbnail: String, pub url: String, pub description: Option, pub subscribers: i32, pub videos: i32, pub verified: bool, }