Struct rustube::Stream[][src]

pub struct Stream {
    pub mime: Mime,
    pub codecs: Vec<String>,
    pub is_progressive: bool,
    pub includes_video_track: bool,
    pub includes_audio_track: bool,
    pub format_type: Option<FormatType>,
    pub approx_duration_ms: Option<u64>,
    pub audio_channels: Option<u8>,
    pub audio_quality: Option<AudioQuality>,
    pub audio_sample_rate: Option<u64>,
    pub average_bitrate: Option<u64>,
    pub bitrate: Option<u64>,
    pub color_info: Option<ColorInfo>,
    pub fps: u8,
    pub height: Option<u64>,
    pub high_replication: Option<bool>,
    pub index_range: Option<Range<u64>>,
    pub init_range: Option<Range<u64>>,
    pub is_otf: bool,
    pub itag: u64,
    pub last_modified: DateTime<Utc>,
    pub loudness_db: Option<f64>,
    pub projection_type: ProjectionType,
    pub quality: Quality,
    pub quality_label: Option<QualityLabel>,
    pub signature_cipher: SignatureCipher,
    pub width: Option<u64>,
    pub video_details: Arc<VideoDetails>,
    // some fields omitted
}

A downloadable video Stream, that contains all the important information.

Fields

mime: Mimecodecs: Vec<String>is_progressive: boolincludes_video_track: boolincludes_audio_track: boolformat_type: Option<FormatType>approx_duration_ms: Option<u64>audio_channels: Option<u8>audio_quality: Option<AudioQuality>audio_sample_rate: Option<u64>average_bitrate: Option<u64>bitrate: Option<u64>color_info: Option<ColorInfo>fps: u8height: Option<u64>high_replication: Option<bool>index_range: Option<Range<u64>>init_range: Option<Range<u64>>is_otf: boolitag: u64last_modified: DateTime<Utc>loudness_db: Option<f64>projection_type: ProjectionTypequality: Qualityquality_label: Option<QualityLabel>signature_cipher: SignatureCipherwidth: Option<u64>video_details: Arc<VideoDetails>

Implementations

impl Stream[src]

pub async fn content_length(&self) -> Result<u64>[src]

This is supported on crate features stream and download only.

The content length of the video. If the content length was not included in the RawFormat, this method will make a HEAD request, to try to figure it out.

Errors:

  • When the content length was not included in the RawFormat, and the request fails.

pub async fn download(&self) -> Result<PathBuf>[src]

This is supported on crate features stream and download only.

Attempts to downloads the Streams resource. This will download the video to <video_id>.mp4 in the current working directory.

pub async fn download_to_dir<P: AsRef<Path>>(&self, dir: P) -> Result<PathBuf>[src]

This is supported on crate features stream and download only.

Attempts to downloads the Streams resource. This will download the video to <video_id>.mp4 in the provided directory.

pub async fn download_to<P: AsRef<Path>>(&self, path: P) -> Result<()>[src]

This is supported on crate features stream and download only.

Attempts to downloads the Streams resource. This will download the video to the provided file path.

impl Stream[src]

pub fn blocking_download(&self) -> Result<PathBuf>[src]

This is supported on crate features stream and blocking only.

A synchronous wrapper around Stream::download.

pub fn blocking_download_to_dir<P: AsRef<Path>>(
    &self,
    dir: P
) -> Result<PathBuf>
[src]

This is supported on crate features stream and blocking only.

A synchronous wrapper around Stream::download_to_dir.

pub fn blocking_download_to<P: AsRef<Path>>(&self, path: P) -> Result<()>[src]

This is supported on crate features stream and blocking only.

A synchronous wrapper around Stream::download_to.

pub fn blocking_content_length(&self) -> Result<u64>[src]

This is supported on crate features stream and blocking only.

A synchronous wrapper around Stream::content_length.

Trait Implementations

impl Clone for Stream[src]

This is supported on crate feature stream only.

impl Debug for Stream[src]

This is supported on crate feature stream only.

impl PartialEq<Stream> for Stream[src]

This is supported on crate feature stream only.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.