Skip to content

Commit

Permalink
[CH - TELETICINO] Fix Teleticino live
Browse files Browse the repository at this point in the history
  • Loading branch information
jmzambon authored and joaopa00 committed May 26, 2024
1 parent 2c0a274 commit 0ab3544
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions resources/lib/channels/ch/teleticino.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import re

from codequick import Resolver
from resources.lib import resolver_proxy, web_utils
import urlquick


Expand All @@ -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)

0 comments on commit 0ab3544

Please sign in to comment.