Providers¶
-
class
subliminal.providers.
TimeoutSafeTransport
(timeout, *args, **kwargs)[source]¶ Timeout support for
xmlrpc.client.SafeTransport
.
-
class
subliminal.providers.
ParserBeautifulSoup
(markup, parsers, **kwargs)[source]¶ A
bs4.BeautifulSoup
that picks the first parser available in parsers.- Parameters
markup – markup for the
bs4.BeautifulSoup
.parsers (list) – parser names, in order of preference.
-
class
subliminal.providers.
Provider
[source]¶ Base class for providers.
If any configuration is possible for the provider, like credentials, it must take place during instantiation.
- Raise
ConfigurationError
if there is a configuration error
-
languages
= {}¶ Supported set of
Language
-
video_types
= (<class 'subliminal.video.Episode'>, <class 'subliminal.video.Movie'>)¶ Supported video types
-
required_hash
= None¶ Required hash, if any
-
initialize
()[source]¶ Initialize the provider.
Must be called when starting to work with the provider. This is the place for network initialization or login operations.
Note
This is called automatically when entering the with statement
-
terminate
()[source]¶ Terminate the provider.
Must be called when done with the provider. This is the place for network shutdown or logout operations.
Note
This is called automatically when exiting the with statement
-
classmethod
check
(video)[source]¶ Check if the video can be processed.
The video is considered invalid if not an instance of
video_types
or if therequired_hash
is not present inhashes
attribute of the video.
-
query
(*args, **kwargs)[source]¶ Query the provider for subtitles.
Arguments should match as much as possible the actual parameters for querying the provider
- Returns
found subtitles.
- Return type
list of
Subtitle
- Raise
-
list_subtitles
(video, languages)[source]¶ List subtitles for the video with the given languages.
This will call the
query()
method internally. The parameters passed to thequery()
method may vary depending on the amount of information available in the video.
Addic7ed¶
-
subliminal.providers.addic7ed.
series_year_re
= re.compile("^(?P<series>[ \\w\\'.:(),&!?-]+?)(?: \\((?P<year>\\d{4})\\))?$")¶ Series header parsing regex
-
class
subliminal.providers.addic7ed.
Addic7edSubtitle
(language, hearing_impaired, page_link, series, season, episode, title, year, version, download_link)[source]¶ Addic7ed Subtitle.
-
property
id
¶ Unique identifier of the subtitle
-
property
-
class
subliminal.providers.addic7ed.
Addic7edProvider
(username=None, password=None)[source]¶ Addic7ed Provider.
-
initialize
()[source]¶ Initialize the provider.
Must be called when starting to work with the provider. This is the place for network initialization or login operations.
Note
This is called automatically when entering the with statement
-
terminate
()[source]¶ Terminate the provider.
Must be called when done with the provider. This is the place for network shutdown or logout operations.
Note
This is called automatically when exiting the with statement
-
_get_show_ids
()[source]¶ Get the
dict
of show ids per series by querying the shows.php page.- Returns
show id per series, lower case and without quotes.
- Return type
-
get_show_id
(series, year=None, country_code=None)[source]¶ Get the best matching show id for series, year and country_code.
First search in the result of
_get_show_ids()
and fallback on a search with_search_show_id()
.
-
query
(series, season, year=None, country=None)[source]¶ Query the provider for subtitles.
Arguments should match as much as possible the actual parameters for querying the provider
- Returns
found subtitles.
- Return type
list of
Subtitle
- Raise
-
list_subtitles
(video, languages)[source]¶ List subtitles for the video with the given languages.
This will call the
query()
method internally. The parameters passed to thequery()
method may vary depending on the amount of information available in the video.
-
LegendasTv¶
-
subliminal.providers.legendastv.
type_map
= {'C': 'episode', 'M': 'movie', 'S': 'episode'}¶ Conversion map for types
-
subliminal.providers.legendastv.
season_re
= re.compile(' - (?P<season>\\d+)(\\xaa|a|st|nd|rd|th) (temporada|season)', re.IGNORECASE)¶ BR title season parsing regex
-
subliminal.providers.legendastv.
downloads_re
= re.compile('(?P<downloads>\\d+) downloads')¶ Downloads parsing regex
-
subliminal.providers.legendastv.
rating_re
= re.compile('nota (?P<rating>\\d+)')¶ Rating parsing regex
-
subliminal.providers.legendastv.
timestamp_re
= re.compile('(?P<day>\\d+)/(?P<month>\\d+)/(?P<year>\\d+) - (?P<hour>\\d+):(?P<minute>\\d+)')¶ Timestamp parsing regex
-
subliminal.providers.legendastv.
releases_key
= 'subliminal.providers.legendastv:releases|{archive_id}'¶ Cache key for releases
-
class
subliminal.providers.legendastv.
LegendasTVArchive
(id, name, pack, featured, link, downloads=0, rating=0, timestamp=None)[source]¶ LegendasTV Archive.
- Parameters
-
id
= None¶ Identifier
-
name
= None¶ Name
-
pack
= None¶ Pack
-
featured
= None¶ Featured
-
link
= None¶ Link
-
downloads
= None¶ Download count
-
rating
= None¶ Rating (0-10)
-
timestamp
= None¶ Timestamp
-
content
= None¶ Compressed content as
rarfile.RarFile
orzipfile.ZipFile
-
class
subliminal.providers.legendastv.
LegendasTVSubtitle
(language, type, title, year, imdb_id, season, archive, name)[source]¶ LegendasTV Subtitle.
-
property
id
¶ Unique identifier of the subtitle
-
property
-
class
subliminal.providers.legendastv.
LegendasTVProvider
(username=None, password=None)[source]¶ LegendasTV Provider.
-
initialize
()[source]¶ Initialize the provider.
Must be called when starting to work with the provider. This is the place for network initialization or login operations.
Note
This is called automatically when entering the with statement
-
terminate
()[source]¶ Terminate the provider.
Must be called when done with the provider. This is the place for network shutdown or logout operations.
Note
This is called automatically when exiting the with statement
-
get_archives
(title_id, language_code)[source]¶ Get the archive list from a given title_id and language_code.
- Parameters
- Returns
the archives.
- Return type
list of
LegendasTVArchive
-
download_archive
(archive)[source]¶ Download an archive’s
content
.- Parameters
archive (
LegendasTVArchive
) – the archive to downloadcontent
of.
-
query
(language, title, season=None, episode=None, year=None)[source]¶ Query the provider for subtitles.
Arguments should match as much as possible the actual parameters for querying the provider
- Returns
found subtitles.
- Return type
list of
Subtitle
- Raise
-
list_subtitles
(video, languages)[source]¶ List subtitles for the video with the given languages.
This will call the
query()
method internally. The parameters passed to thequery()
method may vary depending on the amount of information available in the video.
-
NapiProjekt¶
-
subliminal.providers.napiprojekt.
get_subhash
(hash)[source]¶ Get a second hash based on napiprojekt’s hash.
-
class
subliminal.providers.napiprojekt.
NapiProjektSubtitle
(language, hash)[source]¶ NapiProjekt Subtitle.
-
property
id
¶ Unique identifier of the subtitle
-
property
-
class
subliminal.providers.napiprojekt.
NapiProjektProvider
[source]¶ NapiProjekt Provider.
-
initialize
()[source]¶ Initialize the provider.
Must be called when starting to work with the provider. This is the place for network initialization or login operations.
Note
This is called automatically when entering the with statement
-
terminate
()[source]¶ Terminate the provider.
Must be called when done with the provider. This is the place for network shutdown or logout operations.
Note
This is called automatically when exiting the with statement
-
query
(language, hash)[source]¶ Query the provider for subtitles.
Arguments should match as much as possible the actual parameters for querying the provider
- Returns
found subtitles.
- Return type
list of
Subtitle
- Raise
-
list_subtitles
(video, languages)[source]¶ List subtitles for the video with the given languages.
This will call the
query()
method internally. The parameters passed to thequery()
method may vary depending on the amount of information available in the video.
-
OpenSubtitles¶
-
class
subliminal.providers.opensubtitles.
OpenSubtitlesSubtitle
(language, hearing_impaired, page_link, subtitle_id, matched_by, movie_kind, hash, movie_name, movie_release_name, movie_year, movie_imdb_id, series_season, series_episode, filename, encoding)[source]¶ OpenSubtitles Subtitle.
-
property
id
¶ Unique identifier of the subtitle
-
property
-
class
subliminal.providers.opensubtitles.
OpenSubtitlesProvider
(username=None, password=None)[source]¶ OpenSubtitles Provider.
-
initialize
()[source]¶ Initialize the provider.
Must be called when starting to work with the provider. This is the place for network initialization or login operations.
Note
This is called automatically when entering the with statement
-
terminate
()[source]¶ Terminate the provider.
Must be called when done with the provider. This is the place for network shutdown or logout operations.
Note
This is called automatically when exiting the with statement
-
query
(languages, hash=None, size=None, imdb_id=None, query=None, season=None, episode=None, tag=None)[source]¶ Query the provider for subtitles.
Arguments should match as much as possible the actual parameters for querying the provider
- Returns
found subtitles.
- Return type
list of
Subtitle
- Raise
-
list_subtitles
(video, languages)[source]¶ List subtitles for the video with the given languages.
This will call the
query()
method internally. The parameters passed to thequery()
method may vary depending on the amount of information available in the video.
-
-
exception
subliminal.providers.opensubtitles.
OpenSubtitlesError
[source]¶ Base class for non-generic
OpenSubtitlesProvider
exceptions.
Exception raised when status is ‘401 Unauthorized’.
-
exception
subliminal.providers.opensubtitles.
NoSession
[source]¶ Exception raised when status is ‘406 No session’.
-
exception
subliminal.providers.opensubtitles.
DownloadLimitReached
[source]¶ Exception raised when status is ‘407 Download limit reached’.
-
exception
subliminal.providers.opensubtitles.
InvalidImdbid
[source]¶ Exception raised when status is ‘413 Invalid ImdbID’.
-
exception
subliminal.providers.opensubtitles.
UnknownUserAgent
[source]¶ Exception raised when status is ‘414 Unknown User Agent’.
-
exception
subliminal.providers.opensubtitles.
DisabledUserAgent
[source]¶ Exception raised when status is ‘415 Disabled user agent’.
Exception raised when status is ‘503 Service Unavailable’.
Podnapisi¶
-
class
subliminal.providers.podnapisi.
PodnapisiSubtitle
(language, hearing_impaired, page_link, pid, releases, title, season=None, episode=None, year=None)[source]¶ Podnapisi Subtitle.
-
property
id
¶ Unique identifier of the subtitle
-
property
-
class
subliminal.providers.podnapisi.
PodnapisiProvider
[source]¶ Podnapisi Provider.
-
initialize
()[source]¶ Initialize the provider.
Must be called when starting to work with the provider. This is the place for network initialization or login operations.
Note
This is called automatically when entering the with statement
-
terminate
()[source]¶ Terminate the provider.
Must be called when done with the provider. This is the place for network shutdown or logout operations.
Note
This is called automatically when exiting the with statement
-
query
(language, keyword, season=None, episode=None, year=None)[source]¶ Query the provider for subtitles.
Arguments should match as much as possible the actual parameters for querying the provider
- Returns
found subtitles.
- Return type
list of
Subtitle
- Raise
-
list_subtitles
(video, languages)[source]¶ List subtitles for the video with the given languages.
This will call the
query()
method internally. The parameters passed to thequery()
method may vary depending on the amount of information available in the video.
-
Shooter¶
-
class
subliminal.providers.shooter.
ShooterSubtitle
(language, hash, download_link)[source]¶ Shooter Subtitle.
-
property
id
¶ Unique identifier of the subtitle
-
property
-
class
subliminal.providers.shooter.
ShooterProvider
[source]¶ Shooter Provider.
-
initialize
()[source]¶ Initialize the provider.
Must be called when starting to work with the provider. This is the place for network initialization or login operations.
Note
This is called automatically when entering the with statement
-
terminate
()[source]¶ Terminate the provider.
Must be called when done with the provider. This is the place for network shutdown or logout operations.
Note
This is called automatically when exiting the with statement
-
query
(language, filename, hash=None)[source]¶ Query the provider for subtitles.
Arguments should match as much as possible the actual parameters for querying the provider
- Returns
found subtitles.
- Return type
list of
Subtitle
- Raise
-
list_subtitles
(video, languages)[source]¶ List subtitles for the video with the given languages.
This will call the
query()
method internally. The parameters passed to thequery()
method may vary depending on the amount of information available in the video.
-
SubsCenter¶
-
class
subliminal.providers.subscenter.
SubsCenterSubtitle
(language, hearing_impaired, page_link, series, season, episode, title, subtitle_id, subtitle_key, downloaded, releases)[source]¶ SubsCenter Subtitle.
-
property
id
¶ Unique identifier of the subtitle
-
property
-
class
subliminal.providers.subscenter.
SubsCenterProvider
(username=None, password=None)[source]¶ SubsCenter Provider.
-
initialize
()[source]¶ Initialize the provider.
Must be called when starting to work with the provider. This is the place for network initialization or login operations.
Note
This is called automatically when entering the with statement
-
terminate
()[source]¶ Terminate the provider.
Must be called when done with the provider. This is the place for network shutdown or logout operations.
Note
This is called automatically when exiting the with statement
-
_search_url_titles
(title)[source]¶ Search the URL titles by kind for the given title.
- Parameters
title (str) – title to search for.
- Returns
the URL titles by kind.
- Return type
-
query
(title, season=None, episode=None)[source]¶ Query the provider for subtitles.
Arguments should match as much as possible the actual parameters for querying the provider
- Returns
found subtitles.
- Return type
list of
Subtitle
- Raise
-
list_subtitles
(video, languages)[source]¶ List subtitles for the video with the given languages.
This will call the
query()
method internally. The parameters passed to thequery()
method may vary depending on the amount of information available in the video.
-
TheSubDB¶
-
class
subliminal.providers.thesubdb.
TheSubDBSubtitle
(language, hash)[source]¶ TheSubDB Subtitle.
-
property
id
¶ Unique identifier of the subtitle
-
property
-
class
subliminal.providers.thesubdb.
TheSubDBProvider
[source]¶ TheSubDB Provider.
-
initialize
()[source]¶ Initialize the provider.
Must be called when starting to work with the provider. This is the place for network initialization or login operations.
Note
This is called automatically when entering the with statement
-
terminate
()[source]¶ Terminate the provider.
Must be called when done with the provider. This is the place for network shutdown or logout operations.
Note
This is called automatically when exiting the with statement
-
query
(hash)[source]¶ Query the provider for subtitles.
Arguments should match as much as possible the actual parameters for querying the provider
- Returns
found subtitles.
- Return type
list of
Subtitle
- Raise
-
list_subtitles
(video, languages)[source]¶ List subtitles for the video with the given languages.
This will call the
query()
method internally. The parameters passed to thequery()
method may vary depending on the amount of information available in the video.
-
TVsubtitles¶
-
class
subliminal.providers.tvsubtitles.
TVsubtitlesSubtitle
(language, page_link, subtitle_id, series, season, episode, year, rip, release)[source]¶ TVsubtitles Subtitle.
-
property
id
¶ Unique identifier of the subtitle
-
property
-
class
subliminal.providers.tvsubtitles.
TVsubtitlesProvider
[source]¶ TVsubtitles Provider.
-
initialize
()[source]¶ Initialize the provider.
Must be called when starting to work with the provider. This is the place for network initialization or login operations.
Note
This is called automatically when entering the with statement
-
terminate
()[source]¶ Terminate the provider.
Must be called when done with the provider. This is the place for network shutdown or logout operations.
Note
This is called automatically when exiting the with statement
-
query
(series, season, episode, year=None)[source]¶ Query the provider for subtitles.
Arguments should match as much as possible the actual parameters for querying the provider
- Returns
found subtitles.
- Return type
list of
Subtitle
- Raise
-
list_subtitles
(video, languages)[source]¶ List subtitles for the video with the given languages.
This will call the
query()
method internally. The parameters passed to thequery()
method may vary depending on the amount of information available in the video.
-