mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-20 05:47:24 +01:00
BRIGHTCOVE_URL_TEMPLATE
This commit is contained in:
parent
7395ddbee1
commit
ef9acc949e
@ -1,9 +1,7 @@
|
|||||||
import functools
|
|
||||||
import urllib.parse
|
|
||||||
|
|
||||||
from .brightcove import BrightcoveNewIE
|
from .brightcove import BrightcoveNewIE
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import extract_attributes
|
from ..utils import extract_attributes, smuggle_url
|
||||||
|
|
||||||
|
|
||||||
class DrTalksIE(InfoExtractor):
|
class DrTalksIE(InfoExtractor):
|
||||||
@ -14,7 +12,7 @@ class DrTalksIE(InfoExtractor):
|
|||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '1758074870279626053',
|
'id': '1758074870279626053',
|
||||||
'title': 'Free Access Day 1 - Events at DrTalks',
|
'title': 'Free Access Day 1 - Events at DrTalks',
|
||||||
'thumbnail': 're:https://event.drtalks.com/wp-content/uploads/.+',
|
'thumbnail': r're:https://event.drtalks.com/wp-content/uploads/.+',
|
||||||
},
|
},
|
||||||
'playlist_mincount': 11,
|
'playlist_mincount': 11,
|
||||||
'params': {
|
'params': {
|
||||||
@ -25,7 +23,7 @@ class DrTalksIE(InfoExtractor):
|
|||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '1747611460188466596',
|
'id': '1747611460188466596',
|
||||||
'title': 'The BioEnergetics Summit',
|
'title': 'The BioEnergetics Summit',
|
||||||
'thumbnail': 're:https://event.drtalks.com/wp-content/uploads/.+',
|
'thumbnail': r're:https://event.drtalks.com/wp-content/uploads/.+',
|
||||||
},
|
},
|
||||||
'playlist_mincount': 8,
|
'playlist_mincount': 8,
|
||||||
'params': {
|
'params': {
|
||||||
@ -38,19 +36,19 @@ class DrTalksIE(InfoExtractor):
|
|||||||
'url': 'https://event.drtalks.com/medicine-of-mindset-summit/free-access-day-1/',
|
'url': 'https://event.drtalks.com/medicine-of-mindset-summit/free-access-day-1/',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/%s_%s/index.html?playlistId=%s'
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
player_attrs = extract_attributes(self._search_regex(r'(<video-js[^>]+>)', webpage, 'player'))
|
player_attrs = extract_attributes(self._search_regex(
|
||||||
|
r'(<video-js[^>]+\bid=(["\'])myPlayerID\2[^>]*>)', webpage, 'player'))
|
||||||
playlist_url = functools.reduce(urllib.parse.urljoin, [
|
bc_url = smuggle_url(self.BRIGHTCOVE_URL_TEMPLATE % (
|
||||||
'https://players.brightcove.net/',
|
player_attrs.get('data-account', '6314452011001'),
|
||||||
f'{player_attrs["data-account"]}/',
|
player_attrs.get('data-player', 'f3rfrCUjm'),
|
||||||
f'{player_attrs["data-player"]}_{player_attrs["data-embed"]}/',
|
player_attrs.get('data-embed', 'default'),
|
||||||
f'index.html?playlistId={player_attrs["data-playlist-id"]}',
|
player_attrs['data-playlist-id']), {'source_url': url})
|
||||||
])
|
|
||||||
|
|
||||||
return self.url_result(
|
return self.url_result(
|
||||||
playlist_url, BrightcoveNewIE.ie_key(), video_id, self._og_search_title(webpage),
|
bc_url, BrightcoveNewIE.ie_key(), video_id, self._og_search_title(webpage),
|
||||||
url_transparent=True, thumbnail=self._og_search_thumbnail(webpage))
|
url_transparent=True, thumbnail=self._og_search_thumbnail(webpage))
|
||||||
|
Loading…
Reference in New Issue
Block a user