Пример #1
0
def get_live_url(plugin, item_id, **kwargs):

    resp = urlquick.get(URL_LIVE % item_id,
                        headers={'User-Agent': web_utils.get_random_ua()},
                        max_age=-1)

    if item_id == 'rmcstory':
        root = resp.parse()
        live_datas = root.find(".//div[@class='next-player player_2t_e9']")

        data_account = live_datas.get('data-account')
        data_video_id = live_datas.get('data-video-id')
        data_player = live_datas.get('data-player')

        return resolver_proxy.get_brightcove_video_json(
            plugin, data_account, data_player, data_video_id)
    else:
        main_id = re.compile(r'main\.(.*?)\.js').findall(resp.text)[0]
        resp2 = urlquick.get(URL_DATA_BRIGTHCOVE % main_id,
                             headers={'User-Agent': web_utils.get_random_ua()},
                             max_age=-1)
        data_account = re.compile(r'data-account\"\:\"(.*?)\"').findall(
            resp2.text)[0]
        data_video_id = re.compile(r'\,y\=\"(.*?)\"').findall(resp2.text)[0]
        data_player = 'default'

        return resolver_proxy.get_brightcove_video_json(
            plugin, data_account, data_player, data_video_id)
Пример #2
0
def get_video_url(plugin,
                  item_id,
                  video_id,
                  video_id_ext,
                  download_mode=False,
                  **kwargs):

    resp = urlquick.get(URL_VIDEO % (item_id, get_token(item_id), video_id))
    json_parser = json.loads(resp.text)

    if item_id == 'bfmtv':
        stream_infos_url = json_parser['video']['long_url']

        resp2 = urlquick.get(stream_infos_url,
                             headers={'User-Agent': web_utils.get_random_ua()},
                             max_age=-1)

        root = resp2.parse()
        live_datas = root.find(".//div[@class='video_block']")
        data_account = live_datas.get('accountid')
        data_video_id = live_datas.get('videoid')
        data_player = live_datas.get('playerid')
        return resolver_proxy.get_brightcove_video_json(
            plugin, data_account, data_player, data_video_id, download_mode)
    else:
        video_streams = json_parser['video']['medias']
        final_video_url = ''
        if DESIRED_QUALITY == "DIALOG":
            all_datas_videos_quality = []
            all_datas_videos_path = []

            for datas in video_streams:
                all_datas_videos_quality.append("Video Height : " +
                                                str(datas['frame_height']) +
                                                " (Encoding : " +
                                                str(datas['encoding_rate']) +
                                                ")")
                all_datas_videos_path.append(datas['video_url'])

            seleted_item = xbmcgui.Dialog().select(plugin.localize(30709),
                                                   all_datas_videos_quality)

            if seleted_item > -1:
                final_video_url = all_datas_videos_path[seleted_item]
            else:
                return False

        elif DESIRED_QUALITY == 'BEST':
            # GET LAST NODE (VIDEO BEST QUALITY)
            url_best_quality = ''
            for datas in video_streams:
                url_best_quality = datas['video_url']
            final_video_url = url_best_quality
        else:
            # DEFAULT VIDEO
            final_video_url = json_parser['video']['video_url']

        if download_mode:
            return download.download_video(final_video_url)
        return final_video_url
def get_live_url(plugin, item_id, video_id, **kwargs):

    resp = urlquick.get(URL_LIVE)
    data_account = re.compile(r'accountId":"(.*?)"').findall(resp.text)[0]
    data_player = re.compile(r'playerId":"(.*?)"').findall(resp.text)[0]
    data_video_id = re.compile(r'assetId":"(.*?)"').findall(resp.text)[0]
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id)
Пример #4
0
def get_live_url(plugin, item_id, **kwargs):

    resp = urlquick.get(URL_LIVE, headers={'User-Agent': web_utils.get_random_ua()}, max_age=-1)

    data_account_player = re.search('//players\.brightcove\.net/([0-9]+)/([A-Za-z0-9]+)_default/index\.html\?videoId=([0-9]+)', resp.text)
    data_account = data_account_player.group(1)
    data_player = data_account_player.group(2)
    data_video_id = data_account_player.group(3)

    return resolver_proxy.get_brightcove_video_json(plugin, data_account, data_player, data_video_id)
Пример #5
0
def get_video_url(plugin, item_id, video_url, download_mode=False, **kwargs):

    resp = urlquick.get(video_url)

    data_account = re.compile(r'accountid="(.*?)"').findall(resp.text)[0]
    data_video_id = re.compile(r'videoid="(.*?)"').findall(resp.text)[0]
    data_player = re.compile(r'playerid="(.*?)"').findall(resp.text)[0]

    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id,
                                                    download_mode)
