fetch vimeo views
This commit is contained in:
parent
79fec976b0
commit
84d8366846
@ -353,6 +353,7 @@ class VimeoIE(VimeoBaseInfoExtractor):
|
|||||||
'timestamp': 1324343742,
|
'timestamp': 1324343742,
|
||||||
'upload_date': '20111220',
|
'upload_date': '20111220',
|
||||||
'description': 'md5:ae23671e82d05415868f7ad1aec21147',
|
'description': 'md5:ae23671e82d05415868f7ad1aec21147',
|
||||||
|
'view_count': int,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -641,12 +642,17 @@ class VimeoIE(VimeoBaseInfoExtractor):
|
|||||||
'timestamp', default=None)
|
'timestamp', default=None)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
view_count = int(self._search_regex(r'UserPlays:(\d+)', webpage, 'view count'))
|
# When userInteractionCount does not exist views is 0
|
||||||
|
view_count = int_or_none(
|
||||||
|
self._search_regex(
|
||||||
|
r'"interactionType":"http:\/\/schema\.org\/WatchAction","userInteractionCount":(.+?)}',
|
||||||
|
webpage, 'view count', default=0
|
||||||
|
)
|
||||||
|
)
|
||||||
like_count = int(self._search_regex(r'UserLikes:(\d+)', webpage, 'like count'))
|
like_count = int(self._search_regex(r'UserLikes:(\d+)', webpage, 'like count'))
|
||||||
comment_count = int(self._search_regex(r'UserComments:(\d+)', webpage, 'comment count'))
|
comment_count = int(self._search_regex(r'UserComments:(\d+)', webpage, 'comment count'))
|
||||||
except RegexNotFoundError:
|
except RegexNotFoundError:
|
||||||
# This info is only available in vimeo.com/{id} urls
|
# This info is only available in vimeo.com/{id} urls
|
||||||
view_count = None
|
|
||||||
like_count = None
|
like_count = None
|
||||||
comment_count = None
|
comment_count = None
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user