]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/nbc.py
e8bbfff7bd59eeaca0e04c83ee1599baff8af088
3 from .common
import InfoExtractor
4 from ..utils
import find_xpath_attr
, compat_str
7 class NBCNewsIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://www\.nbcnews\.com/video/.+?/(?P<id>\d+)'
11 u
'url': u
'http://www.nbcnews.com/video/nbc-news/52753292',
12 u
'file': u
'52753292.flv',
13 u
'md5': u
'47abaac93c6eaf9ad37ee6c4463a5179',
15 u
'title': u
'Crew emerges after four-month Mars food study',
16 u
'description': u
'md5:24e632ffac72b35f8b67a12d1b6ddfc1',
20 def _real_extract(self
, url
):
21 mobj
= re
.match(self
._VALID
_URL
, url
)
22 video_id
= mobj
.group('id')
23 all_info
= self
._download
_xml
('http://www.nbcnews.com/id/%s/displaymode/1219' % video_id
, video_id
)
24 info
= all_info
.find('video')
26 return {'id': video_id
,
27 'title': info
.find('headline').text
,
29 'url': find_xpath_attr(info
, 'media', 'type', 'flashVideo').text
,
30 'description': compat_str(info
.find('caption').text
),
31 'thumbnail': find_xpath_attr(info
, 'media', 'type', 'thumbnail').text
,