From f099df1463705a37c5aec0c8108b2b00750c9428 Mon Sep 17 00:00:00 2001 From: "Lesmiscore (Naoya Ozaki)" Date: Sun, 20 Feb 2022 20:48:26 +0900 Subject: [PATCH] [TwitCasting] Check for password protection (#2838) Authored by: Lesmiscore --- yt_dlp/extractor/twitcasting.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yt_dlp/extractor/twitcasting.py b/yt_dlp/extractor/twitcasting.py index 08222df959..af911de98f 100644 --- a/yt_dlp/extractor/twitcasting.py +++ b/yt_dlp/extractor/twitcasting.py @@ -94,6 +94,9 @@ class TwitCastingIE(InfoExtractor): urlh.geturl(), video_id, data=request_data, headers={'Origin': 'https://twitcasting.tv'}, note='Retrying authentication') + # has to check here as the first request can contain password input form even if the password is correct + if re.search(r'\s*]+?name="password"', webpage): + raise ExtractorError('This video is protected by a password, use the --video-password option', expected=True) title = (clean_html(get_element_by_id('movietitle', webpage)) or self._html_search_meta(['og:title', 'twitter:title'], webpage, fatal=True))