This commit is contained in:
greenjd 2020-09-24 19:53:20 -04:00 committed by GitHub
commit 8f22fcd99d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View File

@ -675,3 +675,30 @@ class BrightcoveNewIE(AdobePassIE):
return self._parse_brightcove_metadata(
json_data, video_id, headers=headers)
class BrightcoveServicesIE(InfoExtractor):
IE_NAME = 'brightcove:services'
_VALID_URL = r'https?://.*\.brightcove\.services/\?(?P<content_type>video|playlist)Id=(?P<video_id>\d+)'
_TESTS = [{
'url': 'https://metoperafree.brightcove.services/?videoId=6146557024001',
'info_dict': {
'id': '102076671001',
'ext': 'mp4',
},
# 'params': {
# 'skip_download': True,
# },
}]
def _real_extract(self, url):
content_type, video_id = re.match(self._VALID_URL, url).groups()
webpage = self._download_webpage(url, video_id)
player_url = self._html_search_regex(r'(https://players.brightcove.net/\d+/[^/]+_[^/]+/index.min.js)', webpage, 'player_url')
valid_player_url = r'https://players.brightcove.net/(?P<account_id>\d+)/(?P<player_id>[^/]+)_(?P<embed>[^/]+)/index.min.js'
account_id, player_id, embed = re.match(valid_player_url, player_url).groups()
return {
'_type': 'url',
'url': 'https://players.brightcove.net/%s/%s_%s/index.html?%sId=%s' % (account_id, player_id, embed, content_type, video_id),
'ie_key': 'BrightcoveNew'
}

View File

@ -131,6 +131,7 @@ from .breakcom import BreakIE
from .brightcove import (
BrightcoveLegacyIE,
BrightcoveNewIE,
BrightcoveServicesIE,
)
from .businessinsider import BusinessInsiderIE
from .buzzfeed import BuzzFeedIE