diff --git a/resources/lib/channels/fr/francetv.py b/resources/lib/channels/fr/francetv.py index 1b9f98493..3cd1edde7 100644 --- a/resources/lib/channels/fr/francetv.py +++ b/resources/lib/channels/fr/francetv.py @@ -407,13 +407,12 @@ def get_video_url(plugin, @Resolver.register def get_live_url(plugin, item_id, **kwargs): - resp = urlquick.get(URL_ROOT, headers={'User-Agent': web_utils.get_random_windows_ua()}, max_age=-1) - link_chunks = re.compile(r'script src="(/_next/static/chunks/6289-.*?\.js)" async').findall(resp.text) - url_chunks = URL_ROOT + link_chunks[0] - - resp = urlquick.get(url_chunks, headers={'User-Agent': web_utils.get_random_windows_ua()}, max_age=-1) - chunk = re.compile(r'([A-Za-z0-9-"]+?):{label:"(.+?)",playerId:"(\w+?-\w+?-\w+?-\w+?-\w+?)"}').findall(resp.text) - for channels_id, channels_label, broadcast_id in chunk: - channel_id = channels_id.strip('\"') - if item_id == channel_id: - return resolver_proxy.get_francetv_live_stream(plugin, broadcast_id) + resp = urlquick.get(URL_API_MOBILE('/apps/channels/%s' % item_id), params={'platform': 'apps'}) + json_parser = json.loads(resp.text) + + for collection in json_parser['collections']: + if 'live' == collection['type']: + channel_path = collection["items"][0]["channel"]["channel_path"] + broadcast_id = collection["items"][0]["channel"]["si_id"] + if channel_path == item_id: + return resolver_proxy.get_francetv_live_stream(plugin, broadcast_id)