]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/ndtv.py
96528f6499d1e02c5208e61fe8abd1f606b29392
   1 from __future__ 
import unicode_literals
 
   3 from .common 
import InfoExtractor
 
  11 class NDTVIE(InfoExtractor
): 
  12     _VALID_URL 
= r
'https?://(?:www\.)?ndtv\.com/video/(?:[^/]+/)+[^/?^&]+-(?P<id>\d+)' 
  15         'url': 'http://www.ndtv.com/video/news/news/ndtv-exclusive-don-t-need-character-certificate-from-rahul-gandhi-says-arvind-kejriwal-300710', 
  16         'md5': '39f992dbe5fb531c395d8bbedb1e5e88', 
  20             'title': "NDTV exclusive: Don't need character certificate from Rahul Gandhi, says Arvind Kejriwal", 
  21             'description': 'md5:ab2d4b4a6056c5cb4caa6d729deabf02', 
  22             'upload_date': '20131208', 
  24             'thumbnail': 're:https?://.*\.jpg', 
  28     def _real_extract(self
, url
): 
  29         video_id 
= self
._match
_id
(url
) 
  30         webpage 
= self
._download
_webpage
(url
, video_id
) 
  32         title 
= remove_end(self
._og
_search
_title
(webpage
), ' - NDTV') 
  34         filename 
= self
._search
_regex
( 
  35             r
"__filename='([^']+)'", webpage
, 'video filename') 
  36         video_url 
= 'http://bitcast-b.bitgravity.com/ndtvod/23372/ndtv/%s' % filename
 
  38         duration 
= int_or_none(self
._search
_regex
( 
  39             r
"__duration='([^']+)'", webpage
, 'duration', fatal
=False)) 
  41         upload_date 
= unified_strdate(self
._html
_search
_meta
( 
  42             'publish-date', webpage
, 'upload date', fatal
=False)) 
  44         description 
= remove_end(self
._og
_search
_description
(webpage
), ' (Read more)') 
  50             'description': description
, 
  51             'thumbnail': self
._og
_search
_thumbnail
(webpage
), 
  53             'upload_date': upload_date
,