]>
 
 
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/vodplatform.py 
 
 
 
 
 
 
 
 
b49542b162d82cca3f1c11d5a3b2c062b3c34c9f
   2  from  __future__ 
import  unicode_literals
 
   4  from  . common 
import  InfoExtractor
 
   5  from  .. utils 
import  unescapeHTML
 
   8  class  VODPlatformIE ( InfoExtractor
):  
   9      _VALID_URL 
=  r
'https?://(?:www\.)?vod-platform\.net/embed/(?P<id>[^/?#]+)'  
  11          # from http://www.lbcgroup.tv/watch/chapter/29143/52844/%D8%A7%D9%84%D9%86%D8%B5%D8%B1%D8%A9-%D9%81%D9%8A-%D8%B6%D9%8A%D8%A7%D9%81%D8%A9-%D8%A7%D9%84%D9%80-cnn/ar  
  12          'url' :  'http://vod-platform.net/embed/RufMcytHDolTH1MuKHY9Fw' ,  
  13          'md5' :  '1db2b7249ce383d6be96499006e951fc' ,  
  15              'id' :  'RufMcytHDolTH1MuKHY9Fw' ,  
  17              'title' :  'LBCi News_ النصرة في ضيافة الـ "سي.أن.أن"' ,  
  21      def  _real_extract ( self
,  url
):  
  22          video_id 
=  self
._ match
_ id
( url
)  
  23          webpage 
=  self
._ download
_ webpage
( url
,  video_id
)  
  25          title 
=  unescapeHTML ( self
._ og
_ search
_ title
( webpage
))  
  26          hidden_inputs 
=  self
._ hidden
_ inputs
( webpage
)  
  28          base_url 
=  self
._ search
_ regex
(  
  29              '(.*/)(?:playlist.m3u8|manifest.mpd)' ,  
  30              hidden_inputs
. get ( 'HiddenmyhHlsLink' )  or  hidden_inputs
[ 'HiddenmyDashLink' ],  
  32          formats 
=  self
._ extract
_ m
3u8_ formats
(  
  33              base_url 
+  'playlist.m3u8' ,  video_id
,  'mp4' ,  
  34              'm3u8_native' ,  m3u8_id
= 'hls' ,  fatal
= False )  
  35          formats
. extend ( self
._ extract
_ mpd
_ formats
(  
  36              base_url 
+  'manifest.mpd' ,  video_id
,  
  37              mpd_id
= 'dash' ,  fatal
= False ))  
  38          rtmp_formats 
=  self
._ extract
_ smil
_ formats
(  
  39              base_url 
+  'jwplayer.smil' ,  video_id
,  fatal
= False )  
  40          for  rtmp_format 
in  rtmp_formats
:  
  41              rtsp_format 
=  rtmp_format
. copy ()  
  42              rtsp_format
[ 'url' ] =  ' %s / %s '  % ( rtmp_format
[ 'url' ],  rtmp_format
[ 'play_path' ])  
  43              del  rtsp_format
[ 'play_path' ]  
  44              del  rtsp_format
[ 'ext' ]  
  46                  'url' :  rtsp_format
[ 'url' ]. replace ( 'rtmp://' ,  'rtsp://' ),  
  47                  'format_id' :  rtmp_format
[ 'format_id' ]. replace ( 'rtmp' ,  'rtsp' ),  
  50              formats
. extend ([ rtmp_format
,  rtsp_format
])  
  51          self
._ sort
_ formats
( formats
)  
  56              'thumbnail' :  hidden_inputs
. get ( 'HiddenThumbnail' )  or  self
._ og
_ search
_ thumbnail
( webpage
),