Skip to main content

parse

Function parse 

Source
pub fn parse(raw: &str, fetched_at: DateTime<Utc>) -> Result<VideoMetadata>
Expand description

Project a raw WEB /player response into a VideoMetadata.

fetched_at is supplied by the caller (the fetch timestamp) rather than read from a clock here, keeping the projection a pure, unit-testable function. Tolerant of an absent microformat block: the sidecar is then written from videoDetails alone (microformat-only fields stay None). Fails with TranscriptError::ParseError only if videoDetails itself is missing (a removed/blocked video the WEB client won’t describe).