5.2.7. ytpb.info¶
Basic information about videos.
- class ytpb.info.BroadcastStatus(value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
StrEnumRepresents a live broadcast status.
- ACTIVE = 'active'¶
A broadcast is live.
- UPCOMING = 'upcoming'¶
A broadcast has been scheduled but started.
- COMPLETED = 'completed'¶
A broadcast has been completed.
- NONE = 'none'¶
A video is not a live broadcast.
- class ytpb.info.YouTubeVideoInfo(url: str, title: str, author: str, status: BroadcastStatus, dash_manifest_url: str | None = None)¶
Bases:
objectRepresents information about a video.
- status: BroadcastStatus¶
Video’ broadcast status.
- ytpb.info.LEFT_NOT_FETCHED = <ytpb.info.LeftNotFetched object>¶
A sentinel object for a value that is intentionally not fetched.
- ytpb.info.extract_video_info(url: str, index_page_text: str) YouTubeVideoInfo¶
Extracts an information about a video from an index page.
- Parameters:
url – A video URL.
index_page_text – An index page string content.
- Returns:
A
YouTubeVideoInfofilled with extracted attributes.- Raises:
InfoExtractError – If failed to extract an attribute.