Skip to content

Commit

Permalink
Update facebook.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kclauhk authored Nov 21, 2023
1 parent 98ee02d commit 23e2bc5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion yt_dlp/extractor/facebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
get_element_by_id,
get_first,
int_or_none,
join_nonempty,
js_to_json,
merge_dicts,
parse_count,
Expand Down Expand Up @@ -440,7 +441,8 @@ def extract_metadata(webpage):
automatic_captions.setdefault(caption['locale'], []).append(subs)
else:
subtitles.setdefault(caption['locale'], []).append(subs)
media = traverse_obj(post, (..., 'attachments', ..., lambda k, v: ( k == 'media' and str(v['id']) == video_id and v['__typename'] == 'Video')), expected_type=dict)
media = traverse_obj(post, (..., 'attachments', ..., lambda k, v: (
k == 'media' and str(v['id']) == video_id and v['__typename'] == 'Video')), expected_type=dict)
title = get_first(media, ('title', 'text'))
description = get_first(media, ('creation_story', 'comet_sections', 'message', 'story', 'message', 'text'))
uploader_data = (
Expand Down

0 comments on commit 23e2bc5

Please sign in to comment.