1 from .common
import InfoExtractor
10 class HitRecordIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://(?:www\.)?hitrecord\.org/records/(?P<id>\d+)'
13 'url': 'https://hitrecord.org/records/2954362',
14 'md5': 'fe1cdc2023bce0bbb95c39c57426aa71',
18 'title': 'A Very Different World (HITRECORD x ACLU)',
19 'description': 'md5:e62defaffab5075a5277736bead95a3d',
21 'timestamp': 1471557582,
22 'upload_date': '20160818',
23 'uploader': 'Zuzi.C12',
24 'uploader_id': '362811',
32 def _real_extract(self
, url
):
33 video_id
= self
._match
_id
(url
)
35 video
= self
._download
_json
(
36 f
'https://hitrecord.org/api/web/records/{video_id}', video_id
)
38 title
= video
['title']
39 video_url
= video
['source_url']['mp4_url']
42 tags_list
= try_get(video
, lambda x
: x
['tags'], list)
47 if isinstance(t
, dict) and t
.get('text')
48 and isinstance(t
['text'], str)]
54 'description': clean_html(video
.get('body')),
55 'duration': float_or_none(video
.get('duration'), 1000),
56 'timestamp': int_or_none(video
.get('created_at_i')),
58 video
, lambda x
: x
['user']['username'], str),
59 'uploader_id': try_get(
60 video
, lambda x
: str(x
['user']['id'])),
61 'view_count': int_or_none(video
.get('total_views_count')),
62 'like_count': int_or_none(video
.get('hearts_count')),
63 'comment_count': int_or_none(video
.get('comments_count')),