Subtitle¶
-
class
subliminal.subtitle.
Subtitle
(language, hearing_impaired=False, page_link=None)[source]¶ Base class for subtitle.
Parameters: -
provider_name
= u''¶ Name of the provider that returns that class of subtitle
-
language
= None¶ Language of the subtitle
-
hearing_impaired
= None¶ Whether or not the subtitle is hearing impaired
-
page_link
= None¶ URL of the web page from which the subtitle can be downloaded
-
content
= None¶ Content as bytes
-
id
¶ Unique identifier of the subtitle.
-
text
¶ Content as string.
If
encoding
is None, the encoding is guessed withguess_encoding()
-
is_valid
()[source]¶ Check if a
text
is a valid SubRip format.Returns: whether or not the subtitle is valid. Return type: bool
-
-
subliminal.subtitle.
compute_score
(matches, video, scores=None)[source]¶ Compute the score of the matches against the video.
Some matches count as much as a combination of others in order to level the final score:
- hash removes everything else
- For
Episode
- imdb_id removes series, tvdb_id, season, episode, title and year
- tvdb_id removes series and year
- title removes season and episode
Parameters: Returns: score of the subtitle.
Return type:
-
subliminal.subtitle.
get_subtitle_path
(video_path, language=None, extension=u'.srt')[source]¶ Get the subtitle path using the video_path and language.
Parameters: Returns: path of the subtitle.
Return type:
-
subliminal.subtitle.
guess_matches
(video, guess, partial=False)[source]¶ Get matches between a video and a guess.
If a guess is partial, the absence information won’t be counted as a match.
Parameters: Returns: matches between the video and the guess.
Return type: