1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

dplay: dont crash when we have wrong cookie

This commit is contained in:
Johan Andersson 2020-12-05 16:44:10 +01:00
parent 47aeb1b907
commit 53eddea15e

View File

@ -173,6 +173,8 @@ class Dplay(Service):
def _login(self):
res = self.http.get("https://disco-api.{}/users/me".format(self.domain), headers={"authority": "disco-api.{}".format(self.domain)})
if res.status_code >= 400:
return False
if not res.json()["data"]["attributes"]["anonymous"]:
return True
return False