Batch Processing API
whisper_vtt2srt.use_cases.batch.BatchConverter
Source code in whisper_vtt2srt/use_cases/batch.py
convert(input_path, output_path=None, recursive=False, encoding='utf-8')
Converts a VTT file or a directory of files to SRT.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_path
|
str
|
Path to a single |
required |
output_path
|
Optional[str]
|
Optional destination path. - If input is a file, this acts as the output filename. - If input is a directory, this acts as the output root directory. - If None, outputs are generated alongside inputs. |
None
|
recursive
|
bool
|
If True and input is a directory, processes subdirectories recursively. |
False
|
encoding
|
str
|
The encoding of the input file(s) (e.g., "utf-8", "latin-1"). Defaults to "utf-8". |
'utf-8'
|
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: A list of paths to the generated |
Raises:
| Type | Description |
|---|---|
UnicodeDecodeError
|
If a file cannot be decoded with the specified encoding. |
IOError
|
If files cannot be read or written. |