- def _real_extract(self, url):
- mobj = re.match(self._VALID_URL, url)
- path = mobj.group('path')
- page_title = mobj.group('title')
- info_url = 'http://cnn.com/video/data/3.0/%s/index.xml' % path
- info = self._download_xml(info_url, page_title)
-
- formats = []
- rex = re.compile(r'''(?x)
- (?P<width>[0-9]+)x(?P<height>[0-9]+)
- (?:_(?P<bitrate>[0-9]+)k)?
- ''')
- for f in info.findall('files/file'):
- video_url = 'http://ht.cdn.turner.com/cnn/big%s' % (f.text.strip())
- fdct = {
- 'format_id': f.attrib['bitrate'],
- 'url': video_url,
- }
-
- mf = rex.match(f.attrib['bitrate'])
- if mf:
- fdct['width'] = int(mf.group('width'))
- fdct['height'] = int(mf.group('height'))
- fdct['tbr'] = int_or_none(mf.group('bitrate'))
- else:
- mf = rex.search(f.text)
- if mf:
- fdct['width'] = int(mf.group('width'))
- fdct['height'] = int(mf.group('height'))
- fdct['tbr'] = int_or_none(mf.group('bitrate'))
- else:
- mi = re.match(r'ios_(audio|[0-9]+)$', f.attrib['bitrate'])
- if mi:
- if mi.group(1) == 'audio':
- fdct['vcodec'] = 'none'
- fdct['ext'] = 'm4a'
- else:
- fdct['tbr'] = int(mi.group(1))
-
- formats.append(fdct)
-
- self._sort_formats(formats)
-
- thumbnails = [{
- 'height': int(t.attrib['height']),
- 'width': int(t.attrib['width']),
- 'url': t.text,
- } for t in info.findall('images/image')]
-
- metas_el = info.find('metas')
- upload_date = (
- metas_el.attrib.get('version') if metas_el is not None else None)
+ _CONFIG = {
+ # http://edition.cnn.com/.element/apps/cvp/3.0/cfg/spider/cnn/expansion/config.xml
+ 'edition': {
+ 'data_src': 'http://edition.cnn.com/video/data/3.0/video/%s/index.xml',
+ 'media_src': 'http://pmd.cdn.turner.com/cnn/big',
+ },
+ # http://money.cnn.com/.element/apps/cvp2/cfg/config.xml
+ 'money': {
+ 'data_src': 'http://money.cnn.com/video/data/4.0/video/%s.xml',
+ 'media_src': 'http://ht3.cdn.turner.com/money/big',
+ },
+ }