pub struct MicroformatExtractor;
Expand description
§MicroformatExtractor
Extracts microformat information from YouTube’s player response data.
The microformat data contains additional metadata about the video that is not included in the main video details, such as available countries, category, and embed information.
Implementations§
Source§impl MicroformatExtractor
impl MicroformatExtractor
Sourcepub fn extract_microformat_data(
player_response: &Value,
video_id: &str,
) -> Result<MicroformatData, CouldNotRetrieveTranscript>
pub fn extract_microformat_data( player_response: &Value, video_id: &str, ) -> Result<MicroformatData, CouldNotRetrieveTranscript>
Extracts microformat 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<MicroformatData, CouldNotRetrieveTranscript>
- The parsed microformat data or an error
§Errors
This method will return an error if:
- The microformat data is missing from the player response
- The JSON structure does not match the expected format
Auto Trait Implementations§
impl Freeze for MicroformatExtractor
impl RefUnwindSafe for MicroformatExtractor
impl Send for MicroformatExtractor
impl Sync for MicroformatExtractor
impl Unpin for MicroformatExtractor
impl UnwindSafe for MicroformatExtractor
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