Skip to content

Commit

Permalink
Update yt_dlp/extractor/facebook.py
Browse files Browse the repository at this point in the history
Co-authored-by: bashonly <[email protected]>
  • Loading branch information
kclauhk and bashonly authored Nov 23, 2023
1 parent 9ac678f commit ef4737e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yt_dlp/extractor/facebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,9 @@ def extract_metadata(webpage):
subtitles = {}
if url_or_none(captions): # snippet only had 'captions_url'
subtitles[locale] = [{'url': captions}]
else:
captions = sorted(captions, key=lambda c: c['locale'])
for caption in traverse_obj(captions, lambda _, v: v['captions_url'] and v['locale']):
for caption in traverse_obj(captions, (
{lambda x: sorted(x, key=lambda c: c['locale'])}, lambda _, v: v['captions_url'])
):
subs = {
'url': caption['captions_url'],
'name': join_nonempty('localized_language', 'localized_country', from_dict=caption),
Expand Down

0 comments on commit ef4737e

Please sign in to comment.