mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-05-05 15:05:58 +00:00
refactor/dedent
This commit is contained in:
parent
3858f91075
commit
6d40e51689
@ -719,7 +719,7 @@ class BiliBiliIE(BilibiliBaseIE):
|
|||||||
self._get_interactive_entries(video_id, cid, metainfo, headers=headers), **metainfo,
|
self._get_interactive_entries(video_id, cid, metainfo, headers=headers), **metainfo,
|
||||||
duration=traverse_obj(initial_state, ('videoData', 'duration', {int_or_none})),
|
duration=traverse_obj(initial_state, ('videoData', 'duration', {int_or_none})),
|
||||||
__post_extractor=self.extract_comments(aid))
|
__post_extractor=self.extract_comments(aid))
|
||||||
else:
|
|
||||||
formats = self.extract_formats(play_info)
|
formats = self.extract_formats(play_info)
|
||||||
|
|
||||||
if video_data.get('is_upower_exclusive'):
|
if video_data.get('is_upower_exclusive'):
|
||||||
@ -734,7 +734,7 @@ class BiliBiliIE(BilibiliBaseIE):
|
|||||||
f'This is a supporter-only video, only the preview will be extracted: {msg}',
|
f'This is a supporter-only video, only the preview will be extracted: {msg}',
|
||||||
video_id=video_id)
|
video_id=video_id)
|
||||||
|
|
||||||
if not traverse_obj(play_info, ('dash')):
|
if not traverse_obj(play_info, 'dash'):
|
||||||
# we only have legacy formats and need additional work
|
# we only have legacy formats and need additional work
|
||||||
has_qn = lambda x: x in traverse_obj(formats, (..., 'quality'))
|
has_qn = lambda x: x in traverse_obj(formats, (..., 'quality'))
|
||||||
for qn in traverse_obj(play_info, ('accept_quality', lambda _, v: not has_qn(v), {int})):
|
for qn in traverse_obj(play_info, ('accept_quality', lambda _, v: not has_qn(v), {int})):
|
||||||
@ -778,7 +778,7 @@ class BiliBiliIE(BilibiliBaseIE):
|
|||||||
} for idx, fragment in enumerate(formats[0]['fragments'])],
|
} for idx, fragment in enumerate(formats[0]['fragments'])],
|
||||||
'duration': float_or_none(play_info.get('timelength'), scale=1000),
|
'duration': float_or_none(play_info.get('timelength'), scale=1000),
|
||||||
}
|
}
|
||||||
else:
|
|
||||||
return {
|
return {
|
||||||
**metainfo,
|
**metainfo,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user