Source
ytb_downloader.file_loader
Load information from csv file for bulk downloading and converting.
- columns_validation(columns: Sequence[str]) Optional[List[str]] [source]
Validate columns of dataframe read from csv file.
To make sure the requisite column url exists, and find out existed optional columns, such as “format”, “time_start”, “time_end”, “bitrate”.
ytb_downloader.file_name_collector
Extracting downloaded files’ names.
ytb_downloader.downloader
This module contains functions for downloading videos from youtube.
ytb_downloader.converter
This module contains functions for converting the downloaded youtube video file to the given format.
- convert_to(downloaded_file: str, media_format: Media = Media.AUDIO, conversion_format: str = 'mp3', t_start: int = 0, t_end: Optional[int] = None, fps: int = 44100, bitrate: str = '3000k') Optional[str] [source]
Convert the downloaded youtube video file to the given format.
- Parameters
downloaded_file (
str
) – path to the download youtube video file.media_format (
Media
) – the original file’s format.conversion_format (
str
) – format of the output file, mp3, avi etc.t_start (
int
) – starting point for cutting the video.t_end (
int
, optional) – ending point for cutting the video, if not provided, the whole video will be converted.fps (
int
) – Frames per second. It will default to 44100.bitrate (
str
) – Audio bitrate, given as a string like ‘50k’, ‘500k’, ‘3000k’. Will determine the size and quality of the output file. Note that it mainly an indicative goal, the bitrate won’t necessarily be the this in the output file.
- Returns
the converted file path, if conversion succeed, otherwise None.
- Return type