pub struct CaptionsExtractor;
Expand description
§CaptionsExtractor
Extracts captions/transcript data from YouTube’s player response JSON.
This utility struct provides functionality to parse YouTube’s captions data and extract detailed information about available transcripts.
Implementations§
Source§impl CaptionsExtractor
impl CaptionsExtractor
Sourcepub fn extract_captions_data(
player_response: &Value,
video_id: &str,
) -> Result<Value, CouldNotRetrieveTranscript>
pub fn extract_captions_data( player_response: &Value, video_id: &str, ) -> Result<Value, CouldNotRetrieveTranscript>
Extracts captions data from the player response JSON.
§Parameters
player_response
- The parsed YouTube player response JSON objectvideo_id
- The YouTube video ID (used for error reporting)
§Returns
Result<serde_json::Value, CouldNotRetrieveTranscript>
- The captions JSON data or an error
§Errors
This method will return a specific error if:
- Transcripts are disabled for the video
- The captions data is missing or in an unexpected format
Auto Trait Implementations§
impl Freeze for CaptionsExtractor
impl RefUnwindSafe for CaptionsExtractor
impl Send for CaptionsExtractor
impl Sync for CaptionsExtractor
impl Unpin for CaptionsExtractor
impl UnwindSafe for CaptionsExtractor
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