diff options
author | Sergey M․ <dstftw@gmail.com> | 2017-03-14 00:37:39 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2017-03-14 00:38:07 +0700 |
commit | 66bf351f8052fb71dce20c3a5ba1aa507532222e (patch) | |
tree | 8cf549d7bdf52382cbf1f659643b4d5cd99eba2c /youtube_dl/extractor | |
parent | 9d089630229e9d921da255fc6d3f671d307a0848 (diff) | |
download | youtube-dl-66bf351f8052fb71dce20c3a5ba1aa507532222e.tar.xz |
[facebook] Make title optional (closes #12443)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/facebook.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/youtube_dl/extractor/facebook.py b/youtube_dl/extractor/facebook.py index 6315d40c5..b69c1ede0 100644 --- a/youtube_dl/extractor/facebook.py +++ b/youtube_dl/extractor/facebook.py @@ -196,6 +196,10 @@ class FacebookIE(InfoExtractor): }, { 'url': 'https://www.facebookcorewwwi.onion/video.php?v=274175099429670', 'only_matching': True, + }, { + # no title + 'url': 'https://www.facebook.com/onlycleverentertainment/videos/1947995502095005/', + 'only_matching': True, }] @staticmethod @@ -353,15 +357,15 @@ class FacebookIE(InfoExtractor): self._sort_formats(formats) video_title = self._html_search_regex( - r'<h2\s+[^>]*class="uiHeaderTitle"[^>]*>([^<]*)</h2>', webpage, 'title', - default=None) + r'<h2\s+[^>]*class="uiHeaderTitle"[^>]*>([^<]*)</h2>', webpage, + 'title', 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) if not video_title: video_title = self._html_search_meta( - 'description', webpage, 'title') + 'description', webpage, 'title', default=None) if video_title: video_title = limit_length(video_title, 80) else: |