1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-23 19:55:38 +01:00

tv4play: fix login issue

This commit is contained in:
Johan Andersson 2023-10-10 00:47:56 +02:00
parent 997e12190d
commit 12ad939fe7

View File

@ -94,6 +94,11 @@ class Tv4play(Service, OpenGraphThumbMixin):
def _login(self):
if self.config.get("username") is None or self.config.get("password") is None:
return None
res = self.http.request("get", "https://auth.a2d.tv/_bm/get_params?type=web-jsto")
if res.status_code > 400:
return None
e = res.json()["e"]
res = self.http.request(
"post",
"https://avod-auth-alb.a2d.tv/oauth/authorize",
@ -102,6 +107,7 @@ class Tv4play(Service, OpenGraphThumbMixin):
"response_type": "token",
"credentials": {"username": self.config.get("username"), "password": self.config.get("password")},
},
headers={"akamai-bm-telemetry": f"a=&&&e={e}"},
)
if res.status_code > 400:
return None