]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/cinchcast.py
   2 from __future__ 
import unicode_literals
 
   4 from .common 
import InfoExtractor
 
  11 class CinchcastIE(InfoExtractor
): 
  12     _VALID_URL 
= r
'https?://player\.cinchcast\.com/.*?assetId=(?P<id>[0-9]+)' 
  14         # Actual test is run in generic, look for undergroundwellness 
  15         'url': 'http://player.cinchcast.com/?platformId=1&assetType=single&assetId=7141703', 
  16         'only_matching': True, 
  19     def _real_extract(self
, url
): 
  20         video_id 
= self
._match
_id
(url
) 
  21         doc 
= self
._download
_xml
( 
  22             'http://www.blogtalkradio.com/playerasset/mrss?assetType=single&assetId=%s' % video_id
, 
  25         item 
= doc
.find('.//item') 
  26         title 
= xpath_text(item
, './title', fatal
=True) 
  27         date_str 
= xpath_text( 
  28             item
, './{http://developer.longtailvideo.com/trac/}date') 
  29         upload_date 
= unified_strdate(date_str
, day_first
=False) 
  30         # duration is present but wrong 
  33             'url': item
.find('./{http://search.yahoo.com/mrss/}content').attrib
['url'], 
  35         backup_url 
= xpath_text( 
  36             item
, './{http://developer.longtailvideo.com/trac/}backupContent') 
  39                 'preference': 2,  # seems to be more reliable 
  40                 'format_id': 'backup', 
  43         self
._sort
_formats
(formats
) 
  48             'upload_date': upload_date
,