From 12ad939fe7f48517ce9c5a0e7b1c1ae3c2b24340 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Tue, 10 Oct 2023 00:47:56 +0200 Subject: [PATCH] tv4play: fix login issue --- lib/svtplay_dl/service/tv4play.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/svtplay_dl/service/tv4play.py b/lib/svtplay_dl/service/tv4play.py index c84a458..338eaa9 100644 --- a/lib/svtplay_dl/service/tv4play.py +++ b/lib/svtplay_dl/service/tv4play.py @@ -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