diff --git a/test/ci/test_facebook.py b/test/ci/test_facebook.py index 1cc564518..a6750ce43 100644 --- a/test/ci/test_facebook.py +++ b/test/ci/test_facebook.py @@ -28,11 +28,13 @@ class facebookMetaData(unittest.TestCase): def test_meta_data(self): params = {} - url = "https://www.facebook.com/parapsychological.centr/videos/177407933624543/" + url = "https://www.facebook.com/watch?v=925616657920281" ydl = youtube_dl.YoutubeDL(params) info = ydl.extract_info(url, download=False) self.assertGreater(info.get('comment_count'), 0) self.assertTrue(info.get('uploader_handle'), 0) + self.assertGreater(len(info.get('title')), 0) + def test_metadata_fetch_with_log_in(self): url = "https://www.facebook.com/oristandup/videos/675360549895283" diff --git a/youtube_dl/extractor/facebook.py b/youtube_dl/extractor/facebook.py index 1abcf8d62..141a4f3e4 100644 --- a/youtube_dl/extractor/facebook.py +++ b/youtube_dl/extractor/facebook.py @@ -693,6 +693,9 @@ class FacebookIE(InfoExtractor): video_title = self._og_search_title(webpage, default=None) if not self._valid_video_title(video_title): video_title = self._resolve_description(webpage, tahoe_data) + if not self._valid_video_title(video_title): + video_title = self._html_search_regex(r'"videoTitle":"(.+?")', tahoe_data.secondary, 'title from secondary', default=None) + video_title = video_title.decode('unicode_escape') if not self._valid_video_title(video_title): values = re.findall(r'videoTitle"\s*:\s*"(.*?)"', tahoe_data.secondary) if values: