Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

Commit

Permalink
work in progress on #5, work in progress #11
Browse files Browse the repository at this point in the history
  • Loading branch information
arvvoid committed Feb 24, 2019
1 parent 6ad5836 commit cf7812a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
27 changes: 21 additions & 6 deletions hbogolib/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,31 @@ def setDispCat(self, cur_loc):
xbmcplugin.setPluginCategory(self.handle, cur_loc)

def send_login_hbogo(self, url, headers, data):
r = requests.post(url, headers=headers, data=data)
return r.json()
try:
r = requests.post(url, headers=headers, data=data)
return r.json()
except:
self.log("SEND LOGIN ERROR")
resp = {"Data": {"ErrorMessage": "SEND LOGIN ERROR"}, "ErrorMessage": "SEND LOGIN ERROR"}
return resp

def get_from_hbogo(self, url):
r = requests.get(url, headers=self.loggedin_headers)
return r.json()
try:
r = requests.get(url, headers=self.loggedin_headers)
return r.json()
except:
self.log("GET FROM HBO ERROR")
resp = {"Data": {"ErrorMessage": "GET FROM HBO ERROR"}, "ErrorMessage": "GET FROM HBO ERROR"}
return resp

def send_purchase_hbogo(self, url, purchase_payload, purchase_headers):
r = requests.post(url, headers=purchase_headers, data=purchase_payload)
return r.json()
try:
r = requests.post(url, headers=purchase_headers, data=purchase_payload)
return r.json()
except:
self.log("SEND HBO PURCHASE ERROR")
resp = {"Data": {"ErrorMessage": "SEND HBO PURCHASE ERROR"}, "ErrorMessage": "SEND HBO PURCHASE ERROR"}
return resp

def del_login(self):
try:
Expand Down
9 changes: 7 additions & 2 deletions hbogolib/handlereu.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,13 @@ def login(self):
pass

try:
self.customerId = jsonrspl['Customer']['CurrentDevice']['Id']
self.individualization = jsonrspl['Customer']['CurrentDevice']['Individualization']
if self.customerId != jsonrspl['Customer']['CurrentDevice']['Id'] or self.individualization != jsonrspl['Customer']['CurrentDevice']['Individualization']:
self.log("Customer ID or Individualization Mismatch Showing diferences")
self.log("Customer ID: " + self.customerId + ":" + jsonrspl['Customer']['CurrentDevice']['Id'])
self.log("Individualization: " + self.individualization + ":" + jsonrspl['Customer']['CurrentDevice']['Individualization'])
self.storeIndiv(jsonrspl['Customer']['CurrentDevice']['Individualization'], jsonrspl['Customer']['CurrentDevice']['Id'])
else:
self.log("Customer ID and Individualization Match")
except:
self.log("LOGIN: INDIVIDUALIZATION ERROR")
xbmcgui.Dialog().ok(self.LB_LOGIN_ERROR, "LOGIN: INDIVIDUALIZATION ERROR")
Expand Down

0 comments on commit cf7812a

Please sign in to comment.