mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-05-02 21:45:59 +00:00
[ie/bilibili] don't raise if the user has logged in as a supporter when downloading a supporter-only video
Warn the user when the preview is available
This commit is contained in:
parent
62cba8a1be
commit
db2cec839e
@ -652,12 +652,17 @@ class BiliBiliIE(BilibiliBaseIE):
|
|||||||
else:
|
else:
|
||||||
video_data = initial_state['videoData']
|
video_data = initial_state['videoData']
|
||||||
|
|
||||||
if video_data.get('is_upower_exclusive'):
|
if video_data.get('is_upower_exclusive') and not video_data.get('is_upower_play'):
|
||||||
high_level = traverse_obj(initial_state, ('elecFullInfo', 'show_info', 'high_level', {dict})) or {}
|
high_level = traverse_obj(initial_state, ('elecFullInfo', 'show_info', 'high_level', {dict})) or {}
|
||||||
raise ExtractorError(
|
msg = (
|
||||||
'This is a supporter-only video: '
|
|
||||||
f'{join_nonempty("title", "sub_title", from_dict=high_level, delim=",")}. '
|
f'{join_nonempty("title", "sub_title", from_dict=high_level, delim=",")}. '
|
||||||
f'{self._login_hint()}', expected=True)
|
f'{self._login_hint()}')
|
||||||
|
if video_data.get('is_upower_preview'):
|
||||||
|
self.report_warning(
|
||||||
|
f'This is a supporter-only video, only the preview will be extracted: {msg}',
|
||||||
|
video_id=video_id)
|
||||||
|
else:
|
||||||
|
raise ExtractorError(f'This is a supporter-only video: {msg}', expected=True)
|
||||||
|
|
||||||
video_id, title = video_data['bvid'], video_data.get('title')
|
video_id, title = video_data['bvid'], video_data.get('title')
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user