From 482e0b0cc6a2cab14d19e070dc7a05516c8c0cf1 Mon Sep 17 00:00:00 2001 From: "itdrui.de" Date: Tue, 24 Feb 2026 21:00:21 +0100 Subject: [PATCH] dev: revert resolveurl dependency path injection --- addon/resolveurl_backend.py | 42 +++---------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/addon/resolveurl_backend.py b/addon/resolveurl_backend.py index a1bd4ee..3433316 100644 --- a/addon/resolveurl_backend.py +++ b/addon/resolveurl_backend.py @@ -7,36 +7,10 @@ zu einer abspielbaren Media-URL (inkl. evtl. Header-Suffix) aufgelöst werden. from __future__ import annotations from typing import Optional -import sys _LAST_RESOLVE_ERROR = "" -def _append_kodi_dependency_paths() -> None: - """Ensure optional Kodi module dependencies are importable.""" - try: - import xbmcaddon # type: ignore - import xbmcvfs # type: ignore - except Exception: - return - for addon_id in ("script.module.resolveurl", "script.module.kodi-six", "script.module.six"): - try: - addon = xbmcaddon.Addon(addon_id) - addon_path = addon.getAddonInfo("path") or "" - except Exception: - addon_path = "" - if not addon_path: - continue - try: - addon_path = xbmcvfs.translatePath(addon_path) - except Exception: - pass - lib_path = f"{addon_path}/lib" - for candidate in (lib_path, addon_path): - if candidate and candidate not in sys.path: - sys.path.append(candidate) - - def get_last_error() -> str: return str(_LAST_RESOLVE_ERROR or "") @@ -46,21 +20,11 @@ def resolve(url: str) -> Optional[str]: _LAST_RESOLVE_ERROR = "" if not url: return None - resolveurl = None try: - import resolveurl as _resolveurl # type: ignore - resolveurl = _resolveurl + import resolveurl # type: ignore except Exception: - # Ohne harte addon.xml-Abhaengigkeit liegen optionale libs ggf. nicht im Python-Pfad. - _append_kodi_dependency_paths() - try: - import resolveurl as _resolveurl # type: ignore - resolveurl = _resolveurl - except Exception: - resolveurl = None - if resolveurl is None: - _LAST_RESOLVE_ERROR = "resolveurl missing" - return None + _LAST_RESOLVE_ERROR = "resolveurl missing" + return None try: hosted = getattr(resolveurl, "HostedMediaFile", None)