Compare commits

..

2 Commits

Author SHA1 Message Date
kclauhk
dd9256d832
revert 'thumbnails': [{'url': thumbnail}]... 2024-01-28 20:21:57 +08:00
kclauhk
667305ebfe
Update yt_dlp/extractor/facebook.py
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2024-01-28 20:18:33 +08:00

View File

@ -515,7 +515,7 @@ class FacebookIE(InfoExtractor):
'uploader': uploader, 'uploader': uploader,
'uploader_id': uploader_data.get('id'), 'uploader_id': uploader_data.get('id'),
'timestamp': timestamp, 'timestamp': timestamp,
'thumbnails': [{'url': thumbnail}] if url_or_none(thumbnail) else [], 'thumbnail': thumbnail,
'view_count': parse_count(self._search_regex( 'view_count': parse_count(self._search_regex(
(r'\bviewCount\s*:\s*["\']([\d,.]+)', r'video_view_count["\']\s*:\s*(\d+)',), (r'\bviewCount\s*:\s*["\']([\d,.]+)', r'video_view_count["\']\s*:\s*(\d+)',),
webpage, 'view count', default=None)), webpage, 'view count', default=None)),
@ -680,11 +680,7 @@ class FacebookIE(InfoExtractor):
webpage_info['duration'] = video_info['duration'] webpage_info['duration'] = video_info['duration']
# preserve preferred_thumbnail in video info # preserve preferred_thumbnail in video info
if video_info.get('thumbnail'): if video_info.get('thumbnail'):
if not [x for x in webpage_info['thumbnails'] if video_info['thumbnail'].split('?')[0] in x['url']]: webpage_info['thumbnail'] = video_info['thumbnail']
webpage_info['thumbnails'].append({
'url': video_info['thumbnail'],
'preference': 1
})
return merge_dicts(webpage_info, video_info) return merge_dicts(webpage_info, video_info)
if not video_data: if not video_data: