]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/europeantour.py
[panopto] Add extractors (#2908)
[yt-dlp.git] / yt_dlp / extractor / europeantour.py
CommitLineData
3cf5429a
AG
1# coding: utf-8
2from __future__ import unicode_literals
3
4import re
5
6from .common import InfoExtractor
7
8
9class EuropeanTourIE(InfoExtractor):
10 _VALID_URL = r'https?://(?:www\.)?europeantour\.com/dpworld-tour/news/video/(?P<id>[^/&?#$]+)'
11
12 _TESTS = [{
13 'url': 'https://www.europeantour.com/dpworld-tour/news/video/the-best-shots-of-the-2021-seasons/',
14 'info_dict': {
15 'id': '6287788195001',
16 'ext': 'mp4',
17 'title': 'The best shots of the 2021 seasons',
18 'duration': 2416.512,
19 'timestamp': 1640010141,
20 'uploader_id': '5136026580001',
21 'tags': ['prod-imported'],
22 'thumbnail': 'md5:fdac52bc826548860edf8145ee74e71a',
23 'upload_date': '20211220'
24 },
25 'params': {'skip_download': True}
26 }]
27
28 BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/default_default/index.html?videoId=%s'
29
30 def _real_extract(self, url):
31 id = self._match_id(url)
32 webpage = self._download_webpage(url, id)
33 vid, aid = re.search(r'(?s)brightcove-player\s?video-id="([^"]+)".*"ACCOUNT_ID":"([^"]+)"', webpage).groups()
34 if not aid:
35 aid = '5136026580001'
36 return self.url_result(
37 self.BRIGHTCOVE_URL_TEMPLATE % (aid, vid), 'BrightcoveNew')