Struct Stream

Source
pub struct Stream {
Show 28 fields 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: Option<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>, /* private fields */
}
Expand description

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

Fields§

§mime: Mime§codecs: Vec<String>§is_progressive: bool§includes_video_track: bool§includes_audio_track: bool§format_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: u8§height: Option<u64>§high_replication: Option<bool>§index_range: Option<Range<u64>>§init_range: Option<Range<u64>>§is_otf: bool§itag: u64§last_modified: Option<DateTime<Utc>>§loudness_db: Option<f64>§projection_type: ProjectionType§quality: Quality§quality_label: Option<QualityLabel>§signature_cipher: SignatureCipher§width: Option<u64>§video_details: Arc<VideoDetails>

Implementations§

Source§

impl Stream

Source

pub async fn download_with_callback( &self, callback: Callback, ) -> Result<PathBuf>

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

Source

pub async fn download_to_dir_with_callback<P: AsRef<Path>>( &self, dir: P, callback: Callback, ) -> Result<PathBuf>

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

Source

pub async fn download_to_with_callback<P: AsRef<Path>>( &self, path: P, callback: Callback, ) -> Result<()>

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

Source§

impl Stream

Source

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

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.
Source

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

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

Source

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

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

Source

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

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

Source§

impl Stream

Source

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

A synchronous wrapper around Stream::download.

Source

pub fn blocking_download_with_callback( &self, callback: Callback, ) -> Result<PathBuf>

A synchronous wrapper around Stream::download_with_callback.

Source

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

A synchronous wrapper around Stream::download_to_dir.

Source

pub fn blocking_download_to_dir_with_callback<P: AsRef<Path>>( &self, dir: P, callback: Callback, ) -> Result<PathBuf>

A synchronous wrapper around Stream::download_to_dir_with_callback.

Source

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

A synchronous wrapper around Stream::download_to.

Source

pub fn blocking_download_to_with_callback<P: AsRef<Path>>( &self, path: P, callback: Callback, ) -> Result<()>

A synchronous wrapper around Stream::download_to_with_callback.

Source

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

A synchronous wrapper around Stream::content_length.

Trait Implementations§

Source§

impl Clone for Stream

Source§

fn clone(&self) -> Stream

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Stream

Source§

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

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

impl<'de> Deserialize<'de> for Stream

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 PartialEq for Stream

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Stream

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§

§

impl Freeze for Stream

§

impl !RefUnwindSafe for Stream

§

impl Send for Stream

§

impl Sync for Stream

§

impl Unpin for Stream

§

impl !UnwindSafe for Stream

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