Пример #6
0
def get_video_url(plugin, item_id, video_url, download_mode=False, **kwargs):

    resp = urlquick.get(video_url)
    data_video_id = re.compile('data-video-id=\'(.*?)\'').findall(resp.text)[0]
    data_player = re.compile('data-player=\'(.*?)\'').findall(resp.text)[0]
    resp2 = urlquick.get(URL_BRIGHTCOVE_DATAS)
    data_account = re.compile('players.brightcove.net/(.*?)/').findall(
        resp2.text)[0]
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id,
                                                    download_mode)
Пример #7
0
def get_video_url(plugin, item_id, video_id, download_mode=False, **kwargs):

    resp = urlquick.get(URL_BRIGHTCOVE_DATAS)

    data_account = re.compile(r'ACCOUNT_ID\:\"(.*?)\"').findall(resp.text)[0]
    data_player = re.compile(r'PLAYER_ID\:\"(.*?)\"').findall(resp.text)[0]
    data_video_id = video_id

    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id,
                                                    download_mode)
Пример #8
0
def get_video_url(plugin,
                  item_id,
                  data_account,
                  data_player,
                  data_video_id,
                  download_mode=False,
                  **kwargs):

    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id,
                                                    download_mode)
Пример #9
0
def get_video_url(plugin, item_id, video_url, download_mode=False, **kwargs):

    resp = urlquick.get(video_url,
                        headers={'User-Agent': web_utils.get_random_ua()},
                        max_age=-1)
    data_account = re.compile(r'data-account\=\"(.*?)\"').findall(resp.text)[0]
    data_player = re.compile(r'data-player\=\"(.*?)\"').findall(resp.text)[0]
    data_video_id = re.compile(r'data-video-id\=\"(.*?)\"').findall(
        resp.text)[0]
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id,
                                                    download_mode)
def get_live_url(plugin, item_id, **kwargs):

    resp = urlquick.get(URL_LIVE,
                        headers={'User-Agent': web_utils.get_random_ua()},
                        max_age=-1)
    data_account = re.compile(r'data-account\'\,\'(.*?)\'').findall(
        resp.text)[0]
    data_player = re.compile(r'data-player\'\,\'(.*?)\'').findall(resp.text)[0]
    data_video_id = re.compile(r'data-video-id\'\,\'(.*?)\'').findall(
        resp.text)[0]
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id)
Пример #11
0
def get_live_url(plugin, item_id, video_id, item_dict, **kwargs):

    resp = urlquick.get(URL_LIVE_BFM_PARIS,
                        headers={'User-Agent': web_utils.get_random_ua()},
                        max_age=-1)

    root = resp.parse()
    live_datas = root.find(".//div[@class='next-player']")
    data_account = live_datas.get('data-account')
    data_video_id = live_datas.get('data-video-id')
    data_player = live_datas.get('data-player')
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id)
Пример #12
0
def get_live_url(plugin, item_id, video_id, item_dict):

    resp = urlquick.get(URL_LIVE_RMCDECOUVERTE,
                        headers={'User-Agent': web_utils.get_random_ua},
                        max_age=-1)

    live_soup = bs(resp.text, 'html.parser')
    data_live_soup = live_soup.find('div', class_='next-player')
    data_account = data_live_soup['data-account']
    data_video_id = data_live_soup['data-video-id']
    data_player = data_live_soup['data-player']
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id)
Пример #13
0
def get_video_url(plugin, item_id, video_url, download_mode=False, **kwargs):

    resp = urlquick.get(video_url,
                        headers={'User-Agent': web_utils.get_random_ua()},
                        max_age=-1)
    root = resp.parse()
    video_datas = root.find(".//div[@class='next-player player_2t_e9']")

    data_account = video_datas.get('data-account')
    data_video_id = video_datas.get('data-video-id')
    data_player = video_datas.get('data-player')

    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id,
                                                    download_mode)
Пример #14
0
def get_video_url(plugin,
                  item_id,
                  video_url,
                  download_mode=False,
                  video_label=None):

    resp = urlquick.get(video_url)

    data_account = re.compile(r'data-account="(.*?)"').findall(resp.text)[0]
    data_video_id = re.compile(r'data-video-id="(.*?)"').findall(resp.text)[0]
    data_player = re.compile(r'data-player="(.*?)"').findall(resp.text)[0]

    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id,
                                                    download_mode, video_label)
