From b1e60d1806d845ab79cfde7853349d458f8c3c00 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Fri, 2 Jul 2021 07:44:11 +0530 Subject: [PATCH] [facebook] Extract description and fix title Partially fixes: #453 --- yt_dlp/extractor/facebook.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/yt_dlp/extractor/facebook.py b/yt_dlp/extractor/facebook.py index f55845720..d0295c881 100644 --- a/yt_dlp/extractor/facebook.py +++ b/yt_dlp/extractor/facebook.py @@ -629,16 +629,11 @@ class FacebookIE(InfoExtractor): process_formats(formats) + description = self._html_search_meta('description', webpage, default=None) video_title = self._html_search_regex( - r']*class="uiHeaderTitle"[^>]*>([^<]*)', webpage, - 'title', default=None) - if not video_title: - video_title = self._html_search_regex( - r'(?s)(.*?)', - webpage, 'alternative title', default=None) - if not video_title: - video_title = self._html_search_meta( - 'description', webpage, 'title', default=None) + (r']*class="uiHeaderTitle"[^>]*>([^<]*)', + r'(?s)(.*?)'), + webpage, 'title', default=None) or self._og_search_title(webpage, default=None) or description if video_title: video_title = limit_length(video_title, 80) else: @@ -662,6 +657,7 @@ class FacebookIE(InfoExtractor): 'formats': formats, 'uploader': uploader, 'timestamp': timestamp, + 'description': description, 'thumbnail': thumbnail, 'view_count': view_count, 'subtitles': subtitles,