コード例 #1
0
def get_video_url(plugin,
                  item_id,
                  video_id,
                  download_mode=False,
                  **kwargs):

    return resolver_proxy.get_arte_video_stream(plugin,
                                                DESIRED_LANGUAGE.lower(),
                                                video_id,
                                                download_mode)
コード例 #2
0
def get_video_url(plugin,
                  item_id,
                  video_url,
                  video_id,
                  is_drm,
                  download_mode=False,
                  **kwargs):
    if 'youtube.com' in video_url:
        video_id = video_url.rsplit('/', 1)[1]
        return resolver_proxy.get_stream_youtube(plugin, video_id,
                                                 download_mode)

    if 'arte.tv' in video_url:
        video_id = re.compile("(?<=fr%2F)(.*)(?=&autostart)").findall(
            video_url)[0]
        return resolver_proxy.get_arte_video_stream(plugin, 'fr', video_id,
                                                    download_mode)

    if is_drm:
        if get_kodi_version() < 18:
            xbmcgui.Dialog().ok('Info', plugin.localize(30602))
            return False

        is_helper = inputstreamhelper.Helper('mpd', drm='widevine')
        if not is_helper.check_inputstream():
            return False

        token_url = URL_TOKEN % ('media_id', video_id, PARTNER_KEY)
        token_value = urlquick.get(token_url, max_age=-1)
        json_parser_token = json.loads(token_value.text)

        item = Listitem()
        item.path = video_url
        item.property[INPUTSTREAM_PROP] = 'inputstream.adaptive'
        item.property['inputstream.adaptive.manifest_type'] = 'mpd'
        item.property[
            'inputstream.adaptive.license_type'] = 'com.widevine.alpha'
        headers2 = {
            'customdata': json_parser_token["auth_encoded_xml"],
        }
        item.property[
            'inputstream.adaptive.license_key'] = URL_LICENCE_KEY % urlencode(
                headers2)
        item.property[
            'inputstream.adaptive.manifest_update_parameter'] = 'full'
        item.label = get_selected_item_label()
        item.art.update(get_selected_item_art())
        item.info.update(get_selected_item_info())
        return item

    return video_url
コード例 #3
0
            return False

    elif DESIRED_QUALITY == "BEST":
        url_selected = stream_datas['HTTPS_SQ_1']['url']
    else:
        url_selected = stream_datas['HTTPS_HQ_1']['url']

    if download_mode:
        return download.download_video(url_selected)

    return url_selected


def live_entry(plugin, item_id, **kwargs):
    return get_live_url(plugin, item_id, item_id.upper())
=======
    return resolver_proxy.get_arte_video_stream(plugin,
                                                DESIRED_LANGUAGE.lower(),
                                                video_id,
                                                download_mode)
>>>>>>> cf69920d1ba10a4558544c5d79d7c35f56d3e2c3:resources/lib/channels/wo/arte.py


@Resolver.register
def get_live_url(plugin, item_id, **kwargs):
    final_language = kwargs.get('language', DESIRED_LANGUAGE)

    resp = urlquick.get(URL_LIVE_ARTE % final_language.lower())
    json_parser = json.loads(resp.text)
    return json_parser["videoJsonPlayer"]["VSR"]["HLS_SQ_1"]["url"]