1 from .common
import InfoExtractor
2 from ..utils
import int_or_none
5 class HypemIE(InfoExtractor
):
6 _VALID_URL
= r
'https?://(?:www\.)?hypem\.com/track/(?P<id>[0-9a-z]{5})'
8 'url': 'http://hypem.com/track/1v6ga/BODYWORK+-+TAME',
9 'md5': 'b9cc91b5af8995e9f0c1cee04c575828',
14 'uploader': 'BODYWORK',
15 'timestamp': 1371810457,
16 'upload_date': '20130621',
20 def _real_extract(self
, url
):
21 track_id
= self
._match
_id
(url
)
23 response
= self
._download
_webpage
(url
, track_id
)
25 track
= self
._parse
_json
(self
._html
_search
_regex
(
26 r
'(?s)<script\s+type="application/json"\s+id="displayList-data">(.+?)</script>',
27 response
, 'tracks'), track_id
)['tracks'][0]
29 track_id
= track
['id']
32 final_url
= self
._download
_json
(
33 'http://hypem.com/serve/source/{}/{}'.format(track_id
, track
['key']),
34 track_id
, 'Downloading metadata', headers
={
35 'Content-Type': 'application/json',
43 'uploader': track
.get('artist'),
44 'duration': int_or_none(track
.get('time')),
45 'timestamp': int_or_none(track
.get('ts')),