From cd0bd815ae1811b7fa1fe002f7b507d929797984 Mon Sep 17 00:00:00 2001 From: Atsushi2965 Date: Fri, 8 Aug 2025 00:24:04 +0900 Subject: [PATCH] [twitter:spaces] Change from m4a to aac Under advice by @bashonly https://discord.com/channels/807245652072857610/808027148308840478/1403031957910323380 --- yt_dlp/downloader/twitter.py | 2 +- yt_dlp/extractor/twitter.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yt_dlp/downloader/twitter.py b/yt_dlp/downloader/twitter.py index d01df98a1b..fa706e3140 100644 --- a/yt_dlp/downloader/twitter.py +++ b/yt_dlp/downloader/twitter.py @@ -9,7 +9,7 @@ def _read_fragment(self, ctx): idx = frag_content.find(bytes( [0x49, 0x44, 0x33, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x50, 0x52, 0x49, 0x56])) if idx > 0: - self.to_screen(f'[{self.FD_NAME}] Removing partial header ({idx} bytes)') + # self.to_screen(f'[{self.FD_NAME}] Removing partial header ({idx} bytes)') return frag_content[idx:] else: return frag_content diff --git a/yt_dlp/extractor/twitter.py b/yt_dlp/extractor/twitter.py index dae0780183..a20ece6f19 100644 --- a/yt_dlp/extractor/twitter.py +++ b/yt_dlp/extractor/twitter.py @@ -1852,7 +1852,7 @@ def _real_extract(self, url): ('source', ('noRedirectPlaybackUrl', 'location'), {url_or_none}), get_all=False) is_audio_space = source and 'audio-space' in source formats = self._extract_m3u8_formats( - source, metadata['media_key'], 'm4a' if is_audio_space else 'mp4', + source, metadata['media_key'], 'aac' if is_audio_space else 'mp4', # XXX: Some audio-only Spaces need to truncate heads of their fragments, not only ffmpeg as downloader entry_protocol='twitter_spaces' if is_audio_space else 'm3u8_native', live=is_live, headers=headers, fatal=False) if source else []