def get_live_url(plugin, item_id, **kwargs):

    if item_id == 'bfmtv':
        resp = urlquick.get(URL_LIVE_BFMTV,
                            headers={'User-Agent': web_utils.get_random_ua()},
                            max_age=-1)
        root = resp.parse()
        live_datas = root.find(".//div[@class='video_block']")
        data_account = live_datas.get('accountid')
        data_video_id = live_datas.get('videoid')
        data_player = live_datas.get('playerid')
        return resolver_proxy.get_brightcove_video_json(
            plugin, data_account, data_player, data_video_id)
    if item_id == 'bfmbusiness':
        resp = urlquick.get(URL_LIVE_BFMBUSINESS,
                            headers={'User-Agent': web_utils.get_random_ua()},
                            max_age=-1)
        root = resp.parse()
        live_datas = root.find(".//div[@class='video_block']")
        data_account = live_datas.get('accountid')
        data_video_id = live_datas.get('videoid')
        data_player = live_datas.get('playerid')
        return resolver_proxy.get_brightcove_video_json(
            plugin, data_account, data_player, data_video_id)
Пример #16
0
def get_live_url(plugin, item_id, video_id, **kwargs):

    resp = urlquick.get(URL_LIVE)
    json_parser = json.loads(
        re.compile(r'__INITIAL_STATE__ = (.*?)\}\;').findall(resp.text)[0] +
        '}')

    asset_id_value = ''
    for id_stream_datas in list(json_parser["items"].keys()):
        if item_id.upper() in json_parser["items"][id_stream_datas]["content"]["attributes"]["title"]:
            asset_id_value = json_parser["items"][id_stream_datas]["content"]["attributes"]["assetId"]

    data_account = re.compile(r'accountId":"(.*?)"').findall(resp.text)[0]
    data_player = re.compile(r'playerId":"(.*?)"').findall(resp.text)[0]
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, asset_id_value)
Пример #17
0
def get_video_url(plugin, item_id, video_url, download_mode=False, **kwargs):

    resp = urlquick.get(video_url,
                        headers={'User-Agent': web_utils.get_random_ua()},
                        max_age=-1)
    stream_datas = resp.text.split('addPlayer(')[1].split(');')[0].replace(
        "\n", "").replace("\r", "").split(',')
    data_account = stream_datas[0].strip().replace("'", "")
    data_player = stream_datas[1].strip().replace("'", "")
    if item_id == 'tx':
        data_video_id = stream_datas[4].strip().replace("'", "")
    else:
        data_video_id = 'ref:' + stream_datas[4].strip().replace("'", "")
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id,
                                                    download_mode)
Пример #18
0
def get_video_url(plugin, item_id, video_id, download_mode=False, **kwargs):

    resp = urlquick.get(URL_STREAM_DATAS % video_id)
    json_parser = json.loads(resp.text)

    resp2 = urlquick.get(URL_LIVE)
    data_account = re.compile(r'data-account\"\,(.*?)\)\,').findall(
        resp2.text)[0]
    data_player = 'default'
    data_video_id = ''
    for stream_datas in json_parser["streamInfos"]:
        if 'Brightcove' in stream_datas["source"]:
            data_video_id = stream_datas["sourceId"]

    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id,
                                                    download_mode)
def get_live_url(plugin, item_id, **kwargs):

    resp = urlquick.get(
        URL_LIVE, headers={'User-Agent': web_utils.get_random_ua()}, max_age=-1)
    live_info_id = re.compile(
        r'dist\/js\/noovo\.(.*?)\.').findall(resp.text)[0]

    resp2 = urlquick.get(
        URL_LIVE_INFOS % live_info_id, headers={'User-Agent': web_utils.get_random_ua()}, max_age=-1)

    data_account = re.compile(r'data-account\=\"(.*?)\"').findall(resp2.text)[0]
    data_player = re.compile(r'data-player\=\"(.*?)\"').findall(resp2.text)[0]
    data_video_id = re.compile(r'data-video-id\=\"(.*?)\"').findall(
        resp2.text)[0]
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id,
                                                    False)
Пример #20
0
def get_video_url(plugin, item_id, video_url, download_mode=False, **kwargs):
    """Get video URL and start video player"""

    resp = urlquick.get(video_url,
                        headers={'User-Agent': web_utils.get_random_ua()},
                        max_age=-1)
    root = resp.parse()
    video_datas = root.find(
        ".//video[@class='player-fff vjs-fluid video-js margin_b16 resp_iframe']"
    )

    data_account = video_datas.get('data-account')
    data_video_id = video_datas.get('data-video-id')
    data_player = video_datas.get('data-player')

    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id,
                                                    download_mode)
