]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/hitrecord.py
1 from .common
import InfoExtractor
2 from ..compat
import compat_str
11 class HitRecordIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:www\.)?hitrecord\.org/records/(?P<id>\d+)'
14 'url': 'https://hitrecord.org/records/2954362',
15 'md5': 'fe1cdc2023bce0bbb95c39c57426aa71',
19 'title': 'A Very Different World (HITRECORD x ACLU)',
20 'description': 'md5:e62defaffab5075a5277736bead95a3d',
22 'timestamp': 1471557582,
23 'upload_date': '20160818',
24 'uploader': 'Zuzi.C12',
25 'uploader_id': '362811',
33 def _real_extract(self
, url
):
34 video_id
= self
._match
_id
(url
)
36 video
= self
._download
_json
(
37 'https://hitrecord.org/api/web/records/%s' % video_id
, video_id
)
39 title
= video
['title']
40 video_url
= video
['source_url']['mp4_url']
43 tags_list
= try_get(video
, lambda x
: x
['tags'], list)
48 if isinstance(t
, dict) and t
.get('text')
49 and isinstance(t
['text'], compat_str
)]
55 'description': clean_html(video
.get('body')),
56 'duration': float_or_none(video
.get('duration'), 1000),
57 'timestamp': int_or_none(video
.get('created_at_i')),
59 video
, lambda x
: x
['user']['username'], compat_str
),
60 'uploader_id': try_get(
61 video
, lambda x
: compat_str(x
['user']['id'])),
62 'view_count': int_or_none(video
.get('total_views_count')),
63 'like_count': int_or_none(video
.get('hearts_count')),
64 'comment_count': int_or_none(video
.get('comments_count')),