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 21, 2023
1 parent 31e28cc commit 1e973df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yt_dlp/extractor/facebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ def extract_metadata(webpage):
is_video_broadcast = get_first(snippet, 'is_video_broadcast', expected_type=bool)
automatic_captions = {}
subtitles = {}
if isinstance(captions, str):
subtitles[locale] = [{'ext': determine_ext(captions, default_ext='srt'), 'url': captions}]
if url_or_none(captions): # snippet only had 'captions_url'
subtitles[locale] = [{'url': captions}]
elif isinstance(captions, list):
if len(captions) > 1:
captions = sorted(captions, key=lambda c: (c['locale'] != locale, c['locale']))
Expand Down

0 comments on commit 1e973df

Please sign in to comment.