1 from __future__ import unicode_literals
3 from .common import InfoExtractor
9 from ..compat import compat_str
12 class HitRecordIE(InfoExtractor):
13 _VALID_URL = r'https?://(?:www\.)?hitrecord\.org/records/(?P<id>\d+)'
16 'url': 'https://hitrecord.org/records/2954362',
17 'md5': 'fe1cdc2023bce0bbb95c39c57426aa71',
21 'title': 'A Very Different World (HITRECORD x ACLU)',
22 'description': 'md5:e62defaffab5075a5277736bead95a3d',
23 'release_date': '20160818',
24 'timestamp': 1471557582,
25 'uploader': 'Zuzi.C12',
26 'uploader_id': '362811',
30 def _real_extract(self, url):
31 video_id = self._match_id(url)
32 video_info = self._download_json('https://hitrecord.org/api/web/records/' + video_id, video_id)
33 user_info = video_info.get('user', {})
37 'title': video_info['title'],
38 'url': video_info['source_url']['mp4_url'],
39 'description': clean_html(video_info.get('body')),
40 'uploader': user_info.get('username'),
41 'uploader_id': compat_str(user_info.get('id')),
42 'release_date': unified_strdate(video_info.get('created_at')),
43 'timestamp': video_info.get('created_at_i'),
44 'view_count': int_or_none(video_info.get('total_views_count')),
45 'like_count': int_or_none(video_info.get('hearts_count')),
46 'comment_count': int_or_none(video_info.get('comments_count')),
47 'tags': [tag.get('text') for tag in video_info.get('tags', [])],