fix(mslLogin): Restart for credentials in MSL not longer necessary
authorJohannes Trum <johannes@die-trums.de>
Sat, 4 Mar 2017 13:54:45 +0000 (14:54 +0100)
committerJohannes Trum <johannes@die-trums.de>
Sat, 4 Mar 2017 13:54:45 +0000 (14:54 +0100)
resources/lib/MSL.py
resources/lib/MSLHttpRequestHandler.py

index 7f813d470b33acda3ea7c102751a9f4af4c44cde..e2e7248f2da085dece0ff614d79f4358515f70c9 100644 (file)
@@ -46,13 +46,11 @@ class MSL:
         'license': 'http://www.netflix.com/api/msl/NFCDCH-LX/cadmium/license'
     }
 
         'license': 'http://www.netflix.com/api/msl/NFCDCH-LX/cadmium/license'
     }
 
-    def __init__(self, email, password, kodi_helper):
+    def __init__(self, kodi_helper):
         """
         The Constructor checks for already existing crypto Keys.
         If they exist it will load the existing keys
         """
         """
         The Constructor checks for already existing crypto Keys.
         If they exist it will load the existing keys
         """
-        self.email = email
-        self.password = password
         self.kodi_helper = kodi_helper
         try:
             os.mkdir(self.kodi_helper.msl_data_path)
         self.kodi_helper = kodi_helper
         try:
             os.mkdir(self.kodi_helper.msl_data_path)
@@ -459,12 +457,13 @@ class MSL:
             if 'usertoken' in self.tokens:
                 pass
             else:
             if 'usertoken' in self.tokens:
                 pass
             else:
+                account = self.kodi_helper.get_credentials()
                 # Auth via email and password
                 header_data['userauthdata'] = {
                     'scheme': 'EMAIL_PASSWORD',
                     'authdata': {
                 # Auth via email and password
                 header_data['userauthdata'] = {
                     'scheme': 'EMAIL_PASSWORD',
                     'authdata': {
-                        'email': self.email,
-                        'password': self.password
+                        'email': account['email'],
+                        'password': account['password']
                     }
                 }
 
                     }
                 }
 
index e7682fca24eea89642b930361417867780539230..037d8c4a616b48a1996721abf3beafe92401da60 100644 (file)
@@ -1,7 +1,6 @@
 import BaseHTTPServer
 import base64
 from urlparse import urlparse, parse_qs
 import BaseHTTPServer
 import base64
 from urlparse import urlparse, parse_qs
-import xbmcaddon
 from MSL import MSL
 from KodiHelper import KodiHelper
 
 from MSL import MSL
 from KodiHelper import KodiHelper
 
@@ -10,8 +9,7 @@ kodi_helper = KodiHelper(
     base_url=None
 )
 
     base_url=None
 )
 
-account = kodi_helper.get_credentials()
-msl = MSL(account['email'], account['password'], kodi_helper)
+msl = MSL(kodi_helper)
 
 class MSLHttpRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
 
 
 class MSLHttpRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
 
@@ -51,3 +49,12 @@ class MSLHttpRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
             self.send_header('Content-type', 'application/xml')
             self.end_headers()
             self.wfile.write(data)
             self.send_header('Content-type', 'application/xml')
             self.end_headers()
             self.wfile.write(data)
+
+    def log_message(self, format, *args):
+        """
+        Disable the BaseHTTPServer Log
+        :param format:
+        :param args:
+        :return: None
+        """
+        return