pub struct SubtitleExtractor { /* private fields */ }
Expand description
YouTube subtitle extractor for discovering and downloading subtitles
Implementations§
Source§impl SubtitleExtractor
impl SubtitleExtractor
Sourcepub fn new(options: YdlOptions) -> YdlResult<Self>
pub fn new(options: YdlOptions) -> YdlResult<Self>
Create a new subtitle extractor
Sourcepub async fn discover_tracks(
&self,
video_id: &str,
) -> YdlResult<Vec<SubtitleTrack>>
pub async fn discover_tracks( &self, video_id: &str, ) -> YdlResult<Vec<SubtitleTrack>>
Discover available subtitle tracks for a video
Sourcepub async fn get_video_metadata(
&self,
video_id: &str,
) -> YdlResult<VideoMetadata>
pub async fn get_video_metadata( &self, video_id: &str, ) -> YdlResult<VideoMetadata>
Get video metadata including available subtitles
Sourcepub async fn download_content(
&self,
track: &SubtitleTrack,
video_id: &str,
) -> YdlResult<String>
pub async fn download_content( &self, track: &SubtitleTrack, video_id: &str, ) -> YdlResult<String>
Download subtitle content from a track
Sourcepub fn select_best_track<'a>(
&'a self,
tracks: &'a [SubtitleTrack],
) -> Option<&'a SubtitleTrack>
pub fn select_best_track<'a>( &'a self, tracks: &'a [SubtitleTrack], ) -> Option<&'a SubtitleTrack>
Select the best subtitle track based on preferences
Auto Trait Implementations§
impl Freeze for SubtitleExtractor
impl !RefUnwindSafe for SubtitleExtractor
impl Send for SubtitleExtractor
impl Sync for SubtitleExtractor
impl Unpin for SubtitleExtractor
impl !UnwindSafe for SubtitleExtractor
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