diff options
author | Remita Amine <remitamine@gmail.com> | 2019-10-22 17:53:47 +0100 |
---|---|---|
committer | Remita Amine <remitamine@gmail.com> | 2019-10-22 17:59:14 +0100 |
commit | 07154c793065bca816793186590d8d6461e07478 (patch) | |
tree | c2a4cc0c2c5a6764858000d6570326343955e47a /youtube_dl/extractor/facebook.py | |
parent | 0c2d10d225f61ac1fb534d8ed1788250401465b2 (diff) | |
download | youtube-dl-07154c793065bca816793186590d8d6461e07478.tar.gz youtube-dl-07154c793065bca816793186590d8d6461e07478.tar.xz youtube-dl-07154c793065bca816793186590d8d6461e07478.zip |
[facebook] extract subtitles(closes #22777)
Diffstat (limited to 'youtube_dl/extractor/facebook.py')
-rw-r--r-- | youtube_dl/extractor/facebook.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/extractor/facebook.py b/youtube_dl/extractor/facebook.py index a56f85c21..c723726b7 100644 --- a/youtube_dl/extractor/facebook.py +++ b/youtube_dl/extractor/facebook.py @@ -379,6 +379,7 @@ class FacebookIE(InfoExtractor): if not video_data: raise ExtractorError('Cannot parse data') + subtitles = {} formats = [] for f in video_data: format_id = f['stream_type'] @@ -402,6 +403,9 @@ class FacebookIE(InfoExtractor): if dash_manifest: formats.extend(self._parse_mpd_formats( compat_etree_fromstring(compat_urllib_parse_unquote_plus(dash_manifest)))) + subtitles_src = f[0].get('subtitles_src') + if subtitles_src: + subtitles.setdefault('en', []).append({'url': subtitles_src}) if not formats: raise ExtractorError('Cannot find video formats') @@ -447,6 +451,7 @@ class FacebookIE(InfoExtractor): 'timestamp': timestamp, 'thumbnail': thumbnail, 'view_count': view_count, + 'subtitles': subtitles, } return webpage, info_dict |