mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-09 08:17:42 +08:00
core: update to subliminal_patch:head; subscene: move login/cookies to initialization sequence
This commit is contained in:
parent
b100d4ed5c
commit
702038c191
3 changed files with 11 additions and 9 deletions
|
@ -139,6 +139,15 @@ class SubsceneProvider(Provider, ProviderSubtitleArchiveMixin):
|
|||
logger.info("Creating session")
|
||||
self.session = RetryingCFSession()
|
||||
|
||||
prev_cookies = region.get("subscene_cookies2")
|
||||
if prev_cookies != NO_VALUE:
|
||||
logger.debug("Re-using old subscene cookies: %r", prev_cookies)
|
||||
self.session.cookies.update(prev_cookies)
|
||||
|
||||
else:
|
||||
logger.debug("Logging in")
|
||||
self.login()
|
||||
|
||||
def login(self):
|
||||
r = self.session.get("https://subscene.com/account/login")
|
||||
if "Server Error" in r.content:
|
||||
|
@ -277,14 +286,6 @@ class SubsceneProvider(Provider, ProviderSubtitleArchiveMixin):
|
|||
# logger.debug('No release results found')
|
||||
|
||||
# time.sleep(self.search_throttle)
|
||||
prev_cookies = region.get("subscene_cookies2")
|
||||
if prev_cookies != NO_VALUE:
|
||||
logger.debug("Re-using old subscene cookies: %r", prev_cookies)
|
||||
self.session.cookies.update(prev_cookies)
|
||||
|
||||
else:
|
||||
logger.debug("Logging in")
|
||||
self.login()
|
||||
|
||||
# re-search for episodes without explicit release name
|
||||
if isinstance(video, Episode):
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -36,6 +36,7 @@ SZ_FIX_DATA = {
|
|||
u" l ": u" I ",
|
||||
u"'sjust": u"'s just",
|
||||
u"'tjust": u"'t just",
|
||||
u"\";": u"'s",
|
||||
},
|
||||
"WholeWords": {
|
||||
u"I'11": u"I'll",
|
||||
|
|
Loading…
Reference in a new issue