mirror of
https://github.com/l1ving/youtube-dl
synced 2024-12-21 17:32:53 +08:00
[facebook] Move the title extraction warning below (fixes #5820)
This commit is contained in:
parent
42833b44b5
commit
db3ca36403
@ -50,7 +50,10 @@ class FacebookIE(InfoExtractor):
|
|||||||
'id': '274175099429670',
|
'id': '274175099429670',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Facebook video #274175099429670',
|
'title': 'Facebook video #274175099429670',
|
||||||
}
|
},
|
||||||
|
'expected_warnings': [
|
||||||
|
'title'
|
||||||
|
]
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://www.facebook.com/video.php?v=10204634152394104',
|
'url': 'https://www.facebook.com/video.php?v=10204634152394104',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
@ -150,11 +153,11 @@ class FacebookIE(InfoExtractor):
|
|||||||
|
|
||||||
video_title = self._html_search_regex(
|
video_title = self._html_search_regex(
|
||||||
r'<h2 class="uiHeaderTitle">([^<]*)</h2>', webpage, 'title',
|
r'<h2 class="uiHeaderTitle">([^<]*)</h2>', webpage, 'title',
|
||||||
fatal=False)
|
default=None)
|
||||||
if not video_title:
|
if not video_title:
|
||||||
video_title = self._html_search_regex(
|
video_title = self._html_search_regex(
|
||||||
r'(?s)<span class="fbPhotosPhotoCaption".*?id="fbPhotoPageCaption"><span class="hasCaption">(.*?)</span>',
|
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)
|
video_title = limit_length(video_title, 80)
|
||||||
if not video_title:
|
if not video_title:
|
||||||
video_title = 'Facebook video #%s' % video_id
|
video_title = 'Facebook video #%s' % video_id
|
||||||
|
Loading…
Reference in New Issue
Block a user