adding option for views extraction
This commit is contained in:
parent
1f52df87c3
commit
2b594af6f0
@ -490,7 +490,7 @@ class FacebookIE(InfoExtractor):
|
|||||||
self._search_regex(r'[\'\"]viewerCount[\'\"]\s*:\s*(\d+)', tahoe_data.primary, 'views', fatal=False)
|
self._search_regex(r'[\'\"]viewerCount[\'\"]\s*:\s*(\d+)', tahoe_data.primary, 'views', fatal=False)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
view_count = parse_count(self._extract_meta_count(['postViewCount', 'viewCount'], webpage, tahoe_data, 'likes'))
|
view_count = parse_count(self._extract_views(webpage, tahoe_data))
|
||||||
|
|
||||||
other_posts_view_count = parse_count(self._extract_meta_count(['otherPostsViewCount'], webpage, tahoe_data, 'other_post_views'))
|
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))
|
likes_count = parse_count(self._extract_likes(webpage, tahoe_data))
|
||||||
@ -552,6 +552,15 @@ class FacebookIE(InfoExtractor):
|
|||||||
if values:
|
if values:
|
||||||
return values[-1]
|
return values[-1]
|
||||||
|
|
||||||
|
def _extract_views(self, webpage, tahoe_data):
|
||||||
|
value = self._extract_meta_count(['postViewCount', 'viewCount'], webpage, tahoe_data, 'likes')
|
||||||
|
if value:
|
||||||
|
return value
|
||||||
|
|
||||||
|
values = re.findall(r'(\d+\w?) Views', tahoe_data.secondary)
|
||||||
|
if values:
|
||||||
|
return values[-1]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user