From b4de0b74f48414c89f1bf043bd4112906e7000f2 Mon Sep 17 00:00:00 2001 From: Pablo Ferreiro Date: Sun, 19 Feb 2023 12:03:09 +0100 Subject: [PATCH] Mejor soporte para No-DRM --- addon.xml | 2 +- resources/lib/api.py | 5 +++-- resources/lib/player/Mediamark.py | 10 +++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/addon.xml b/addon.xml index a84c3f4..81cdde7 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/resources/lib/api.py b/resources/lib/api.py index ca84875..3c4185c 100644 --- a/resources/lib/api.py +++ b/resources/lib/api.py @@ -3,6 +3,7 @@ from .exceptions.ApiV3Exception import ApiV3Exception from .exceptions.UApiException import UApiException from .exceptions.DialogException import DialogException +from .helpers.Misc import isDrm class Api: s = requests.Session() @@ -194,9 +195,9 @@ def getStreams(self, item_id: int) -> dict: streams = {} # -- Single feed -- # if not 'feeds' in res: - if 'FLVURL' in res: + if not isDrm(res.get('type', 'FLVURL')): # Add support for v1 (DRM-Free) video - res['src'] = res['FLVURL'] + res['src'] = res.get('FLVURL') or res.get('src') res['type'] = 'FLVURL' # We have to convert it to the multi-feed response diff --git a/resources/lib/player/Mediamark.py b/resources/lib/player/Mediamark.py index 4797763..51e1dcc 100644 --- a/resources/lib/player/Mediamark.py +++ b/resources/lib/player/Mediamark.py @@ -7,12 +7,12 @@ class Mediamark: AUTH_TOKEN = "Njk1MzM5MjAtNDVmNi0xMWUzLThmOTYtMDgwMDIwMGM5YTY2" # I -- THINK -- this is hardcoded, I hope so. s = requests.Session() TOKEN = '' - USER_ID = 0 + USER_ID = -1 PROFILE_ID = '' - MEDIA_ID = 0 - VERSION_ID = 0 - MEDIA_VIEWING_ID = 0 - SESSION_ID = 0 + MEDIA_ID = -1 + VERSION_ID = -1 + MEDIA_VIEWING_ID = -1 + SESSION_ID = -1 DEVICE_MODEL = 'Kodi' DEVICE_OS_VERSION = '12'