Reference for youtube_dl_scraper/core/video.py
¶
youtube_dl_scraper.core.video.Video
¶
Data class representing a video with streams and captions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
video_data
|
dict
|
A dictionary containing video metadata such as ID, title, etc. |
required |
download_path
|
str
|
The directory path where the video and its streams will be saved. |
required |
Source code in youtube_dl_scraper/core/video.py
captions
property
¶
Property that retrieves the captions for the video.
Returns:
Name | Type | Description |
---|---|---|
CaptionArray |
CaptionArray
|
The captions for the video. |
Raises:
Type | Description |
---|---|
NotImplementedError
|
If captions are not available. |
streams
property
¶
Property that retrieves the streams for the video.
Returns:
Name | Type | Description |
---|---|---|
StreamArray |
StreamArray
|
The parsed video and audio streams. |
Raises:
Type | Description |
---|---|
KeyError
|
If the "streams" key is missing in the raw video data. |
parse_streams
¶
Parse video and audio streams from the given stream data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
streams
|
dict
|
A dictionary containing stream data with keys 'video' and 'audio'. |
required |
Returns:
Name | Type | Description |
---|---|---|
StreamArray |
StreamArray
|
An object containing parsed video and audio streams. |