pub struct Generic { /* private fields */ }Expand description
Generic extractor for all non-YouTube sites.
This extractor provides a simple wrapper around yt-dlp that works with any supported site. It includes helpers for authentication.
Implementations§
Source§impl Generic
impl Generic
Sourcepub fn for_extractor(executable_path: PathBuf, name: String) -> Self
pub fn for_extractor(executable_path: PathBuf, name: String) -> Self
Sourcepub fn with_extractor_args(&mut self, extractor: &str, args: &str) -> &mut Self
pub fn with_extractor_args(&mut self, extractor: &str, args: &str) -> &mut Self
Sourcepub fn with_credentials(&mut self, username: &str, password: &str) -> &mut Self
pub fn with_credentials(&mut self, username: &str, password: &str) -> &mut Self
Use credentials for sites requiring login.
Security note: Credentials are passed via --username and --password CLI arguments,
which may be visible in process listings. For sensitive environments, prefer
[with_netrc] or [with_cookies] on the Downloader instead.
§Arguments
username- Username for authenticationpassword- Password for authentication
§Returns
Self for method chaining
§Examples
let mut extractor = Generic::new(PathBuf::from("yt-dlp"));
extractor.with_credentials("user@email.com", "password");Trait Implementations§
Source§impl ExtractorBase for Generic
impl ExtractorBase for Generic
Source§fn executable_path(&self) -> PathBuf
fn executable_path(&self) -> PathBuf
Get the executable path.
Source§fn build_base_args(&self) -> Vec<String>
fn build_base_args(&self) -> Vec<String>
Build base arguments for yt-dlp.
Source§fn fetch_video_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Video>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_video_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Video>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch and parse video metadata.
Source§fn fetch_playlist_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Playlist>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_playlist_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Playlist>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch and parse playlist metadata.
Source§fn log_and_fetch_video<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
extractor: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Video>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn log_and_fetch_video<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
extractor: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Video>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetches video metadata and emits structured tracing on success or failure. Read more
Source§fn log_and_fetch_playlist<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
extractor: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Playlist>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn log_and_fetch_playlist<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
extractor: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Playlist>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetches playlist metadata and emits structured tracing on success or failure. Read more
Source§impl ExtractorConfig for Generic
impl ExtractorConfig for Generic
Source§fn args_mut(&mut self) -> &mut Vec<String>
fn args_mut(&mut self) -> &mut Vec<String>
Returns a mutable reference to the internal args vector.
Source§fn timeout_mut(&mut self) -> &mut Duration
fn timeout_mut(&mut self) -> &mut Duration
Returns a mutable reference to the internal timeout.
Source§fn with_timeout(&mut self, timeout: Duration) -> &mut Self
fn with_timeout(&mut self, timeout: Duration) -> &mut Self
Set timeout for yt-dlp operations.
Use a Netscape cookie file for authentication.
Extract cookies from a browser for authentication.
Source§fn with_netrc(&mut self) -> &mut Self
fn with_netrc(&mut self) -> &mut Self
Use .netrc for authentication.
Source§impl VideoExtractor for Generic
impl VideoExtractor for Generic
Source§fn fetch_video<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Video>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_video<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Video>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch video metadata from a URL. Read more
Source§fn fetch_playlist<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Playlist>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_playlist<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Playlist>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch playlist metadata from a URL. Read more
Source§fn name(&self) -> ExtractorName
fn name(&self) -> ExtractorName
Get the name of this extractor.
Auto Trait Implementations§
impl Freeze for Generic
impl RefUnwindSafe for Generic
impl Send for Generic
impl Sync for Generic
impl Unpin for Generic
impl UnsafeUnpin for Generic
impl UnwindSafe for Generic
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.