pub struct Ydl { /* private fields */ }
Expand description
Main orchestrator for subtitle downloads
Implementations§
Source§impl Ydl
impl Ydl
Sourcepub fn new(url: &str, options: YdlOptions) -> YdlResult<Self>
pub fn new(url: &str, options: YdlOptions) -> YdlResult<Self>
Create a new downloader instance for a specific URL
Sourcepub async fn subtitle(&self, subtitle_type: SubtitleType) -> YdlResult<String>
pub async fn subtitle(&self, subtitle_type: SubtitleType) -> YdlResult<String>
Download subtitles in the specified format
Sourcepub async fn subtitle_async(
&self,
subtitle_type: SubtitleType,
) -> YdlResult<String>
pub async fn subtitle_async( &self, subtitle_type: SubtitleType, ) -> YdlResult<String>
Download subtitles in the specified format (async variant)
Sourcepub async fn available_subtitles(&self) -> YdlResult<Vec<SubtitleTrack>>
pub async fn available_subtitles(&self) -> YdlResult<Vec<SubtitleTrack>>
List all available subtitle tracks for the video
Sourcepub async fn subtitles(
&self,
types: &[SubtitleType],
) -> YdlResult<Vec<SubtitleResult>>
pub async fn subtitles( &self, types: &[SubtitleType], ) -> YdlResult<Vec<SubtitleResult>>
Download multiple subtitle formats at once
Sourcepub async fn metadata(&self) -> YdlResult<VideoMetadata>
pub async fn metadata(&self) -> YdlResult<VideoMetadata>
Get video metadata without downloading subtitles
Sourcepub fn normalized_url(&self) -> String
pub fn normalized_url(&self) -> String
Get the normalized YouTube URL
Sourcepub async fn has_subtitles(&self) -> bool
pub async fn has_subtitles(&self) -> bool
Check if subtitles are likely available (quick check)
Sourcepub async fn subtitle_with_retry(
&self,
subtitle_type: SubtitleType,
) -> YdlResult<String>
pub async fn subtitle_with_retry( &self, subtitle_type: SubtitleType, ) -> YdlResult<String>
Download subtitle with retry logic
Sourcepub fn with_language(self, lang: &str) -> Self
pub fn with_language(self, lang: &str) -> Self
Future extension for method chaining
Sourcepub fn with_auto_generated(self, allow: bool) -> Self
pub fn with_auto_generated(self, allow: bool) -> Self
Future extension for format preference
Auto Trait Implementations§
impl Freeze for Ydl
impl !RefUnwindSafe for Ydl
impl Send for Ydl
impl Sync for Ydl
impl Unpin for Ydl
impl !UnwindSafe for Ydl
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