Facebook Closed Captions not included as subtitles #26613

Open
opened 2026-02-21 14:24:05 -05:00 by deekerman · 2 comments
Owner

Originally created by @Kumole on GitHub (Jul 31, 2023).

Checklist

  • I'm reporting a site feature request
  • I've verified that I'm running youtube-dl version 2021.12.17
  • I've searched the bugtracker for similar site feature requests including closed ones

Description

Facebook videos with closed captions do not show up as subtitles when using the commands ">youtube-dl --list-subs" or ">youtube-dl --write-sub".
Example video with closed captions for deaf people: https://fb.watch/m7ChEhVZPt/

Originally created by @Kumole on GitHub (Jul 31, 2023). <!-- ###################################################################### WARNING! IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE ###################################################################### --> ## Checklist <!-- Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl: - First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2021.12.17. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED. - Search the bugtracker for similar site feature requests: http://yt-dl.org/search-issues. DO NOT post duplicates. - Finally, put x into all relevant boxes (like this [x]) --> - [x] I'm reporting a site feature request - [x] I've verified that I'm running youtube-dl version **2021.12.17** - [x] I've searched the bugtracker for similar site feature requests including closed ones ## Description <!-- Provide an explanation of your site feature request in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. Provide any additional information, suggested solution and as much context and examples as possible. --> Facebook videos with closed captions do not show up as subtitles when using the commands ">youtube-dl --list-subs" or ">youtube-dl --write-sub". Example video with closed captions for deaf people: https://fb.watch/m7ChEhVZPt/
Author
Owner

@dirkf commented on GitHub (Jul 31, 2023):

On the positive side, FB extraction is actually working. yt-dlp also fails to find the CC as subtitles.

Is FB serving actual text, or are there different versions of the video, one/some with burned-in subtitles?

@dirkf commented on GitHub (Jul 31, 2023): On the positive side, FB extraction is actually working. yt-dlp also fails to find the CC as subtitles. Is FB serving actual text, or are there different versions of the video, one/some with burned-in subtitles?
Author
Owner

@dirkf commented on GitHub (Jul 31, 2023):

OK, I had a look.

There is a og:locale element in the page that supplies a default language. In the video JSON, there is a captions_url that one can associate with that language. There is also a video_available_captions_locales list with each element being one combination of language, subtitle_type, URL.

After a bit of tweaking, this happened:

$ python -m youtube_dl --list-sub 'https://fb.watch/m7ChEhVZPt/'
[generic] m7ChEhVZPt: Requesting header
[redirect] Following redirect to https://www.facebook.com/CCaptions/videos/410568766182023/
[facebook] 410568766182023: Downloading webpage
[download] Downloading playlist: 410568766182023
[facebook] playlist 410568766182023: Collected 1 video ids (downloading 1 of them)
[download] Downloading video 1 of 1
Available automatic captions for 410568766182023:
Language formats
en-US    srt
410568766182023 has no subtitles
[download] Finished downloading playlist: 410568766182023
$

The URL of those auto-generated subtitles was https://scontent.flhr10-2.fna.fbcdn.net/v/t39.2093-6/51501946_410570236181876_6099645393375592448_n.srt?_nc_cat=101&ccb=1-7&_nc_sid=8d539b&_nc_ohc=BqCVL4SVRo4AX9YiNpF&_nc_ht=scontent.flhr10-2.fna&oh=00_AfDlM7XF7AqsJ-i3cpY0FISX2xLjKgw9vMhMD8s9-ffE7A&oe=64CD04B6.

@dirkf commented on GitHub (Jul 31, 2023): OK, I had a look. There is a `og:locale` element in the page that supplies a default language. In the video JSON, there is a `captions_url` that one can associate with that language. There is also a `video_available_captions_locales` list with each element being one combination of language, subtitle_type, URL. After a bit of tweaking, this happened: ```console $ python -m youtube_dl --list-sub 'https://fb.watch/m7ChEhVZPt/' [generic] m7ChEhVZPt: Requesting header [redirect] Following redirect to https://www.facebook.com/CCaptions/videos/410568766182023/ [facebook] 410568766182023: Downloading webpage [download] Downloading playlist: 410568766182023 [facebook] playlist 410568766182023: Collected 1 video ids (downloading 1 of them) [download] Downloading video 1 of 1 Available automatic captions for 410568766182023: Language formats en-US srt 410568766182023 has no subtitles [download] Finished downloading playlist: 410568766182023 $ ``` The URL of those auto-generated subtitles was https://scontent.flhr10-2.fna.fbcdn.net/v/t39.2093-6/51501946_410570236181876_6099645393375592448_n.srt?_nc_cat=101&ccb=1-7&_nc_sid=8d539b&_nc_ohc=BqCVL4SVRo4AX9YiNpF&_nc_ht=scontent.flhr10-2.fna&oh=00_AfDlM7XF7AqsJ-i3cpY0FISX2xLjKgw9vMhMD8s9-ffE7A&oe=64CD04B6.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#26613
No description provided.