]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/clyp.py
1 from .common
import InfoExtractor
9 class ClypIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:www\.)?clyp\.it/(?P<id>[a-z0-9]+)'
12 'url': 'https://clyp.it/ojz2wfah',
13 'md5': '1d4961036c41247ecfdcc439c0cddcbb',
17 'title': 'Krisson80 - bits wip wip',
18 'description': '#Krisson80BitsWipWip #chiptune\n#wip',
20 'timestamp': 1443515251,
21 'upload_date': '20150929',
24 'url': 'https://clyp.it/b04p1odi?token=b0078e077e15835845c528a44417719d',
28 'title': 'GJ! (Reward Edit)',
29 'description': 'Metal Resistance (THE ONE edition)',
31 'timestamp': 1528241278,
32 'upload_date': '20180605',
35 'skip_download': True,
39 def _real_extract(self
, url
):
40 audio_id
= self
._match
_id
(url
)
43 token
= qs
.get('token', [None])[0]
47 query
['token'] = token
49 metadata
= self
._download
_json
(
50 'https://api.clyp.it/%s' % audio_id
, audio_id
, query
=query
)
53 for secure
in ('', 'Secure'):
54 for ext
in ('Ogg', 'Mp3'):
55 format_id
= '%s%s' % (secure
, ext
)
56 format_url
= metadata
.get('%sUrl' % format_id
)
60 'format_id': format_id
,
63 self
._sort
_formats
(formats
)
65 title
= metadata
['Title']
66 description
= metadata
.get('Description')
67 duration
= float_or_none(metadata
.get('Duration'))
68 timestamp
= unified_timestamp(metadata
.get('DateCreated'))
73 'description': description
,
75 'timestamp': timestamp
,