From bc87ebfc00a061be70796aefb4ca6466fa93f38a Mon Sep 17 00:00:00 2001 From: Rafael Moraes <50295204+glomatico@users.noreply.github.com> Date: Wed, 25 Feb 2026 22:01:52 -0300 Subject: [PATCH] Detect WebM from profiles and set format --- votify/interface/video.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/votify/interface/video.py b/votify/interface/video.py index 7fe45aa..83345d5 100644 --- a/votify/interface/video.py +++ b/votify/interface/video.py @@ -244,6 +244,11 @@ class SpotifyVideoInterface(SpotifyBaseInterface): profile_audio["file_type"], ) + is_webm = any( + profile["mime_type"].endswith("webm") + for profile in [profile_video, profile_audio] + ) + stream_info = StreamInfoAv( audio_track=StreamInfo( stream_url=audio_urls, @@ -253,7 +258,7 @@ class SpotifyVideoInterface(SpotifyBaseInterface): stream_url=video_urls, widevine_pssh=widevine_pssh, ), - file_format="mp4" if self.video_format == VideoFormat.MP4 else "webm", + file_format="webm" if is_webm else "mp4", ) logger.debug(f"Generated stream info: {stream_info}")