]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/cbs.py 
   1  from  __future__ 
import  unicode_literals
   3  from  . common 
import  InfoExtractor
  10  class  CBSIE ( InfoExtractor
):   11      _VALID_URL 
=  r
'https?://(?:www\.)?(?:cbs\.com/shows/[^/]+/(?:video|artist)|colbertlateshow\.com/(?:video|podcasts))/[^/]+/(?P<id>[^/]+)'   14          'url' :  'http://www.cbs.com/shows/garth-brooks/video/_u7W953k6la293J7EPTd9oHkSPs6Xn6_/connect-chat-feat-garth-brooks/' ,   17              'display_id' :  'connect-chat-feat-garth-brooks' ,   19              'title' :  'Connect Chat feat. Garth Brooks' ,   20              'description' :  'Connect with country music singer Garth Brooks, as he chats with fans on Wednesday November 27, 2013. Be sure to tune in to Garth Brooks: Live from Las Vegas, Friday November 29, at 9/8c on CBS!' ,   25              'skip_download' :  True ,   27          '_skip' :  'Blocked outside the US' ,   29          'url' :  'http://www.cbs.com/shows/liveonletterman/artist/221752/st-vincent/' ,   32              'display_id' :  'st-vincent' ,   34              'title' :  'Live on Letterman - St. Vincent' ,   35              'description' :  'Live On Letterman: St. Vincent in concert from New York \' s Ed Sullivan Theater on Tuesday, July 16, 2014.' ,   40              'skip_download' :  True ,   42          '_skip' :  'Blocked outside the US' ,   44          'url' :  'http://colbertlateshow.com/video/8GmB0oY0McANFvp2aEffk9jZZZ2YyXxy/the-colbeard/' ,   45          'only_matching' :  True ,   47          'url' :  'http://www.colbertlateshow.com/podcasts/dYSwjqPs_X1tvbV_P2FcPWRa_qT6akTC/in-the-bad-room-with-stephen/' ,   48          'only_matching' :  True ,   51      def  _real_extract ( self
,  url
):   52          display_id 
=  self
._ match
_ id
( url
)   53          request 
=  sanitized_Request ( url
)   54          # Android UA is served with higher quality (720p) streams (see   55          # https://github.com/rg3/youtube-dl/issues/7490)   56          request
. add_header ( 'User-Agent' ,  'Mozilla/5.0 (Linux; Android 4.4; Nexus 5)' )   57          webpage 
=  self
._ download
_ webpage
( request
,  display_id
)   58          real_id 
=  self
._ search
_ regex
(   59              [ r
"video\.settings\.pid\s*=\s*'([^']+)';" ,  r
"cbsplayer\.pid\s*=\s*'([^']+)';" ],   60              webpage
,  'real video ID' )   62              '_type' :  'url_transparent' ,   63              'ie_key' :  'ThePlatform' ,   65                  'http://link.theplatform.com/s/dJ5BDC/ %s ?mbr=true&manifest=m3u'  %  real_id
,   66                  { 'force_smil_url' :  True }),   67              'display_id' :  display_id
,