pub struct Video {Show 24 fields
pub id: String,
pub title: String,
pub thumbnail: String,
pub description: String,
pub availability: String,
pub upload_date: i64,
pub view_count: i64,
pub like_count: Option<i64>,
pub comment_count: Option<i64>,
pub channel: String,
pub channel_id: String,
pub channel_url: String,
pub channel_follower_count: Option<i64>,
pub formats: Vec<Format>,
pub thumbnails: Vec<Thumbnail>,
pub automatic_captions: HashMap<String, Vec<AutomaticCaption>>,
pub tags: Vec<String>,
pub categories: Vec<String>,
pub age_limit: i64,
pub has_drm: Option<bool>,
pub live_status: String,
pub playable_in_embed: bool,
pub extractor_info: ExtractorInfo,
pub version: Version,
}
Expand description
Represents a YouTube video, the output of ‘yt-dlp’.
Fields§
§id: String
The ID of the video.
title: String
The title of the video.
thumbnail: String
The thumbnail URL of the video, usually the highest quality.
description: String
The description of the video.
availability: String
If the video is public, unlisted, or private.
upload_date: i64
The upload date of the video.
view_count: i64
The number of views the video has.
like_count: Option<i64>
The number of likes the video has. None, when the author has hidden it.
comment_count: Option<i64>
The number of comments the video has. None, when the author has disabled comments.
channel: String
The channel display name.
channel_id: String
The channel ID, not the @username.
channel_url: String
The URL of the channel.
channel_follower_count: Option<i64>
The number of subscribers the channel has.
formats: Vec<Format>
The available formats of the video.
thumbnails: Vec<Thumbnail>
The thumbnails of the video.
automatic_captions: HashMap<String, Vec<AutomaticCaption>>
The automatic captions of the video.
The tags of the video.
categories: Vec<String>
The categories of the video.
age_limit: i64
If the video is age restricted, the age limit is different from 0.
has_drm: Option<bool>
If the video is available in the country.
live_status: String
If the video was a live stream.
playable_in_embed: bool
If the video is playable in an embed.
extractor_info: ExtractorInfo
The extractor information.
version: Version
The version of ‘yt-dlp’ used to fetch the video.
Implementations§
Source§impl Video
impl Video
Sourcepub fn best_video_format(&self) -> Option<&Format>
pub fn best_video_format(&self) -> Option<&Format>
Returns the best format available. Formats sorting : “quality”, “video resolution”, “fps”, “video bitrate” If the video has no formats video formats, it returns None.
Sourcepub fn best_audio_format(&self) -> Option<&Format>
pub fn best_audio_format(&self) -> Option<&Format>
Returns the best audio format available. Formats sorting : “quality”, “audio bitrate”, “sample rate”, “audio channels” If the video has no formats audio formats, it returns None.
Sourcepub fn worst_video_format(&self) -> Option<&Format>
pub fn worst_video_format(&self) -> Option<&Format>
Returns the worst video format available. Formats sorting : “quality”, “video resolution”, “fps”, “video bitrate” If the video has no formats video formats, it returns None.
Sourcepub fn worst_audio_format(&self) -> Option<&Format>
pub fn worst_audio_format(&self) -> Option<&Format>
Returns the worst audio format available. Formats sorting : “quality”, “audio bitrate”, “sample rate”, “audio channels” If the video has no formats audio formats, it returns None.
Sourcepub fn compare_video_formats(&self, a: &Format, b: &Format) -> Ordering
pub fn compare_video_formats(&self, a: &Format, b: &Format) -> Ordering
Compares two video formats. Formats sorting : “quality”, “video resolution”, “fps”, “video bitrate”
Sourcepub fn compare_audio_formats(&self, a: &Format, b: &Format) -> Ordering
pub fn compare_audio_formats(&self, a: &Format, b: &Format) -> Ordering
Compares two audio formats. Formats sorting : “quality”, “audio bitrate”, “sample rate”, “audio channels”
Sourcepub fn select_video_format(
&self,
quality: VideoQuality,
codec: VideoCodecPreference,
) -> Option<&Format>
pub fn select_video_format( &self, quality: VideoQuality, codec: VideoCodecPreference, ) -> Option<&Format>
Sourcepub fn select_audio_format(
&self,
quality: AudioQuality,
codec: AudioCodecPreference,
) -> Option<&Format>
pub fn select_audio_format( &self, quality: AudioQuality, codec: AudioCodecPreference, ) -> Option<&Format>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Video
impl<'de> Deserialize<'de> for Video
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Video
impl StructuralPartialEq for Video
Auto Trait Implementations§
impl Freeze for Video
impl RefUnwindSafe for Video
impl Send for Video
impl Sync for Video
impl Unpin for Video
impl UnwindSafe for Video
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.