diff --git a/lib/streaming_providers/providers/movetv/epg_manager.py b/lib/streaming_providers/providers/movetv/epg_manager.py index 630952a..504ce71 100644 --- a/lib/streaming_providers/providers/movetv/epg_manager.py +++ b/lib/streaming_providers/providers/movetv/epg_manager.py @@ -81,7 +81,10 @@ class MoveTvEpgManager: Parameters ---------- channel_id: - The provider's numeric content ID for the channel (as a string). + The provider's ``contentId`` for the channel (as a string) — + i.e. ``MoveTVChannel.catalog_id``, NOT the ``liveId`` / + ``content_id``. Translation from liveId to contentId must happen + before this method is called (see ``MoveTVProvider.get_epg``). backwards: Hours of past programming to include (API default: 2). Ignored when start_time/end_time are provided. diff --git a/lib/streaming_providers/providers/movetv/provider.py b/lib/streaming_providers/providers/movetv/provider.py index 9b41740..d1a3ad5 100644 --- a/lib/streaming_providers/providers/movetv/provider.py +++ b/lib/streaming_providers/providers/movetv/provider.py @@ -177,10 +177,6 @@ class MoveTVProvider(StreamingProvider): # Manifests are fetched per-play via the source endpoint return True - @property - def implements_epg(self) -> bool: - return False - @property def supported_auth_types(self) -> List[str]: return self.SUPPORTED_AUTH_TYPES @@ -688,15 +684,16 @@ class MoveTVProvider(StreamingProvider): backwards: int = 2, forwards: int = 2, **kwargs, - ) -> List[Dict]: # ← ADD (whole method) + ) -> List[Dict]: """ Return the EPG schedule for *channel_id*. Parameters ---------- channel_id: - Provider content ID of the live channel (string form of the - integer seen in the API, e.g. ``"211458"``). + The channel's liveId (stored as ``MoveTVChannel.content_id``). + Internally translated to the contentId (``catalog_id``) that the + EPG API expects before the request is fired. backwards: Hours of past programming to include (default 2). forwards: @@ -706,10 +703,28 @@ class MoveTVProvider(StreamingProvider): ------- List of normalised programme dicts from ``MoveTvEpgManager``. """ + # The EPG endpoint uses contentId (catalog_id), NOT liveId (content_id). + # Resolve via the cached channel list; fall back to channel_id as-is so + # callers that already pass a contentId still work. + catalog_id = channel_id + channel = self._channel_by_id(channel_id) + if channel is not None: + catalog_id = str(channel.catalog_id) + logger.debug( + f"move.tv EPG: resolved liveId={channel_id} → contentId={catalog_id}" + ) + else: + logger.warning( + f"move.tv EPG: channel liveId={channel_id!r} not found in channel " + f"cache — passing value as-is to EPG manager (may fail if it is " + f"not a valid contentId)" + ) + return self._epg.get_channel_epg( - channel_id, + catalog_id, backwards=kwargs.get("backwards", backwards), forwards=kwargs.get("forwards", forwards), + **{k: v for k, v in kwargs.items() if k not in ("backwards", "forwards")}, ) # ④ If your framework checks this property to decide whether to call