[PATCH] [vocaroo] Add new extractor

This commit is contained in:
Kyle Anthony Williams 2021-06-22 21:24:18 -04:00
parent 379f52a495
commit fba9258cce
2 changed files with 38 additions and 0 deletions

View File

@ -1475,6 +1475,7 @@ from .vlive import (
VLivePostIE,
VLiveChannelIE,
)
from .vocaroo import VocarooIE
from .vodlocker import VodlockerIE
from .vodpl import VODPlIE
from .vodplatform import VODPlatformIE

View File

@ -0,0 +1,37 @@
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class VocarooIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:vocaroo\.com|voca\.ro)/(?:embed/)?(?P<id>[a-zA-Z0-9]{12})'
_TESTS = [
{
'url': 'https://vocaroo.com/1e976QE4oDoy',
'md5': '9ccf2014af38890e9e10450c901c17a6',
'info_dict': {
'id': '1e976QE4oDoy',
'ext': 'mp3',
'title': 'Vocaroo - 1e976QE4oDoy',
}
},
{
'url': 'https://vocaroo.com/embed/1e976QE4oDoy?autoplay=0',
'only_matching': True
},
{
'url': 'https://voca.ro/1ctMANMty97s',
'only_matching': True
},
]
def _real_extract(self, url):
audio_id = self._match_id(url)
return {
'id': audio_id,
'title': "Vocaroo - {}".format(audio_id),
'url': 'https://media1.vocaroo.com/mp3/{}'.format(audio_id),
'ext': 'mp3'
}