Example #1
0
def plugin_process_playdata(playdata):
    CDMHEADERS = {}

    if check_key(playdata, 'license') and check_key(
            playdata['license'], 'drmConfig') and check_key(
                playdata['license']['drmConfig'], 'widevine'):
        if 'nlznl.solocoo.tv' in playdata['license']['drmConfig']['widevine'][
                'drmServerUrl']:
            if xbmc.Monitor().waitForAbort(1):
                return False

        if check_key(playdata['license']['drmConfig']['widevine'],
                     'customHeaders'):
            for row in playdata['license']['drmConfig']['widevine'][
                    'customHeaders']:
                CDMHEADERS[row] = playdata['license']['drmConfig']['widevine'][
                    'customHeaders'][row]

        item_inputstream = inputstream.Widevine(
            license_key=playdata['license']['drmConfig']['widevine']
            ['drmServerUrl'], )
    else:
        item_inputstream = inputstream.MPD()

    return item_inputstream, CDMHEADERS
Example #2
0
def plugin_process_playdata(playdata):
    creds = get_credentials()
    profile_settings = load_profile(profile_id=1)

    CDMHEADERS = {
        'User-Agent': DEFAULT_USER_AGENT,
        'X-Client-Id': CONST_DEFAULT_CLIENTID + '||' + DEFAULT_USER_AGENT,
        'X-OESP-Token': profile_settings['access_token'],
        'X-OESP-Username': creds['username'],
        'X-OESP-License-Token': profile_settings['drm_token'],
        'X-OESP-DRM-SchemeIdUri': 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed',
        'X-OESP-Content-Locator': playdata['locator'],
    }

    params = []

    try:
        params.append(('_', 'renew_token'))
        params.append(('path', str(playdata['path']).encode('utf-8')))
        params.append(('locator', str(playdata['locator']).encode('utf-8')))
    except:
        params.append(('_', 'renew_token'))
        params.append(('path', playdata['path']))
        params.append(('locator', playdata['locator']))

    item_inputstream = inputstream.Widevine(
        license_key = playdata['license'],
        media_renewal_url = 'plugin://{0}/?{1}'.format(ADDON_ID, urlencode(encode_obj(params))),
        media_renewal_time = 60,
    )

    return item_inputstream, CDMHEADERS
Example #3
0
def plugin_process_playdata(playdata):
    profile_settings = load_profile(profile_id=1)

    CDMHEADERS = {
        'User-Agent': DEFAULT_USER_AGENT,
        'X_CSRFToken': profile_settings['csrf_token'],
        'Cookie': playdata['license']['cookie'],
    }

    if check_key(playdata, 'license') and check_key(
            playdata['license'], 'triggers') and check_key(
                playdata['license']['triggers'][0], 'licenseURL'):
        item_inputstream = inputstream.Widevine(
            license_key=playdata['license']['triggers'][0]['licenseURL'],
            #manifest_update_parameter = 'update',
        )

        if check_key(playdata['license']['triggers'][0], 'customData'):
            CDMHEADERS['AcquireLicense.CustomData'] = playdata['license'][
                'triggers'][0]['customData']
            CDMHEADERS['CADeviceType'] = 'Widevine OTT client'
    else:
        item_inputstream = inputstream.MPD(
            #manifest_update_parameter = 'update',
        )

    return item_inputstream, CDMHEADERS
Example #4
0
def plugin_process_playdata(playdata):
    CDMHEADERS = CONST_BASE_HEADERS
    CDMHEADERS['User-Agent'] = DEFAULT_USER_AGENT

    if check_key(playdata, 'license'):
        item_inputstream = inputstream.Widevine(
            license_key=playdata['license'], )
    else:
        item_inputstream = inputstream.MPD()

    return item_inputstream, CDMHEADERS
Example #5
0
def plugin_process_playdata(playdata):
    profile_settings = load_profile(profile_id=1)

    CDMHEADERS = {
        'User-Agent': DEFAULT_USER_AGENT,
    }

    if check_key(playdata, 'license') and len(
            str(profile_settings['ticket_id'])) == 0:
        CDMHEADERS['Authorization'] = 'Bearer ' + profile_settings['token']

        item_inputstream = inputstream.Widevine(
            license_key=playdata['license'], )
    elif check_key(playdata, 'license') and check_key(
            playdata['license'], 'widevine') and check_key(
                playdata['license']['widevine'], 'license'):
        item_inputstream = inputstream.Widevine(
            license_key=playdata['license']['widevine']['license'], )
    else:
        item_inputstream = inputstream.MPD()

    return item_inputstream, CDMHEADERS
Example #6
0
def plugin_process_playdata(playdata):
    profile_settings = load_profile(profile_id=1)

    CDMHEADERS = {
        'User-Agent': DEFAULT_USER_AGENT,
    }

    if check_key(playdata, 'license') and check_key(playdata['license'], 'widevine') and check_key(playdata['license']['widevine'], 'license'):
        item_inputstream = inputstream.Widevine(
            license_key = playdata['license']['widevine']['license'],
        )
    else:
        item_inputstream = inputstream.MPD()

    return item_inputstream, CDMHEADERS