[mixcloud] View count and like count may be absent

Closes #9874
This commit is contained in:
Yen Chi Hsuan 2016-06-24 17:26:12 +08:00
parent c1ff6e1ad0
commit 896cc72750
No known key found for this signature in database
GPG Key ID: 3FDDD575826C5C30

View File

@ -102,11 +102,11 @@ class MixcloudIE(InfoExtractor):
description = self._og_search_description(webpage)
like_count = parse_count(self._search_regex(
r'\bbutton-favorite[^>]+>.*?<span[^>]+class=["\']toggle-number[^>]+>\s*([^<]+)',
webpage, 'like count', fatal=False))
webpage, 'like count', default=None))
view_count = str_to_int(self._search_regex(
[r'<meta itemprop="interactionCount" content="UserPlays:([0-9]+)"',
r'/listeners/?">([0-9,.]+)</a>'],
webpage, 'play count', fatal=False))
webpage, 'play count', default=None))
return {
'id': track_id,