# from Crypto.Hash import HMAC, SHA256
from Crypto.Util import Padding
import xml.etree.ElementTree as ET
-from lib import log
+from common import log
+from common import ADDONUSERDATA
pp = pprint.PrettyPrinter(indent=4)
handshake_performed = False # Is a handshake already performed and the keys loaded
last_drm_context = ''
last_playback_context = ''
- esn = "NFCDCH-LX-CQE0NU6PA5714R25VPLXVU2A193T36"
+ #esn = "NFCDCH-LX-CQE0NU6PA5714R25VPLXVU2A193T36"
+ esn = "WWW-BROWSE-D7GW1G4NPXGR1F0X1H3EQGY3V1F5WE"
current_message_id = 0
session = requests.session()
rndm = random.SystemRandom()
"""
self.email = email
self.password = password
+ try:
+ os.mkdir(ADDONUSERDATA)
+ except OSError:
+ pass
if self.file_exists('msl_data.json'):
self.__load_msl_data()
def __tranform_to_dash(self, manifest):
- self.save_file('/home/johannes/manifest.json', json.dumps(manifest))
+ self.save_file('manifest.json', json.dumps(manifest))
manifest = manifest['result']['viewables'][0]
self.last_playback_context = manifest['playbackContextId']
rep = ET.SubElement(video_adaption_set, 'Representation',
width=str(downloadable['width']),
height=str(downloadable['height']),
- bitrate=str(downloadable['bitrate']*8*1024),
+ bandwidth=str(downloadable['bitrate']*8*1024),
+ codecs='h264',
mimeType='video/mp4')
#BaseURL
for downloadable in audio_track['downloadables']:
rep = ET.SubElement(audio_adaption_set, 'Representation',
codecs='aac',
- bitrate=str(downloadable['bitrate'] * 8 * 1024),
+ bandwidth=str(downloadable['bitrate'] * 8 * 1024),
mimeType='audio/mp4')
#AudioChannel Config
:param filename: The filename
:return: True if so
"""
- return os.path.isfile(filename)
+ return os.path.isfile(ADDONUSERDATA + filename)
@staticmethod
def save_file(filename, content):
:param filename: The filename
:param content: The content of the file
"""
- with open(filename, 'w') as file_:
+ with open(ADDONUSERDATA + filename, 'w') as file_:
file_.write(content)
file_.flush()
:param filename: The file to load
:return: The content of the file
"""
- with open(filename) as file_:
+ with open(ADDONUSERDATA + filename) as file_:
file_content = file_.read()
return file_content