diff --git a/youtube_dl/extractor/facebook.py b/youtube_dl/extractor/facebook.py index b41c040dc..4fe9bd01a 100644 --- a/youtube_dl/extractor/facebook.py +++ b/youtube_dl/extractor/facebook.py @@ -494,8 +494,8 @@ class FacebookIE(InfoExtractor): other_posts_view_count = parse_count(self._extract_meta_count(['otherPostsViewCount'], webpage, tahoe_data, 'other_post_views')) likes_count = parse_count(self._extract_likes(webpage, tahoe_data)) - shares_count = parse_count(self._extract_meta_count(['sharecount'], webpage, tahoe_data, 'shares')) comment_count = parse_count(self._extract_meta_count(['commentCount'], webpage, tahoe_data, 'shares')) + shares_count = parse_count(self._extract_shares(webpage, tahoe_data)) info_dict = { 'id': video_id, @@ -556,6 +556,15 @@ class FacebookIE(InfoExtractor): if values: return values[-1] + def _extract_shares(self, webpage, tahoe_data): + value = self._extract_meta_count(['sharecount'], webpage, tahoe_data, 'shares') + if value: + return value + a = r'(\d+\w) Views' + values = re.findall(r'"share_count"\s*:\s*{\s*"count"\s*:\s*(\d+)', tahoe_data.secondary) + if values: + return values[-1] + def _extract_views(self, webpage, tahoe_data): value = self._extract_meta_count(['postViewCount', 'viewCount'], webpage, tahoe_data, 'likes') if value: