diff --git a/resources/lib/channels/ch/teleticino.py b/resources/lib/channels/ch/teleticino.py index f4a63339a..d56b030a2 100644 --- a/resources/lib/channels/ch/teleticino.py +++ b/resources/lib/channels/ch/teleticino.py @@ -8,6 +8,7 @@ import re from codequick import Resolver +from resources.lib import resolver_proxy, web_utils import urlquick @@ -19,14 +20,15 @@ # Live URL_LIVE = URL_ROOT + '/diretta' +GENERIC_HEADERS = {'User-Agent': web_utils.get_random_ua()} + @Resolver.register def get_live_url(plugin, item_id, **kwargs): - resp = urlquick.get(URL_LIVE) - list_lives = re.compile(r'file": "(.*?)"').findall(resp.text) - stream_url = '' + resp = urlquick.get(URL_LIVE, headers=GENERIC_HEADERS, max_age=-1) + list_lives = re.compile(r'file":\s*"(.*?)"').findall(resp.text) for stream_datas in list_lives: if 'm3u8' in stream_datas: - stream_url = stream_datas - return stream_url + video_url = stream_datas + return resolver_proxy.get_stream_with_quality(plugin, video_url)