]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/bfi.py
[ie/matchtv] Fix extractor (#10190)
[yt-dlp.git] / yt_dlp / extractor / bfi.py
CommitLineData
4810655c
RA
1import re
2
3from .common import InfoExtractor
4from ..utils import extract_attributes
5
6
7class BFIPlayerIE(InfoExtractor):
9751a457 8 _WORKING = False
4810655c
RA
9 IE_NAME = 'bfi:player'
10 _VALID_URL = r'https?://player\.bfi\.org\.uk/[^/]+/film/watch-(?P<id>[\w-]+)-online'
11 _TEST = {
12 'url': 'https://player.bfi.org.uk/free/film/watch-computer-doctor-1974-online',
13 'md5': 'e8783ebd8e061ec4bc6e9501ed547de8',
14 'info_dict': {
15 'id': 'htNnhlZjE60C9VySkQEIBtU-cNV1Xx63',
16 'ext': 'mp4',
17 'title': 'Computer Doctor',
18 'description': 'md5:fb6c240d40c4dbe40428bdd62f78203b',
19 },
20 'skip': 'BFI Player films cannot be played outside of the UK',
21 }
22
23 def _real_extract(self, url):
24 video_id = self._match_id(url)
25 webpage = self._download_webpage(url, video_id)
26 entries = []
27 for player_el in re.findall(r'(?s)<[^>]+class="player"[^>]*>', webpage):
28 player_attr = extract_attributes(player_el)
29 ooyala_id = player_attr.get('data-video-id')
30 if not ooyala_id:
31 continue
32 entries.append(self.url_result(
33 'ooyala:' + ooyala_id, 'Ooyala',
34 ooyala_id, player_attr.get('data-label')))
35 return self.playlist_result(entries)