1 from .common
import InfoExtractor
2 from ..networking
import HEADRequest
3 from ..utils
import float_or_none
6 class VocarooIE(InfoExtractor
):
7 _VALID_URL
= r
'https?://(?:www\.)?(?:vocaroo\.com|voca\.ro)/(?:embed/)?(?P<id>\w+)'
8 _EMBED_REGEX
= [r
'<iframe[^>]+src=(["\'])(?P
<url
>(?
:https?
://)?
(?
:www\
.)?vocaroo\
.com
/embed
/.+?
)\
1']
11 'url
': 'https
://vocaroo
.com
/1de8yA3LNe77
',
12 'md5
': 'c557841d5e50261777a6585648adf439
',
16 'title
': 'Vocaroo video
#1de8yA3LNe77',
17 'timestamp': 1675059800.370,
18 'upload_date': '20230130',
22 'url': 'https://vocaroo.com/embed/12WqtjLnpj6g?autoplay=0',
23 'only_matching': True,
26 'url': 'https://voca.ro/12D52rgpzkB0',
27 'only_matching': True,
33 'url': 'https://qbnu.github.io/cool.html',
34 'md5': 'f322e529275dd8a47994919eeac404a5',
38 'title': 'Vocaroo video #19cgWmKO6AmC',
39 'timestamp': 1675093841.408,
40 'upload_date': '20230130',
45 def _real_extract(self
, url
):
46 audio_id
= self
._match
_id
(url
)
47 if len(audio_id
) == 10 or (len(audio_id
) == 12 and audio_id
[0] == '1'):
48 media_subdomain
= 'media1'
50 media_subdomain
= 'media'
52 url
= f
'https://{media_subdomain}.vocaroo.com/mp3/{audio_id}'
53 http_headers
= {'Referer': 'https://vocaroo.com/'}
54 resp
= self
._request
_webpage
(HEADRequest(url
), audio_id
, headers
=http_headers
)
60 'timestamp': float_or_none(resp
.headers
.get('x-bz-upload-timestamp'), scale
=1000),
62 'http_headers': http_headers
,