X-Git-Url: http://git.code-monkey.de/?p=plugin.video.netflix.git;a=blobdiff_plain;f=resources%2Flib%2FKodiHelper.py;h=7e1811339ed923cedf094679763af94a451571a9;hp=6ffe6104bd0f235a3fae7d65fcf89d21d3f73b89;hb=ff2b5ac70453c86580956b4e0f6b16bb514c9566;hpb=6f5adf6901bd63668d8b069d9064b72c26fb1b6c diff --git a/resources/lib/KodiHelper.py b/resources/lib/KodiHelper.py index 6ffe610..7e18113 100644 --- a/resources/lib/KodiHelper.py +++ b/resources/lib/KodiHelper.py @@ -13,6 +13,7 @@ from os.path import join, isfile from urllib import urlencode from xbmcaddon import Addon from uuid import uuid4 +from utils import get_user_agent_for_current_platform from UniversalAnalytics import Tracker try: import cPickle as pickle @@ -196,14 +197,16 @@ class KodiHelper: """ Returns the esn from settings """ + self.log(msg='Is FILE: ' + str(isfile(self.msl_data_path + 'msl_data.json'))) + self.log(msg=self.get_addon().getSetting('esn')) return self.get_addon().getSetting('esn') def set_esn(self, esn): """ Returns the esn from settings """ - stored_esn = self.get_esn() - if not stored_esn: + stored_esn = self.get_esn() + if not stored_esn and esn: self.set_setting('esn', esn) self.delete_manifest_data() return esn @@ -215,6 +218,7 @@ class KodiHelper: if isfile(self.msl_data_path + 'manifest.json'): remove(self.msl_data_path + 'manifest.json') msl = MSL(kodi_helper=self) + msl.perform_key_handshake() msl.save_msl_data() def get_dolby_setting(self): @@ -671,6 +675,7 @@ class KodiHelper: bool List could be build """ + self.set_esn(esn) addon = self.get_addon() inputstream_addon = self.get_inputstream_addon() if inputstream_addon == None: @@ -689,6 +694,9 @@ class KodiHelper: # inputstream addon properties msl_service_url = 'http://localhost:' + str(addon.getSetting('msl_service_port')) play_item = xbmcgui.ListItem(path=msl_service_url + '/manifest?id=' + video_id) + play_item.setContentLookup(False) + play_item.setMimeType('application/dash+xml') + play_item.setProperty(inputstream_addon + '.stream_headers', 'user-agent=' + get_user_agent_for_current_platform()) play_item.setProperty(inputstream_addon + '.license_type', 'com.widevine.alpha') play_item.setProperty(inputstream_addon + '.manifest_type', 'mpd') play_item.setProperty(inputstream_addon + '.license_key', msl_service_url + '/license?id=' + video_id + '||b{SSM}!b{SID}|') @@ -771,7 +779,9 @@ class KodiHelper: if 'mpaa' in entry_keys: infos.update({'mpaa': entry['mpaa']}) else: - infos.update({'mpaa': str(entry['maturity']['board']) + '-' + str(entry['maturity']['value'])}) + if entry.get('maturity', None) is not None: + if entry['maturity']['board'] is not None and entry['maturity']['value'] is not None: + infos.update({'mpaa': str(entry['maturity']['board'].encode('utf-8')) + '-' + str(entry['maturity']['value'].encode('utf-8'))}) if 'rating' in entry_keys: infos.update({'rating': int(entry['rating']) * 2}) if 'synopsis' in entry_keys: