Compare commits

...

2 Commits

Author SHA1 Message Date
kclauhk
3cec965e01
Update yt_dlp/extractor/facebook.py
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2024-01-28 15:33:43 +08:00
kclauhk
f78159eb3d
Update yt_dlp/extractor/facebook.py
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2024-01-28 15:12:28 +08:00

View File

@ -605,7 +605,7 @@ class FacebookIE(InfoExtractor):
extract_dash_manifest(video, formats) extract_dash_manifest(video, formats)
automatic_captions, subtitles = {}, {} automatic_captions, subtitles = {}, {}
is_video_broadcast = get_first([video], 'is_video_broadcast', expected_type=bool) is_video_broadcast = traverse_obj(video, ('is_video_broadcast', {bool}))
captions = (traverse_obj(video, captions = (traverse_obj(video,
('video_available_captions_locales', lambda _, v: 'captions_url' in v)) ('video_available_captions_locales', lambda _, v: 'captions_url' in v))
or video.get('captions_url')) or video.get('captions_url'))
@ -674,8 +674,8 @@ class FacebookIE(InfoExtractor):
for edge in edges: for edge in edges:
parse_attachment(edge, key='node') parse_attachment(edge, key='node')
video = (traverse_obj(data, ('event', 'cover_media_renderer', 'cover_video', {dict})) # event cover video video = traverse_obj(data, (
or data.get('video') or {}) 'event', 'cover_media_renderer', 'cover_video'), 'video', expected_type=dict) or {}
if video: if video:
attachments = try_get(video, [ attachments = try_get(video, [
lambda x: x['story']['attachments'], lambda x: x['story']['attachments'],