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 cf7812a commit e589531
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
5 changes: 3 additions & 2 deletions addon.xml
Expand Up @@ -67,8 +67,9 @@ Minden HBO Go tartalom © 2019 Copyright © 2017 Home Box Office, Inc. Minden jo
<website>https://github.com/arvvoid/plugin.video.hbogoeu</website>
<news>
v.2.0.4-beta12
- work in progress
- operators with url redirection work in progress
- fix for #5 operators with login redirect (experimental need testing, please report)
- fix for #11 Portugal (experimental need testing, please report)
- varius bug fixes

v.2.0.3-beta11
- Fixed individualization/device storing. This bug caused needles device re-registration. (You can delete old registred devices, but don't have to do so, from your Hbo Go account, leave just the last registred one, the devices this add-on register will appear as Chrome 71 on Linux in Hbo Go)
Expand Down
30 changes: 25 additions & 5 deletions hbogolib/handlereu.py
Expand Up @@ -288,7 +288,8 @@ def silentRegister(self):
try:
if jsonrsp['Data']['ErrorMessage']:
self.log("DEVICE REGISTRATION: ERROR: " + jsonrsp['Data']['ErrorMessage'])
xbmcgui.Dialog().ok(self.LB_ERROR, jsonrsp['Data']['ErrorMessage'])
if jsonrsp['Data']['ErrorMessage'] != "GET FROM HBO ERROR":
xbmcgui.Dialog().ok(self.LB_ERROR, jsonrsp['Data']['ErrorMessage'])
self.logout()
return
except:
Expand Down Expand Up @@ -325,7 +326,6 @@ def logout(self):
self.log("Loging out")
self.del_login()
self.goToken = ""
self.customerId = ""
self.GOcustomerId = ""
self.sessionId = '00000000-0000-0000-0000-000000000000'
self.loggedin_headers['GO-SessionId'] = str(self.sessionId)
Expand Down Expand Up @@ -508,6 +508,21 @@ def OAuthLogin(self, username, password):
except:
pass

try:
if self.customerId != jsonrspl['Customer']['CurrentDevice']['Id'] or self.individualization != jsonrspl['Customer']['CurrentDevice']['Individualization']:
self.log("Device ID or Individualization Mismatch Showing diferences")
self.log("Device 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")
self.logout()
return False

try:
self.sessionId = jsonrspl['SessionId']
except:
Expand Down Expand Up @@ -564,6 +579,7 @@ def login(self):
self.FavoritesGroupId = self.addon.getSetting('FavoritesGroupId')

if (self.individualization == "" or self.customerId == ""):
self.log("NO REGISTRED DEVICE - trieng silent device registration. This step is not required for all operators. Even if this fails login can be sucessfull, depends on the operator used.")
self.silentRegister()

if (self.FavoritesGroupId == ""):
Expand Down Expand Up @@ -710,9 +726,9 @@ def login(self):

try:
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.log("Device ID or Individualization Mismatch Showing diferences")
self.log("Device 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")
Expand Down Expand Up @@ -746,6 +762,10 @@ def login(self):
self.loggedin_headers['GO-Token'] = str(self.goToken)
self.loggedin_headers['GO-CustomerId'] = str(self.GOcustomerId)
# save the session with validity of n hours to not relogin every run of the add-on

login_hash = hashlib.sha224(self.individualization + self.customerId + self.FavoritesGroupId + username + password + self.op_id).hexdigest()
self.log("LOGIN HASH: " + login_hash)

saved_session = {

"hash": login_hash,
Expand Down

0 comments on commit e589531

Please sign in to comment.