Skip to content

Commit

Permalink
Improved Login
Browse files Browse the repository at this point in the history
  • Loading branch information
bbsan2k committed May 13, 2021
1 parent ec940e2 commit 3dbb7d0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions resources/lib/pyf1tv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
import time
import requests

class F1TVError(Exception):
pass

class F1TVLoginError(F1TVError):
pass

class PYF1TV:
"""API Adapter for F1TV"""
Expand Down Expand Up @@ -71,6 +76,8 @@ def _login(self, username, password):
json=data,
)
# return the ascendontoken
if auth_data.status_code != 200:
raise F1TVLoginError()
self.ascendontoken = auth_data.json()["data"]["subscriptionToken"]
self.auth_data = {
"time": int(time.time()),
Expand Down

0 comments on commit 3dbb7d0

Please sign in to comment.