Implement epg

This commit is contained in:
Nirvana
2025-12-03 12:03:28 +01:00
parent 48d25b61f8
commit 02bef0b5d5
7 changed files with 38 additions and 0 deletions
+14
View File
@@ -402,6 +402,20 @@ class StreamingProvider(ABC):
"""Return True if provider uses truly dynamic manifests"""
pass
@property
@abstractmethod
def implements_epg(self) -> bool:
"""
Indicates whether this provider has its own EPG implementation.
If False, the generic EPG manager will be used.
Override in subclass and return True if provider has native EPG.
Returns:
True if provider implements its own EPG, False to use generic EPG
"""
pass
@abstractmethod
def get_channels(self, **kwargs) -> List[StreamingChannel]:
"""Fetch channels from the provider"""
@@ -61,6 +61,10 @@ class HRTiProvider(StreamingProvider):
# HRTi requires session authorization for manifests
return True
@property
def implements_epg(self) -> bool:
return False
def _get_hrti_authenticated_headers(self) -> Dict[str, str]:
"""
Get headers with HRTi authentication for API requests
@@ -175,6 +175,10 @@ class JoynProvider(StreamingProvider):
def uses_dynamic_manifests(self) -> bool:
return False
@property
def implements_epg(self) -> bool:
return False
def authenticate(self, **kwargs) -> str:
"""Authenticate and return bearer token"""
self.bearer_token = self.authenticator.get_bearer_token(
@@ -396,6 +396,10 @@ class Magenta2Provider(StreamingProvider):
def uses_dynamic_manifests(self) -> bool:
return False
@property
def implements_epg(self) -> bool:
return False
def get_discovery_status(self) -> Dict[str, Any]:
"""Get discovery and configuration status"""
if not self.discovery_service:
@@ -13,6 +13,7 @@ DEFAULT_COUNTRY = 'at'
MAX_TV_LOGO = 'https://www.lyngsat.com/logo/corp/mm/max-tv-hr.png'
MAGENTA_TV_PL_LOGO = 'https://magentatv.pl/client/assets/6700c91b4408a2abe2a4.webp'
MAGENTA_TV_AT_LOGO = 'https://m.media-amazon.com/images/I/51XY6Cq3ANL.png'
# Country-specific configuration
COUNTRY_CONFIG = {
@@ -19,6 +19,7 @@ from .constants import (
DEFAULT_REQUEST_TIMEOUT,
DEFAULT_MAX_RETRIES,
DRM_SYSTEM_WIDEVINE,
MAGENTA_TV_AT_LOGO,
MAGENTA_TV_PL_LOGO,
WV_URL,
CONTENT_TYPE_LIVE,
@@ -109,6 +110,8 @@ class MagentaProvider(StreamingProvider):
@property
def provider_logo(self) -> str:
if self.country.lower() == 'at':
return MAGENTA_TV_AT_LOGO
if self.country.lower() == 'hr':
return MAX_TV_LOGO
elif self.country.lower() == 'pl':
@@ -120,6 +123,10 @@ class MagentaProvider(StreamingProvider):
def uses_dynamic_manifests(self) -> bool:
return False
@property
def implements_epg(self) -> bool:
return False
def authenticate(self, **kwargs) -> str:
logger.info(f"=== MagentaProvider.authenticate() CALLED with kwargs: {kwargs} ===")
self.bearer_token = self.authenticator.get_bearer_token(force_refresh=kwargs.get('force_refresh', False))
@@ -65,6 +65,10 @@ class RTLPlusProvider(StreamingProvider):
# RTL+ provides relatively stable manifest URLs that can be fetched and cached
return False
@property
def implements_epg(self) -> bool:
return False
# ============================================================================
# OPTION 1: Provider-specific method (RECOMMENDED - No signature conflict)
# ============================================================================