Struct VideoDetails

Source
pub struct VideoDetails {
    pub video_id: String,
    pub title: String,
    pub length_seconds: u32,
    pub keywords: Option<Vec<String>>,
    pub channel_id: String,
    pub short_description: String,
    pub view_count: String,
    pub author: String,
    pub thumbnails: Vec<VideoThumbnail>,
    pub is_live_content: bool,
}
Expand description

§VideoDetails

Comprehensive metadata about a YouTube video.

This struct contains detailed information about a video, extracted from YouTube’s player response. It includes basic information like title and author, as well as more detailed metadata like view count, keywords, and thumbnails.

§Fields

  • video_id - The unique YouTube ID for the video
  • title - The video’s title
  • length_seconds - The video duration in seconds
  • keywords - Optional list of keywords/tags associated with the video
  • channel_id - The YouTube channel ID
  • short_description - The video description
  • view_count - Number of views as a string (to handle very large numbers)
  • author - Name of the channel/creator
  • thumbnails - List of available thumbnail images in various resolutions
  • is_live_content - Whether the video is or was a live stream

§Example Usage

let api = YouTubeTranscriptApi::new(None, None, None)?;
let video_id = "dQw4w9WgXcQ";

// Fetch video details
let details = api.fetch_video_details(video_id).await?;

println!("Title: {}", details.title);
println!("By: {} ({})", details.author, details.channel_id);
println!("Duration: {} seconds", details.length_seconds);
println!("Views: {}", details.view_count);

// Get highest resolution thumbnail
if let Some(thumbnail) = details.thumbnails.iter().max_by_key(|t| t.width * t.height) {
    println!("Thumbnail URL: {}", thumbnail.url);
}

Fields§

§video_id: String

The unique YouTube video ID (e.g., “dQw4w9WgXcQ”)

§title: String

The video’s title

§length_seconds: u32

Total duration of the video in seconds

§keywords: Option<Vec<String>>

Optional list of keywords/tags associated with the video

§channel_id: String

The YouTube channel ID that published the video

§short_description: String

The video description text

§view_count: String

Number of views as a string (to handle potentially very large numbers)

§author: String

Name of the channel/creator who published the video

§thumbnails: Vec<VideoThumbnail>

List of available thumbnail images in various resolutions

§is_live_content: bool

Whether the video is or was a live stream

Trait Implementations§

Source§

impl Clone for VideoDetails

Source§

fn clone(&self) -> VideoDetails

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VideoDetails

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for VideoDetails

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for VideoDetails

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T