From e720e8879daaebd368a7aad1708397d5e36732e0 Mon Sep 17 00:00:00 2001 From: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:56:03 +0000 Subject: [PATCH] do not rename protocol; add conditions to FFmpegFixupM3u8PP --- yt_dlp/YoutubeDL.py | 3 ++- yt_dlp/downloader/__init__.py | 2 +- yt_dlp/extractor/niconico.py | 2 +- yt_dlp/postprocessor/ffmpeg.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 9691a1ea7c..a571f4ede3 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -3546,7 +3546,8 @@ class YoutubeDL: 'writing DASH m4a. Only some players support this container', FFmpegFixupM4aPP) ffmpeg_fixup(downloader == 'hlsnative' and not self.params.get('hls_use_mpegts') - or info_dict.get('is_live') and self.params.get('hls_use_mpegts') is None, + or info_dict.get('is_live') and self.params.get('hls_use_mpegts') is None + or downloader == 'niconico_live', 'Possible MPEG-TS in MP4 container or malformed AAC timestamps', FFmpegFixupM3u8PP) ffmpeg_fixup(downloader == 'dashsegments' diff --git a/yt_dlp/downloader/__init__.py b/yt_dlp/downloader/__init__.py index 9f6385058c..51a9f28f06 100644 --- a/yt_dlp/downloader/__init__.py +++ b/yt_dlp/downloader/__init__.py @@ -50,7 +50,7 @@ PROTOCOL_MAP = { 'ism': IsmFD, 'mhtml': MhtmlFD, 'niconico_dmc': NiconicoDmcFD, - 'm3u8_niconico_live': NiconicoLiveFD, + 'niconico_live': NiconicoLiveFD, 'fc2_live': FC2LiveFD, 'websocket_frag': WebSocketFragmentFD, 'youtube_live_chat': YoutubeLiveChatFD, diff --git a/yt_dlp/extractor/niconico.py b/yt_dlp/extractor/niconico.py index 9649329327..11d23f5af1 100644 --- a/yt_dlp/extractor/niconico.py +++ b/yt_dlp/extractor/niconico.py @@ -1007,7 +1007,7 @@ class NiconicoLiveIE(NiconicoBaseIE): for fmt, q in zip(formats, reversed(qualities[1:])): fmt.update({ 'format_id': q, - 'protocol': 'm3u8_niconico_live', + 'protocol': 'niconico_live', }) yield fmt diff --git a/yt_dlp/postprocessor/ffmpeg.py b/yt_dlp/postprocessor/ffmpeg.py index 164c46d143..422aab8242 100644 --- a/yt_dlp/postprocessor/ffmpeg.py +++ b/yt_dlp/postprocessor/ffmpeg.py @@ -888,7 +888,7 @@ class FFmpegFixupM4aPP(FFmpegFixupPostProcessor): class FFmpegFixupM3u8PP(FFmpegFixupPostProcessor): def _needs_fixup(self, info): yield info['ext'] in ('mp4', 'm4a') - yield info['protocol'].startswith('m3u8') + yield info['protocol'].startswith('m3u8') or info['protocol'] == 'niconico_live' try: metadata = self.get_metadata_object(info['filepath']) except PostProcessingError as e: