From 4b6c3c04406dc2005dee322ddf1f68a5102125e4 Mon Sep 17 00:00:00 2001 From: Pablo Ferreiro Date: Fri, 2 Feb 2024 15:32:13 +0100 Subject: [PATCH] login hotfix --- addon.xml | 4 +++- resources/lib/helpers/misc.py | 5 ----- resources/lib/player/handler.py | 3 +-- resources/lib/session.py | 2 +- tools/api_m.example.py | 3 ++- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/addon.xml b/addon.xml index 4aa9511..3d514d7 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -24,6 +24,8 @@ https://www.filmin.es/ https://github.com/pablouser1/plugin.video.filmin + v1.7.1 (02/02/2024) + - Hotfix, arreglado AttributeError al iniciar sesión v1.7.0 (02/01/2024) - Sincronización con Filmin deshabilitada temporalmente - Refactoring del código siguiendo los estándares PEP diff --git a/resources/lib/helpers/misc.py b/resources/lib/helpers/misc.py index bf96423..95e523e 100644 --- a/resources/lib/helpers/misc.py +++ b/resources/lib/helpers/misc.py @@ -3,11 +3,6 @@ from urllib.parse import urlencode -def enum(**enums): - """Emulate enum type""" - return type("Enum", (), enums) - - def is_drm(stream_type: str) -> bool: """Checks if stream has DRM""" return stream_type in ["dash+http+widevine", "dash+https+widevine"] diff --git a/resources/lib/player/handler.py b/resources/lib/player/handler.py index 6eca1ef..782dac9 100644 --- a/resources/lib/player/handler.py +++ b/resources/lib/player/handler.py @@ -104,8 +104,7 @@ def start(self): "inputstream.adaptive.license_type", self.DRM) play_item.setProperty( "inputstream.adaptive.license_key", - stream["license_url"] + "||R{SSM}|" - ) + stream["license_url"] + "||R{SSM}|") # Start playing monitor = Monitor() diff --git a/resources/lib/session.py b/resources/lib/session.py index e3b9fb3..b981856 100644 --- a/resources/lib/session.py +++ b/resources/lib/session.py @@ -17,7 +17,7 @@ def ask_login(): password = Dialog().input(settings.get_localized_string(40031)) if username and password: res = api.login(username, password) - api.setToken(res["access_token"]) + api.set_token(res["access_token"]) change_profile() user = api.user() settings.set_auth( diff --git a/tools/api_m.example.py b/tools/api_m.example.py index b4e8bb6..10214c1 100644 --- a/tools/api_m.example.py +++ b/tools/api_m.example.py @@ -1,10 +1,11 @@ +# flake8: noqa import json import sys import os PARENT_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") sys.path.append(PARENT_PATH) # Add parent path to searchable list -from resources.lib.api import Api # noqa: E402 +from resources.lib.api import Api def prettyPrint(data):