aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/twitcasting.py
diff options
context:
space:
mode:
authorLesmiscore (Naoya Ozaki) <nao20010128@gmail.com>2022-02-20 20:48:26 +0900
committerGitHub <noreply@github.com>2022-02-20 20:48:26 +0900
commitf099df1463705a37c5aec0c8108b2b00750c9428 (patch)
tree085b05022c2de45a189bf9128ef6e53269c09424 /yt_dlp/extractor/twitcasting.py
parent3f4faff74873003a07303fc1faff3e5969b9c508 (diff)
downloadhypervideo-pre-f099df1463705a37c5aec0c8108b2b00750c9428.tar.lz
hypervideo-pre-f099df1463705a37c5aec0c8108b2b00750c9428.tar.xz
hypervideo-pre-f099df1463705a37c5aec0c8108b2b00750c9428.zip
[TwitCasting] Check for password protection (#2838)
Authored by: Lesmiscore
Diffstat (limited to 'yt_dlp/extractor/twitcasting.py')
-rw-r--r--yt_dlp/extractor/twitcasting.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/yt_dlp/extractor/twitcasting.py b/yt_dlp/extractor/twitcasting.py
index 08222df95..af911de98 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'<form\s+method="POST">\s*<input\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))