Struct DownloaderBuilder

Source
pub struct DownloaderBuilder { /* private fields */ }
Expand description

Builder to construct a new downloader

Implementations§

Source§

impl DownloaderBuilder

Source

pub fn new() -> Self

Create a new DownloaderBuilder

This is the same as Downloader::builder

Source

pub fn rustypipe(self, rp: &RustyPipe) -> Self

Use a custom RustyPipe client

Source

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.

Source

pub fn multi_progress(self, progress: MultiProgress) -> Self

Available on crate feature indicatif only.

Set the indicatif MultiProgress used to show download progress for all downloads

Source

pub fn progress_style(self, style: ProgressStyle) -> Self

Available on crate feature indicatif only.

Set the indicatif ProgressStyle for the progress bars displayed under multi_progress

Source

pub fn stream_filter(self, filter: StreamFilter) -> Self

Set the default StreamFilter for all downloads.

The filter can be overridden for individual download queries.

Source

pub fn video_format(self, video_format: DownloadVideoFormat) -> Self

Set the DownloadVideoFormat of downloaded videos

Source

pub fn n_retries(self, n_retries: u32) -> Self

Set the number of retries in case a download fails with a 403 error

Source

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.

Source

pub fn audio_tag(self) -> Self

Available on crate feature audiotag only.

Enable audio tagging

Source

pub fn crop_cover(self) -> Self

Available on crate feature audiotag only.

Crop YouTube thumbnails to get square album covers

Source

pub fn client_type(self, client_type: ClientType) -> Self

Set the ClientType used to fetch the YT player

Source

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.

Source

pub fn build(self) -> Downloader

Create a new, configured Downloader instance

Source

pub fn build_with_client(self, http_client: Client) -> Downloader

Create a new, configured Downloader instance using a custom Reqwest Client

Trait Implementations§

Source§

impl Default for DownloaderBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> ParallelSend for T