diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2015-05-26 13:37:15 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2015-05-26 13:41:38 +0800 |
commit | db3ca36403930063b7df3b228a3f297bf278b43c (patch) | |
tree | 60a1ea3af054ccf5f20f48b4892ffecc14018256 | |
parent | 42833b44b5e3810a2875dfb130aefbf5db057c1e (diff) |
[facebook] Move the title extraction warning below (fixes #5820)
-rw-r--r-- | youtube_dl/extractor/facebook.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/youtube_dl/extractor/facebook.py b/youtube_dl/extractor/facebook.py index 937b28fcc..e8d682716 100644 --- a/youtube_dl/extractor/facebook.py +++ b/youtube_dl/extractor/facebook.py @@ -50,7 +50,10 @@ class FacebookIE(InfoExtractor): 'id': '274175099429670', 'ext': 'mp4', 'title': 'Facebook video #274175099429670', - } + }, + 'expected_warnings': [ + 'title' + ] }, { 'url': 'https://www.facebook.com/video.php?v=10204634152394104', 'only_matching': True, @@ -150,11 +153,11 @@ class FacebookIE(InfoExtractor): video_title = self._html_search_regex( r'<h2 class="uiHeaderTitle">([^<]*)</h2>', webpage, 'title', - fatal=False) + default=None) if not video_title: video_title = self._html_search_regex( r'(?s)<span class="fbPhotosPhotoCaption".*?id="fbPhotoPageCaption"><span class="hasCaption">(.*?)</span>', - webpage, 'alternative title', default=None) + webpage, 'alternative title', fatal=False) video_title = limit_length(video_title, 80) if not video_title: video_title = 'Facebook video #%s' % video_id |