mirror of
https://github.com/nirvana-7777/script.service.ultimate.git
synced 2026-09-16 14:12:20 +02:00
Add more readable property provider label
This commit is contained in:
@@ -43,6 +43,13 @@ class StreamingProvider(ABC):
|
||||
"""Return the provider name (e.g., 'joyn', 'zdf', 'ard')"""
|
||||
pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def provider_label(self) -> str:
|
||||
"""Return the provider label (e.g., 'JOYN', 'ZDF', 'RTL+')"""
|
||||
pass
|
||||
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def uses_dynamic_manifests(self) -> bool:
|
||||
|
||||
@@ -160,6 +160,10 @@ class JoynProvider(StreamingProvider):
|
||||
def provider_name(self) -> str:
|
||||
return 'joyn'
|
||||
|
||||
@property
|
||||
def provider_label(self) -> str:
|
||||
return f'Joyn ({self.country})'
|
||||
|
||||
@property
|
||||
def uses_dynamic_manifests(self) -> bool:
|
||||
return False
|
||||
|
||||
@@ -56,6 +56,11 @@ class RTLPlusProvider(StreamingProvider):
|
||||
def provider_name(self) -> str:
|
||||
return "rtlplus"
|
||||
|
||||
@property
|
||||
def provider_label(self) -> str:
|
||||
return 'RTL+'
|
||||
|
||||
|
||||
@property
|
||||
def uses_dynamic_manifests(self) -> bool:
|
||||
# RTL+ provides relatively stable manifest URLs that can be fetched and cached
|
||||
|
||||
+9
-2
@@ -200,8 +200,16 @@ class UltimateService:
|
||||
# Build stream URL
|
||||
stream_url = f"{base_url}/api/providers/{provider_name}/channels/{channel_id}/stream"
|
||||
|
||||
# Get provider instance to access provider_label
|
||||
try:
|
||||
provider_instance = self.manager.get_provider(provider_name)
|
||||
provider_label = provider_instance.provider_label
|
||||
except (AttributeError, KeyError, ValueError):
|
||||
# Fallback to provider_name if provider_label is not available
|
||||
provider_label = provider_name
|
||||
|
||||
# Add M3U entry with extended info first
|
||||
entry_content += f'#EXTINF:-1 tvg-logo="{channel_logo}" group-title="{provider_name}",{channel_name}\n'
|
||||
entry_content += f'#EXTINF:-1 tvg-logo="{channel_logo}" group-title="{provider_label}",{channel_name}\n'
|
||||
|
||||
# Get DRM configs and add KODIPROP directives
|
||||
try:
|
||||
@@ -252,7 +260,6 @@ class UltimateService:
|
||||
|
||||
# Add KODIPROP directives
|
||||
directives += "#KODIPROP:inputstream=inputstream.adaptive\n"
|
||||
directives += "#KODIPROP:inputstream.adaptive.manifest_type=mpd\n"
|
||||
|
||||
# Build DRM legacy string
|
||||
drm_legacy_parts = [drm_system]
|
||||
|
||||
Reference in New Issue
Block a user