pub struct DownloaderBuilder { /* private fields */ }
Expand description
Builder to construct a new downloader
Implementations§
Source§impl DownloaderBuilder
impl DownloaderBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new DownloaderBuilder
This is the same as Downloader::builder
Sourcepub fn ffmpeg<S: Into<String>>(self, ffmpeg: S) -> Self
pub fn ffmpeg<S: Into<String>>(self, ffmpeg: S) -> Self
Set the path to ffmpeg, used to join video and audio files
The default system-wide ffmpeg
binary is used by default.
Sourcepub fn multi_progress(self, progress: MultiProgress) -> Self
Available on crate feature indicatif
only.
pub fn multi_progress(self, progress: MultiProgress) -> Self
indicatif
only.Set the indicatif MultiProgress
used to show download progress
for all downloads
Sourcepub fn progress_style(self, style: ProgressStyle) -> Self
Available on crate feature indicatif
only.
pub fn progress_style(self, style: ProgressStyle) -> Self
indicatif
only.Set the indicatif ProgressStyle
for the progress bars displayed under multi_progress
Sourcepub fn stream_filter(self, filter: StreamFilter) -> Self
pub fn stream_filter(self, filter: StreamFilter) -> Self
Set the default StreamFilter
for all downloads.
The filter can be overridden for individual download queries.
Sourcepub fn video_format(self, video_format: DownloadVideoFormat) -> Self
pub fn video_format(self, video_format: DownloadVideoFormat) -> Self
Set the DownloadVideoFormat
of downloaded videos
Sourcepub fn n_retries(self, n_retries: u32) -> Self
pub fn n_retries(self, n_retries: u32) -> Self
Set the number of retries in case a download fails with a 403 error
Sourcepub fn path_precheck(self) -> Self
pub fn path_precheck(self) -> Self
Enable path precheck
The downloader will check if the destination path
(predicted from the entity to download and the StreamFilter) exists and
skips the download with DownloadError::Exists
without fetching any player data.
This allows fast resumption of playlist downloads.
Sourcepub fn crop_cover(self) -> Self
Available on crate feature audiotag
only.
pub fn crop_cover(self) -> Self
audiotag
only.Crop YouTube thumbnails to get square album covers
Sourcepub fn client_type(self, client_type: ClientType) -> Self
pub fn client_type(self, client_type: ClientType) -> Self
Set the ClientType
used to fetch the YT player
Sourcepub fn client_types<T: Into<Vec<ClientType>>>(self, client_types: T) -> Self
pub fn client_types<T: Into<Vec<ClientType>>>(self, client_types: T) -> Self
Set a list of client types used to fetch the YT player
The clients are used in the given order. If a client cannot fetch the requested video, an attempt is made with the next one.
Sourcepub fn build(self) -> Downloader
pub fn build(self) -> Downloader
Create a new, configured Downloader
instance
Sourcepub fn build_with_client(self, http_client: Client) -> Downloader
pub fn build_with_client(self, http_client: Client) -> Downloader
Create a new, configured Downloader
instance using a custom Reqwest Client
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DownloaderBuilder
impl !RefUnwindSafe for DownloaderBuilder
impl Send for DownloaderBuilder
impl Sync for DownloaderBuilder
impl Unpin for DownloaderBuilder
impl !UnwindSafe for DownloaderBuilder
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more