# Path: resources/lib/compat.py



import re
import sys
import zlib
import json
import time
import base64
import random
import uuid
import requests
import xml.etree.ElementTree as ET
import xbmcaddon
import subprocess
    from io import StringIO
    from StringIO import StringIO
from datetime import datetime
from resources.lib.compat import string_encoding
  from resources.lib.MSLMediaDrm import MSLMediaDrmCrypto as MSLHandler
  from resources.lib.MSLCrypto import MSLCrypto as MSLHandler
# -*- coding: utf-8 -*-
# Author: trummerjo
# Module: MSLHttpRequestHandler
# Created on: 26.01.2017
# License: MIT https://goo.gl/5bMj3H


try:
except ImportError:



#check if we are on Android
try:
    sdkversion = int(subprocess.check_output(
        ['/system/bin/getprop', 'ro.build.version.sdk']))
except:
    sdkversion = 0

if sdkversion >= 18:
else:

class MSL(object):
    # Is a handshake already performed and the keys loaded
    handshake_performed = False
    last_license_url = ''
    last_drm_context = ''
    last_playback_context = ''

    current_message_id = 0

# Path: resources/lib/compat.py



# Path: resources/lib/MSLv2.py
import re
import sys
import zlib
import json
import time
import base64
import random
import uuid
import requests
import xml.etree.ElementTree as ET
import xbmcaddon
import subprocess
    from io import StringIO
    from StringIO import StringIO
from datetime import datetime
from resources.lib.compat import string_encoding
  from resources.lib.MSLMediaDrm import MSLMediaDrmCrypto as MSLHandler
  from resources.lib.MSLCrypto import MSLCrypto as MSLHandler

# -*- coding: utf-8 -*-
# Author: trummerjo
# Module: MSLHttpRequestHandler
# Created on: 26.01.2017
# License: MIT https://goo.gl/5bMj3H


try:
except ImportError:



#check if we are on Android
try:
    sdkversion = int(subprocess.check_output(
        ['/system/bin/getprop', 'ro.build.version.sdk']))
except:
    sdkversion = 0

if sdkversion >= 18:
else:

class MSL(object):
    # Is a handshake already performed and the keys loaded
    handshake_performed = False
    last_license_url = ''
    last_drm_context = ''
    last_playback_context = ''

    current_message_id = 0

    session = requests.session()