X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=resources%2Flib%2FMSL.py;h=83a06ee37b5fc0e19d625a4a50d8c61e8c4787be;hb=f2154ed9821a052d1c145f7bdf219f4d9386af81;hp=7f813d470b33acda3ea7c102751a9f4af4c44cde;hpb=da6c6467a3bbea8f796851b047df9c8f02399426;p=plugin.video.netflix.git diff --git a/resources/lib/MSL.py b/resources/lib/MSL.py index 7f813d4..83a06ee 100644 --- a/resources/lib/MSL.py +++ b/resources/lib/MSL.py @@ -1,3 +1,8 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Module: MSL +# Created on: 26.01.2017 + import base64 import gzip import json @@ -46,13 +51,11 @@ class MSL: '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 """ - self.email = email - self.password = password self.kodi_helper = kodi_helper try: os.mkdir(self.kodi_helper.msl_data_path) @@ -149,8 +152,6 @@ class MSL: # Audio 'heaac-2-dash', - 'ddplus-2.0-dash', - 'ddplus-5.1-dash', 'dfxp-ls-sdh', 'simplesdh', 'nflx-cmisc', @@ -173,6 +174,12 @@ class MSL: 'clientVersion': '4.0004.899.011', 'uiVersion': 'akira' } + + # Check if dolby sound is enabled and add to profles + if self.kodi_helper.get_dolby_setting(): + manifest_request_data['profiles'].append('ddplus-2.0-dash') + manifest_request_data['profiles'].append('ddplus-5.1-dash') + request_data = self.__generate_msl_request_data(manifest_request_data) resp = self.session.post(self.endpoints['manifest'], request_data) @@ -459,12 +466,13 @@ class MSL: 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': { - 'email': self.email, - 'password': self.password + 'email': account['email'], + 'password': account['password'] } }