mirror of https://github.com/morpheus65535/bazarr
opensubtitles - add get_fps function
- added get_fps() function - getting of the authentication token from the cache is fixed
This commit is contained in:
parent
76ec6109df
commit
a37ef4a418
|
@ -44,6 +44,12 @@ class OpenSubtitlesSubtitle(_OpenSubtitlesSubtitle):
|
||||||
self.wrong_fps = False
|
self.wrong_fps = False
|
||||||
self.skip_wrong_fps = skip_wrong_fps
|
self.skip_wrong_fps = skip_wrong_fps
|
||||||
|
|
||||||
|
def get_fps(self):
|
||||||
|
try:
|
||||||
|
return float(self.fps)
|
||||||
|
except:
|
||||||
|
return None
|
||||||
|
|
||||||
def get_matches(self, video, hearing_impaired=False):
|
def get_matches(self, video, hearing_impaired=False):
|
||||||
matches = super(OpenSubtitlesSubtitle, self).get_matches(video)
|
matches = super(OpenSubtitlesSubtitle, self).get_matches(video)
|
||||||
|
|
||||||
|
@ -175,9 +181,10 @@ class OpenSubtitlesProvider(ProviderRetryMixin, _OpenSubtitlesProvider):
|
||||||
|
|
||||||
logger.info('Logging in')
|
logger.info('Logging in')
|
||||||
|
|
||||||
token = str(region.get("os_token"))
|
token_cache = region.get("os_token")
|
||||||
if token is not NO_VALUE:
|
if token_cache is not NO_VALUE:
|
||||||
try:
|
try:
|
||||||
|
token = token_cache.decode("utf-8")
|
||||||
logger.debug('Trying previous token: %r', token[:10]+"X"*(len(token)-10))
|
logger.debug('Trying previous token: %r', token[:10]+"X"*(len(token)-10))
|
||||||
checked(lambda: self.server.NoOperation(token))
|
checked(lambda: self.server.NoOperation(token))
|
||||||
self.token = token
|
self.token = token
|
||||||
|
|
Loading…
Reference in New Issue