[facebook] Add count of views
This commit is contained in:
parent
e06632e3fe
commit
c1b2396dd7
@ -307,7 +307,6 @@ class FacebookIE(InfoExtractor):
|
|||||||
req = sanitized_Request(url)
|
req = sanitized_Request(url)
|
||||||
req.add_header('User-Agent', self._CHROME_USER_AGENT)
|
req.add_header('User-Agent', self._CHROME_USER_AGENT)
|
||||||
webpage = self._download_webpage(req, video_id)
|
webpage = self._download_webpage(req, video_id)
|
||||||
|
|
||||||
video_data = None
|
video_data = None
|
||||||
|
|
||||||
def extract_video_data(instances):
|
def extract_video_data(instances):
|
||||||
@ -426,6 +425,10 @@ class FacebookIE(InfoExtractor):
|
|||||||
'timestamp', default=None))
|
'timestamp', default=None))
|
||||||
thumbnail = self._og_search_thumbnail(webpage)
|
thumbnail = self._og_search_thumbnail(webpage)
|
||||||
|
|
||||||
|
view_count = re.sub("[^0-9]", "", self._search_regex(
|
||||||
|
r'viewCount\s*:\s*"([^"]+)"', webpage, 'view_count1',
|
||||||
|
fatal=False))
|
||||||
|
|
||||||
info_dict = {
|
info_dict = {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': video_title,
|
'title': video_title,
|
||||||
@ -433,6 +436,7 @@ class FacebookIE(InfoExtractor):
|
|||||||
'uploader': uploader,
|
'uploader': uploader,
|
||||||
'timestamp': timestamp,
|
'timestamp': timestamp,
|
||||||
'thumbnail': thumbnail,
|
'thumbnail': thumbnail,
|
||||||
|
'view_count': int(view_count),
|
||||||
}
|
}
|
||||||
|
|
||||||
return webpage, info_dict
|
return webpage, info_dict
|
||||||
|
Loading…
x
Reference in New Issue
Block a user