From bb6de9953cc086bd27f919aefae7f186dfcd6007 Mon Sep 17 00:00:00 2001 From: marco <10120390+mac12m99@users.noreply.github.com> Date: Wed, 30 Mar 2022 21:05:10 +0200 Subject: [PATCH] Fix dirette mediaset --- channels/mediasetplay.py | 16 ++++++++-------- platformcode/platformtools.py | 3 +-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/channels/mediasetplay.py b/channels/mediasetplay.py index fcfe176b..2c37eccb 100644 --- a/channels/mediasetplay.py +++ b/channels/mediasetplay.py @@ -92,7 +92,7 @@ def live(item): plot += '\n\nA Seguire:\n[B]{}[/B]\n{}'.format(guide.get('nextListing', {}).get('mediasetlisting$epgTitle', ''),guide.get('nextListing', {}).get('description', '')) itemlist.append(item.clone(title=support.typo(title, 'bold'), fulltitle=title, callSign=it['callSign'], - urls=guide['tuningInstruction']['urn:theplatform:tv:location:any'], + urls=[guide['publicUrl']], plot=plot, url=url, action='findvideos', @@ -247,13 +247,13 @@ def findvideos(item): if item.urls: url = '' pid = '' - Format = 'dash+xml' if mpd else 'x-mpegURL' - for it in item.urls: - if Format in it['format']: - item.url = requests.head(it['publicUrls'][0]).headers['Location'] + '|User-Agent=' + support.httptools.get_user_agent() - pid = it['releasePids'][0] - if mpd and 'widevine' in it['assetTypes']: - break + # Format = 'dash+xml' if mpd else 'x-mpegURL' + # for it in item.urls: + # if Format in it['format']: + item.url = requests.head(item.urls[0], headers={'User-Agent': support.httptools.get_user_agent()}).headers['Location'] + # pid = it['releasePids'][0] + # if mpd and 'widevine' in it['assetTypes']: + # break if mpd: item.manifest = 'mpd' diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 70a19c44..27aab68b 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1716,8 +1716,7 @@ def install_widevine(): sys.path.append(path) from inputstreamhelper import Helper helper = Helper('mpd', drm='widevine') - if not helper._check_widevine(): - helper.install_widevine() + helper.check_inputstream() def get_played_time(item):