Пример #21
0
def get_live_url(plugin, item_id, **kwargs):

    if 'paris' in item_id:
        resp = urlquick.get(URL_ROOT + '/mediaplayer/live-bfm-paris/',
                            headers={'User-Agent': web_utils.get_random_ua()},
                            max_age=-1)
    else:
        resp = urlquick.get(URL_LIVE_BFM_REGION % item_id.replace('bfm', ''),
                            headers={'User-Agent': web_utils.get_random_ua()},
                            max_age=-1)

    root = resp.parse()
    live_datas = root.find(".//div[@class='video_block']")
    data_account = live_datas.get('accountid')
    data_video_id = live_datas.get('videoid')
    data_player = live_datas.get('playerid')
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id)
Пример #22
0
def get_live_url(plugin, item_id, video_id, item_dict):

    if item_id == 'bfmtv':
        resp = urlquick.get(URL_LIVE_BFMTV,
                            headers={'User-Agent': web_utils.get_random_ua},
                            max_age=-1)
    elif item_id == 'bfmbusiness':
        resp = urlquick.get(URL_LIVE_BFMBUSINESS,
                            headers={'User-Agent': web_utils.get_random_ua},
                            max_age=-1)

    root = resp.parse()
    live_datas = root.find(".//div[@class='next-player']")
    data_account = live_datas.get('data-account')
    data_video_id = live_datas.get('data-video-id')
    data_player = live_datas.get('data-player')
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id)
Пример #23
0
def get_video_url(plugin,
                  item_id,
                  video_url,
                  download_mode=False,
                  video_label=None):

    resp = urlquick.get(video_url,
                        headers={'User-Agent': web_utils.get_random_ua},
                        max_age=-1)
    video_datas_soup = bs(resp.text, 'html.parser')
    video_datas = video_datas_soup.find('div', class_='next-player')

    data_account = video_datas['data-account']
    data_video_id = video_datas['data-video-id']
    data_player = video_datas['data-player']

    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id,
                                                    download_mode, video_label)
def get_video_url(plugin,
                  item_id,
                  content_id,
                  video_id,
                  download_mode=False,
                  **kwargs):

    payload = {"device_layout": "web", "device_type": "web"}
    resp = urlquick.post(URL_BRIGHTCOVE_DATAS % (content_id, video_id),
                         data=payload,
                         max_age=-1)
    json_parser2 = json.loads(resp.text)

    data_account = json_parser2["data"]["stream"]["video_provider_details"][
        "account_id"]
    data_player = 'default'
    data_video_id = json_parser2["data"]["stream"]["url"]
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id)
Пример #25
0
def get_video_url(plugin,
                  item_id,
                  video_id,
                  subtitle,
                  download_mode=False,
                  **kwargs):

    resp = urlquick.get(URL_BRIGHTCOVE_DATAS)

    data_account = re.compile(r"ACCOUNT_ID\:\"(.*?)\"").findall(resp.text)[1]
    data_player = re.compile(r"PLAYER_ID\:\"(.*?)\"").findall(resp.text)[1]
    data_video_id = video_id

    item = Listitem()
    item.path = resolver_proxy.get_brightcove_video_json(
        plugin, data_account, data_player, data_video_id, download_mode)
    if subtitle:
        item.subtitles.append(subtitle)
    return item
Пример #26
0
def get_live_url(plugin, item_id, video_id, **kwargs):

    resp = urlquick.get(URL_LIVE,
                        headers={'User-Agent': web_utils.get_random_ua()},
                        max_age=-1)
    data_account = ''
    data_player = ''
    data_video_id = ''
    if len(re.compile(r'data-account="(.*?)"').findall(resp.text)) > 0:
        data_account = re.compile(r'data-account="(.*?)"').findall(
            resp.text)[0]
        data_player = re.compile(r'data-player="(.*?)"').findall(resp.text)[0]
        data_video_id = re.compile(r'data-video-id="(.*?)"').findall(
            resp.text)[0]
    else:
        data_account = re.compile(r'accountId\: "(.*?)"').findall(resp.text)[0]
        data_player = re.compile(r'player\: "(.*?)"').findall(resp.text)[0]
        data_video_id = re.compile(r'videoId\: "(.*?)"').findall(resp.text)[0]
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id)
def get_live_url(plugin, item_id, **kwargs):

    unix_time = time.time()
    resp = urlquick.get(URL_LIVE_DATAS % unix_time)
    json_parser = json.loads(resp.text)

    content_id = json_parser["data"]["blocks"][0]["widgets"][0]["playlist"][
        "contents"][0]["id"]
    stream_id = json_parser["data"]["blocks"][0]["widgets"][0]["playlist"][
        "contents"][0]["streams"][0]["id"]

    # Build PAYLOAD
    payload = {"device_layout": "web", "device_type": "web"}
    resp2 = urlquick.post(URL_BRIGHTCOVE_DATAS % (content_id, stream_id),
                          data=payload)
    json_parser2 = json.loads(resp2.text)

    data_account = json_parser2["data"]["stream"]["video_provider_details"][
        "account_id"]
    data_player = 'default'
    data_live_id = json_parser2["data"]["stream"]["url"]
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_live_id)
Пример #28
0
                  **kwargs):

    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id,
                                                    download_mode)


