mirror of
https://github.com/morpheus65535/bazarr
synced 2025-02-22 05:51:10 +00:00
Fixed Ktuvit provider login
This commit is contained in:
parent
35cb757df8
commit
b137af0908
1 changed files with 13 additions and 8 deletions
|
@ -51,6 +51,11 @@ class KtuvitSubtitle(Subtitle):
|
|||
self.subtitle_id = subtitle_id
|
||||
self.release = release
|
||||
|
||||
def __repr__(self):
|
||||
return '<%s [%s] %r [%s:%s]>' % (
|
||||
self.__class__.__name__, self.subtitle_id, self.page_link, self.language, self._guessed_encoding)
|
||||
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
return str(self.subtitle_id)
|
||||
|
@ -160,13 +165,13 @@ class KtuvitProvider(Provider):
|
|||
else:
|
||||
AuthenticationError("Incomplete JSON returned while authenticating to the provider.")
|
||||
|
||||
logger.debug("Logged in")
|
||||
self.loginCookie = (
|
||||
r.headers["set-cookie"][1].split(";")[0].replace("Login=", "")
|
||||
)
|
||||
|
||||
self.session.headers["Accept"]="application/json, text/javascript, */*; q=0.01"
|
||||
self.session.headers["Cookie"]="Login=" + self.loginCookie
|
||||
cookieSplit = r.headers["set-cookie"].split("Login=")
|
||||
if len(cookieSplit) != 2:
|
||||
self.logged_in = False
|
||||
AuthenticationError("Login Failed, didn't receive valid cookie in response")
|
||||
|
||||
self.loginCookie = cookieSplit[1].split(";")[0]
|
||||
logger.debug("Logged in with cookie: " + self.loginCookie)
|
||||
|
||||
self.logged_in = True
|
||||
|
||||
|
@ -449,4 +454,4 @@ class KtuvitProvider(Provider):
|
|||
)
|
||||
return
|
||||
|
||||
subtitle.content = fix_line_ending(r.content)
|
||||
subtitle.content = fix_line_ending(r.content)
|
||||
|
|
Loading…
Reference in a new issue