diff --git a/lib/streaming_providers/providers/rtlplus/channel_manager.py b/lib/streaming_providers/providers/rtlplus/channel_manager.py index 4fb64ba..df51878 100644 --- a/lib/streaming_providers/providers/rtlplus/channel_manager.py +++ b/lib/streaming_providers/providers/rtlplus/channel_manager.py @@ -16,6 +16,7 @@ from datetime import date from .layout_helpers import unwrap_target, build_image_url from ...base.models import Channel, DRMConfig from ...base.utils.logger import logger +from .constants import RTLPlusDefaults class RTLPlusChannelManager: @@ -157,7 +158,7 @@ class RTLPlusChannelManager: ) # Set logo URL - streaming_channel.logo_url = build_image_url(logo_id) if logo_id else "" + streaming_channel.logo_url = build_image_url(logo_id, RTLPlusDefaults.IMAGE_PARAMS_LOGO) if logo_id else "" # Store SEO in manifest_script for fallback lookups if seo: diff --git a/lib/streaming_providers/providers/rtlplus/constants.py b/lib/streaming_providers/providers/rtlplus/constants.py index 9ac493f..a7c60cb 100644 --- a/lib/streaming_providers/providers/rtlplus/constants.py +++ b/lib/streaming_providers/providers/rtlplus/constants.py @@ -69,6 +69,7 @@ class RTLPlusDefaults: # Image CDN IMAGE_BASE_URL = "https://images-fio.rtlde.bedrock.tech/v2/images" IMAGE_PARAMS = "auto=webp&blur=0&fit=scale_crop&height=320&interlace=1&optimize=high&width=213" + IMAGE_PARAMS_LOGO = "auto=avif&blur=0&fit=scale_crop&height=1080&interlace=1&optimize=high&width=1080" IMAGE_SIGNING_KEY = "x9vGg4RNeNBqV2nBfhqLV6cN4n" # Anonymous credentials (fallback) diff --git a/lib/streaming_providers/providers/rtlplus/layout_helpers.py b/lib/streaming_providers/providers/rtlplus/layout_helpers.py index 4b38f24..0713576 100644 --- a/lib/streaming_providers/providers/rtlplus/layout_helpers.py +++ b/lib/streaming_providers/providers/rtlplus/layout_helpers.py @@ -128,7 +128,7 @@ def parse_german_datetime(text: str) -> Optional[datetime]: # Signed image URL construction # --------------------------------------------------------------------------- -def build_image_url(image_id: str) -> str: +def build_image_url(image_id: str, params: str = None) -> str: """ Build a signed Bedrock CDN image URL for the given image ID. @@ -139,11 +139,14 @@ def build_image_url(image_id: str) -> str: Args: image_id: The raw image ID returned by the Bedrock API. + params: Optional query-string overriding ``RTLPlusDefaults.IMAGE_PARAMS``. + Use ``RTLPlusDefaults.IMAGE_PARAMS_LOGO`` for square channel logos. Returns: A fully-qualified, signed image URL. """ - suffix = f"/{image_id}/raw?{RTLPlusDefaults.IMAGE_PARAMS}" + image_params = params if params is not None else RTLPlusDefaults.IMAGE_PARAMS + suffix = f"/{image_id}/raw?{image_params}" signed_path = f"/v2/images{suffix}" image_hash = hashlib.sha1( (signed_path + RTLPlusDefaults.IMAGE_SIGNING_KEY).encode()