From 5249b8ab4aa4eb90dd096c29cf500939ff054b59 Mon Sep 17 00:00:00 2001 From: sepro Date: Sun, 13 Jul 2025 00:32:47 +0200 Subject: [PATCH] Oops --- yt_dlp/extractor/mixlr.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yt_dlp/extractor/mixlr.py b/yt_dlp/extractor/mixlr.py index 1c8080865..54e3ada91 100644 --- a/yt_dlp/extractor/mixlr.py +++ b/yt_dlp/extractor/mixlr.py @@ -51,16 +51,16 @@ def _real_extract(self, url): if format_url: urlh = self._request_webpage( HEADRequest(format_url), event_id, fatal=False, note='Checking stream') - ext = urlhandle_detect_ext(urlh) - if ext == 'octet-stream': - self.report_warning( - 'The server did not return a valid file extension for the stream URL, ' - 'defaulting to "mp3". Please ensure that the downloaded audio is actually mp3.') - ext = 'mp3' - if urlh and urlh.status == 200: + if not urlh or urlh.status != 200: + ext = urlhandle_detect_ext(urlh) + if ext == 'octet-stream': + self.report_warning( + 'The server did not return a valid file extension for the stream URL, ' + 'defaulting to "mp3". Please ensure that the downloaded audio is actually mp3.') + ext = 'mp3' formats.append({ 'url': format_url, - 'ext': urlhandle_detect_ext(urlh), + 'ext': ext, 'vcodec': 'none', })