1 from .common
import InfoExtractor
9 class ABCOTVSIE(InfoExtractor
):
11 IE_DESC
= 'ABC Owned Television Stations'
12 _VALID_URL
= r
'https?://(?P<site>abc(?:7(?:news|ny|chicago)?|11|13|30)|6abc)\.com(?:(?:/[^/]+)*/(?P<display_id>[^/]+))?/(?P<id>\d+)'
15 'url': 'http://abc7news.com/entertainment/east-bay-museum-celebrates-vintage-synthesizers/472581/',
18 'display_id': 'east-bay-museum-celebrates-vintage-synthesizers',
20 'title': 'East Bay museum celebrates synthesized music',
21 'description': 'md5:24ed2bd527096ec2a5c67b9d5a9005f3',
22 'thumbnail': r
're:^https?://.*\.jpg$',
23 'timestamp': 1421118520,
24 'upload_date': '20150113',
28 'skip_download': True,
32 'url': 'http://abc7news.com/472581',
33 'only_matching': True,
36 'url': 'https://6abc.com/man-75-killed-after-being-struck-by-vehicle-in-chester/5725182/',
37 'only_matching': True,
51 def _real_extract(self
, url
):
52 site
, display_id
, video_id
= self
._match
_valid
_url
(url
).groups()
53 display_id
= display_id
or video_id
54 station
= self
._SITE
_MAP
[site
]
56 data
= self
._download
_json
(
57 'https://api.abcotvs.com/v2/content', display_id
, query
={
59 'key': f
'otv.web.{station}.story',
62 video
= try_get(data
, lambda x
: x
['featuredMedia']['video'], dict) or data
63 video_id
= str(dict_get(video
, ('id', 'publishedKey'), video_id
))
64 title
= video
.get('title') or video
['linkText']
67 m3u8_url
= video
.get('m3u8')
69 formats
= self
._extract
_m
3u8_formats
(
70 video
['m3u8'].split('?')[0], display_id
, 'mp4', m3u8_id
='hls', fatal
=False)
71 mp4_url
= video
.get('mp4')
81 image
= video
.get('image') or {}
85 'display_id': display_id
,
87 'description': dict_get(video
, ('description', 'caption'), try_get(video
, lambda x
: x
['meta']['description'])),
88 'thumbnail': dict_get(image
, ('source', 'dynamicSource')),
89 'timestamp': int_or_none(video
.get('date')),
90 'duration': int_or_none(video
.get('length')),
95 class ABCOTVSClipsIE(InfoExtractor
):
96 IE_NAME
= 'abcotvs:clips'
97 _VALID_URL
= r
'https?://clips\.abcotvs\.com/(?:[^/]+/)*video/(?P<id>\d+)'
99 'url': 'https://clips.abcotvs.com/kabc/video/214814',
103 'title': 'SpaceX launch pad explosion destroys rocket, satellite',
104 'description': 'md5:9f186e5ad8f490f65409965ee9c7be1b',
105 'upload_date': '20160901',
106 'timestamp': 1472756695,
110 'skip_download': True,
114 def _real_extract(self
, url
):
115 video_id
= self
._match
_id
(url
)
116 video_data
= self
._download
_json
('https://clips.abcotvs.com/vogo/video/getByIds?ids=' + video_id
, video_id
)['results'][0]
117 title
= video_data
['title']
118 formats
= self
._extract
_m
3u8_formats
(
119 video_data
['videoURL'].split('?')[0], video_id
, 'mp4')
124 'description': video_data
.get('description'),
125 'thumbnail': video_data
.get('thumbnailURL'),
126 'duration': int_or_none(video_data
.get('duration')),
127 'timestamp': int_or_none(video_data
.get('pubDate')),