From 36a822d83ac9ed27dfc4138aefde1f7399715fe4 Mon Sep 17 00:00:00 2001 From: Rafael Moraes <50295204+glomatico@users.noreply.github.com> Date: Wed, 25 Feb 2026 23:15:59 -0300 Subject: [PATCH] Use per-track file_format based on mime type --- votify/interface/video.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/votify/interface/video.py b/votify/interface/video.py index 83345d5..35f85e6 100644 --- a/votify/interface/video.py +++ b/votify/interface/video.py @@ -244,21 +244,19 @@ class SpotifyVideoInterface(SpotifyBaseInterface): profile_audio["file_type"], ) - is_webm = any( - profile["mime_type"].endswith("webm") - for profile in [profile_video, profile_audio] - ) + is_webm = lambda profile: profile["mime_type"].endswith("webm") stream_info = StreamInfoAv( audio_track=StreamInfo( stream_url=audio_urls, widevine_pssh=widevine_pssh, + file_format="webm" if is_webm(profile_audio) else "m4a", ), video_track=StreamInfo( stream_url=video_urls, widevine_pssh=widevine_pssh, + file_format="webm" if is_webm(profile_video) else "mp4", ), - file_format="webm" if is_webm else "mp4", ) logger.debug(f"Generated stream info: {stream_info}")