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
sourceimpl Stream
impl Stream
sourceimpl Stream
impl Stream
sourcepub async fn content_length(&self) -> Result<u64>
pub async fn content_length(&self) -> Result<u64>
sourcepub async fn download(&self) -> Result<PathBuf>
pub async fn download(&self) -> Result<PathBuf>
Attempts to downloads the Stream
s resource.
This will download the video to <video_id>.mp4 in the current working directory.
sourceimpl Stream
impl Stream
sourcepub fn blocking_download(&self) -> Result<PathBuf>
pub fn blocking_download(&self) -> Result<PathBuf>
A synchronous wrapper around Stream::download
.
sourcepub fn blocking_download_with_callback(
&self,
callback: Callback
) -> Result<PathBuf>
pub fn blocking_download_with_callback(
&self,
callback: Callback
) -> Result<PathBuf>
A synchronous wrapper around Stream::download_with_callback
.
sourcepub fn blocking_download_to_dir<P: AsRef<Path>>(&self, dir: P) -> Result<PathBuf>
pub fn blocking_download_to_dir<P: AsRef<Path>>(&self, dir: P) -> Result<PathBuf>
A synchronous wrapper around Stream::download_to_dir
.
sourcepub fn blocking_download_to_dir_with_callback<P: AsRef<Path>>(
&self,
dir: P,
callback: Callback
) -> Result<PathBuf>
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
.
sourcepub fn blocking_download_to<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub fn blocking_download_to<P: AsRef<Path>>(&self, path: P) -> Result<()>
A synchronous wrapper around Stream::download_to
.
sourcepub fn blocking_download_to_with_callback<P: AsRef<Path>>(
&self,
path: P,
callback: Callback
) -> Result<()>
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
.
sourcepub fn blocking_content_length(&self) -> Result<u64>
pub fn blocking_content_length(&self) -> Result<u64>
A synchronous wrapper around Stream::content_length
.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Stream
impl<'de> Deserialize<'de> for Stream
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Stream
impl Send for Stream
impl Sync for Stream
impl Unpin for Stream
impl !UnwindSafe for Stream
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more