Struct youtube_dl::downloader::YoutubeDlFetcher
source · pub struct YoutubeDlFetcher { /* private fields */ }
Expand description
Handles downloading of the youtube-dl/yt-dlp binary from GitHub.
Implementations§
source§impl YoutubeDlFetcher
impl YoutubeDlFetcher
sourcepub fn new(user: &str, repo: &str) -> Self
pub fn new(user: &str, repo: &str) -> Self
Allows specifying the GitHub user and repository to download the binary from.
The Default
implementation uses yt-dlp
for both.
sourcepub async fn download(
&self,
destination: impl AsRef<Path>
) -> Result<PathBuf, Error>
pub async fn download( &self, destination: impl AsRef<Path> ) -> Result<PathBuf, Error>
Fetches the latest release from the GitHub API, then downloads the binary
to the specified destination. destination
can either be a directory, in which case
the executable is downloaded to that directory, or a file, in which case the file is created.
Trait Implementations§
source§impl Debug for YoutubeDlFetcher
impl Debug for YoutubeDlFetcher
Auto Trait Implementations§
impl Freeze for YoutubeDlFetcher
impl !RefUnwindSafe for YoutubeDlFetcher
impl Send for YoutubeDlFetcher
impl Sync for YoutubeDlFetcher
impl Unpin for YoutubeDlFetcher
impl !UnwindSafe for YoutubeDlFetcher
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
Mutably borrows from an owned value. Read more