From 4c84e32fd361e3ea07bd9928bdc7b57297aa37f9 Mon Sep 17 00:00:00 2001 From: doe1080 <98906116+doe1080@users.noreply.github.com> Date: Fri, 27 Jun 2025 02:23:20 +0900 Subject: [PATCH] WebSocketResponse --- yt_dlp/downloader/niconico.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yt_dlp/downloader/niconico.py b/yt_dlp/downloader/niconico.py index 86cd2e6c8..311914020 100644 --- a/yt_dlp/downloader/niconico.py +++ b/yt_dlp/downloader/niconico.py @@ -5,6 +5,7 @@ from .common import FileDownloader from .external import FFmpegFD from ..networking import Request +from ..networking.websocket import WebSocketResponse from ..utils import DownloadError, str_or_none, truncate_string from ..utils.traversal import traverse_obj @@ -22,7 +23,7 @@ def real_download(self, filename, info_dict): new_info_dict['protocol'] = 'm3u8' def communicate_ws(reconnect): - if reconnect: + if reconnect or not isinstance(ws_extractor, WebSocketResponse): ws = self.ydl.urlopen(Request( ws_url, headers={'Origin': 'https://live.nicovideo.jp'})) if self.ydl.params.get('verbose', False):