@Resolver.register
def get_live_url(plugin, item_id, **kwargs):

<<<<<<< HEAD:plugin.video.catchuptvandmore/resources/lib/channels/ca/tva.py
    resp = urlquick.get(URL_LIVE)
    json_parser = json.loads(
        re.compile(r'__INITIAL_STATE__ = (.*?)\}\;').findall(resp.text)[0] +
        '}')

    asset_id_value = ''
    for id_stream_datas in list(json_parser["items"].keys()):
        if item_id.upper() in json_parser["items"][id_stream_datas]["content"]["attributes"]["title"]:
            asset_id_value = json_parser["items"][id_stream_datas]["content"]["attributes"]["assetId"]

    data_account = re.compile(r'accountId":"(.*?)"').findall(resp.text)[0]
    data_player = re.compile(r'playerId":"(.*?)"').findall(resp.text)[0]
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, asset_id_value)
=======
    resp = urlquick.get(URL_LIVE % item_id)
    return re.compile(
        r'videoSourceUrl\"\:\"(.*?)\"').findall(resp.text)[0]
>>>>>>> cf69920d1ba10a4558544c5d79d7c35f56d3e2c3:resources/lib/channels/ca/tva.py
        final_video_url = url_best_quality
=======
    if item_id == 'bfmtv' or item_id == 'bfmbusiness':
        stream_infos_url = json_parser['video']['long_url']

        resp2 = urlquick.get(stream_infos_url,
                             headers={'User-Agent': web_utils.get_random_ua()},
                             max_age=-1)

        root = resp2.parse()
        live_datas = root.find(".//div[@class='video_block']")
        data_account = live_datas.get('accountid')
        data_video_id = live_datas.get('videoid')
        data_player = live_datas.get('playerid')
        return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                        data_player, data_video_id,
                                                        download_mode)
>>>>>>> cf69920d1ba10a4558544c5d79d7c35f56d3e2c3:resources/lib/channels/fr/bfmtv.py
    else:
        video_streams = json_parser['video']['medias']
        final_video_url = ''
        if DESIRED_QUALITY == "DIALOG":
            all_datas_videos_quality = []
            all_datas_videos_path = []

            for datas in video_streams:
                all_datas_videos_quality.append("Video Height : " +
                                                str(datas['frame_height']) +
                                                " (Encoding : " +
                                                str(datas['encoding_rate']) + ")")
                all_datas_videos_path.append(datas['video_url'])
Пример #30
0
def live_entry(plugin, item_id, **kwargs):
    return get_live_url(plugin, item_id, item_id.upper())


@Resolver.register
def get_live_url(plugin, item_id, video_id, **kwargs):
=======
@Resolver.register
def get_live_url(plugin, item_id, **kwargs):
>>>>>>> cf69920d1ba10a4558544c5d79d7c35f56d3e2c3:resources/lib/channels/ca/noovo.py

    resp = urlquick.get(
        URL_LIVE, headers={'User-Agent': web_utils.get_random_ua()}, max_age=-1)
    live_info_id = re.compile(
        r'dist\/js\/noovo\.(.*?)\.').findall(resp.text)[0]

    resp2 = urlquick.get(
        URL_LIVE_INFOS % live_info_id, headers={'User-Agent': web_utils.get_random_ua()}, max_age=-1)

    data_account = re.compile(r'data-account\=\"(.*?)\"').findall(resp2.text)[0]
<<<<<<< HEAD:plugin.video.catchuptvandmore/resources/lib/channels/ca/noovo.py
    data_player = re.compile(r'data-player\=\"(.*?)\"').findall(resp2.text)[0]
=======
    data_player = re.compile(r'data-embed\=\"(.*?)\"').findall(resp2.text)[0]
>>>>>>> cf69920d1ba10a4558544c5d79d7c35f56d3e2c3:resources/lib/channels/ca/noovo.py
    data_video_id = re.compile(r'data-video-id\=\"(.*?)\"').findall(
        resp2.text)[0]
    return resolver_proxy.get_brightcove_video_json(plugin, data_account,
                                                    data_player, data_video_id,
                                                    False)