[cleanup] Make more playlist entries lazy (#11763)
[yt-dlp.git] / yt_dlp / extractor / historicfilms.py
blob714f65114a13ba6813f8f61c698ff687d5698ea5
1 from .common import InfoExtractor
2 from ..utils import parse_duration
5 class HistoricFilmsIE(InfoExtractor):
6 _VALID_URL = r'https?://(?:www\.)?historicfilms\.com/(?:tapes/|play)(?P<id>\d+)'
7 _TEST = {
8 'url': 'http://www.historicfilms.com/tapes/4728',
9 'md5': 'd4a437aec45d8d796a38a215db064e9a',
10 'info_dict': {
11 'id': '4728',
12 'ext': 'mov',
13 'title': 'Historic Films: GP-7',
14 'description': 'md5:1a86a0f3ac54024e419aba97210d959a',
15 'thumbnail': r're:^https?://.*\.jpg$',
16 'duration': 2096,
20 def _real_extract(self, url):
21 video_id = self._match_id(url)
23 webpage = self._download_webpage(url, video_id)
25 tape_id = self._search_regex(
26 [r'class="tapeId"[^>]*>([^<]+)<', r'tapeId\s*:\s*"([^"]+)"'],
27 webpage, 'tape id')
29 title = self._og_search_title(webpage)
30 description = self._og_search_description(webpage)
31 thumbnail = self._html_search_meta(
32 'thumbnailUrl', webpage, 'thumbnails') or self._og_search_thumbnail(webpage)
33 duration = parse_duration(self._html_search_meta(
34 'duration', webpage, 'duration'))
36 video_url = f'http://www.historicfilms.com/video/{tape_id}_{video_id}_web.mov'
38 return {
39 'id': video_id,
40 'url': video_url,
41 'title': title,
42 'description': description,
43 'thumbnail': thumbnail,
44 'duration': duration,