From d944ca970a9d4178442d9c7e3d22fe9ff3d1ed70 Mon Sep 17 00:00:00 2001 From: doe1080 <98906116+doe1080@users.noreply.github.com> Date: Sun, 17 Aug 2025 04:31:23 +0900 Subject: [PATCH] fix --- yt_dlp/extractor/niconico.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/niconico.py b/yt_dlp/extractor/niconico.py index aeda5e418f..391eba2bea 100644 --- a/yt_dlp/extractor/niconico.py +++ b/yt_dlp/extractor/niconico.py @@ -921,6 +921,9 @@ class NiconicoLiveIE(NiconicoBaseIE): age_limit = 18 if 'age_auth' in urlh.url else None if age_limit: + if not self.is_logged_in: + self.raise_login_required('Login is required to access age-restricted content') + my = self._download_webpage('https://www.nicovideo.jp/my', None, 'Checking age verification') if traverse_obj(my, ( {find_element(id='js-initial-userpage-data', html=True)}, {extract_attributes}, @@ -929,7 +932,7 @@ class NiconicoLiveIE(NiconicoBaseIE): self._set_cookie('.nicovideo.jp', 'age_auth', '1') webpage = self._download_webpage(url, video_id) else: - raise ExtractorError('Age restricted content', expected=True) + raise ExtractorError('Sensitive content setting must be enabled', expected=True) embedded_data = traverse_obj(webpage, ( {find_element(tag='script', id='embedded-data', html=True)},