]> jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/atttechchannel.py
[ie/box] Fix formats extraction (#8649)
[yt-dlp.git] / yt_dlp / extractor / atttechchannel.py
1 from .common import InfoExtractor
2 from ..utils import unified_strdate
3
4
5 class ATTTechChannelIE(InfoExtractor):
6 _VALID_URL = r'https?://techchannel\.att\.com/play-video\.cfm/([^/]+/)*(?P<id>.+)'
7 _TEST = {
8 'url': 'http://techchannel.att.com/play-video.cfm/2014/1/27/ATT-Archives-The-UNIX-System-Making-Computers-Easier-to-Use',
9 'info_dict': {
10 'id': '11316',
11 'display_id': 'ATT-Archives-The-UNIX-System-Making-Computers-Easier-to-Use',
12 'ext': 'flv',
13 'title': 'AT&T Archives : The UNIX System: Making Computers Easier to Use',
14 'description': 'A 1982 film about UNIX is the foundation for software in use around Bell Labs and AT&T.',
15 'thumbnail': r're:^https?://.*\.jpg$',
16 'upload_date': '20140127',
17 },
18 'params': {
19 # rtmp download
20 'skip_download': True,
21 },
22 }
23
24 def _real_extract(self, url):
25 display_id = self._match_id(url)
26
27 webpage = self._download_webpage(url, display_id)
28
29 video_url = self._search_regex(
30 r"url\s*:\s*'(rtmp://[^']+)'",
31 webpage, 'video URL')
32
33 video_id = self._search_regex(
34 r'mediaid\s*=\s*(\d+)',
35 webpage, 'video id', fatal=False)
36
37 title = self._og_search_title(webpage)
38 description = self._og_search_description(webpage)
39 thumbnail = self._og_search_thumbnail(webpage)
40 upload_date = unified_strdate(self._search_regex(
41 r'[Rr]elease\s+date:\s*(\d{1,2}/\d{1,2}/\d{4})',
42 webpage, 'upload date', fatal=False), False)
43
44 return {
45 'id': video_id,
46 'display_id': display_id,
47 'url': video_url,
48 'ext': 'flv',
49 'title': title,
50 'description': description,
51 'thumbnail': thumbnail,
52 'upload_date': upload_date,
53 }