1 from .common
import InfoExtractor
8 class VocarooIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?(?:vocaroo\.com|voca\.ro)/(?:embed/)?(?P<id>\w+)'
10 _EMBED_REGEX
= [r
'<iframe[^>]+src=(["\'])(?P
<url
>(?
:https?
://)?
(?
:www\
.)?vocaroo\
.com
/embed
/.+?
)\
1']
13 'url
': 'https
://vocaroo
.com
/1de8yA3LNe77
',
14 'md5
': 'c557841d5e50261777a6585648adf439
',
18 'title
': 'Vocaroo video
#1de8yA3LNe77',
19 'timestamp': 1675059800.370,
20 'upload_date': '20230130',
24 'url': 'https://vocaroo.com/embed/12WqtjLnpj6g?autoplay=0',
25 'only_matching': True,
28 'url': 'https://voca.ro/12D52rgpzkB0',
29 'only_matching': True,
35 'url': 'https://qbnu.github.io/cool.html',
36 'md5': 'f322e529275dd8a47994919eeac404a5',
40 'title': 'Vocaroo video #19cgWmKO6AmC',
41 'timestamp': 1675093841.408,
42 'upload_date': '20230130',
47 def _real_extract(self
, url
):
48 audio_id
= self
._match
_id
(url
)
49 if len(audio_id
) == 10 or (len(audio_id
) == 12 and audio_id
[0] == '1'):
50 media_subdomain
= 'media1'
52 media_subdomain
= 'media'
54 url
= f
'https://{media_subdomain}.vocaroo.com/mp3/{audio_id}'
55 http_headers
= {'Referer': 'https://vocaroo.com/'}
56 resp
= self
._request
_webpage
(HEADRequest(url
), audio_id
, headers
=http_headers
)
62 'timestamp': float_or_none(resp
.getheader('x-bz-upload-timestamp'), scale
=1000),
64 'http_headers': http_headers
,