mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-06-27 17:08:32 +00:00
Merge a470393956
into 06c1a8cdff
This commit is contained in:
commit
544135af46
@ -32,6 +32,7 @@
|
||||
|
||||
|
||||
class FacebookIE(InfoExtractor):
|
||||
_MAX_TITLE_LENGTH = 20 # Maximum title length for the video
|
||||
_VALID_URL = r'''(?x)
|
||||
(?:
|
||||
https?://
|
||||
@ -541,6 +542,9 @@ def extract_metadata(webpage):
|
||||
info_json_ld = self._search_json_ld(webpage, video_id, default={})
|
||||
info_json_ld['title'] = (re.sub(r'\s*\|\s*Facebook$', '', title or info_json_ld.get('title') or page_title or '')
|
||||
or (description or '').replace('\n', ' ') or f'Facebook video #{video_id}')
|
||||
if len(info_json_ld.get('title')) > FacebookIE._MAX_TITLE_LENGTH:
|
||||
self.report_warning(f'Truncating title to {FacebookIE._MAX_TITLE_LENGTH} characters')
|
||||
info_json_ld['title'] = info_json_ld.get('title')[: FacebookIE._MAX_TITLE_LENGTH - 3] + '...'
|
||||
return merge_dicts(info_json_ld, info_dict)
|
||||
|
||||
video_data = None
|
||||
|
Loading…
Reference in New Issue
Block a user