load#

load(file, format=None, encoding=None)[source]#

Loads subtitles from a file.

file is preferably a pathlib.Path object, but may also be a string denoting an absolute or relative file path.

The file format, if not explicitly specified, is deduced from the file ending. The file’s text encoding can be given, but is otherwise detected automatically (which may fail in some rare cases).

Returns a Subtitles object.