]>
 
 
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/fox.py 
 
 
 
 
 
 
 
 
   2  from  __future__ 
import  unicode_literals
 
   4  from  . common 
import  InfoExtractor
 
   5  from  .. utils 
import  smuggle_url
 
   8  class  FOXIE ( InfoExtractor
):  
   9      _VALID_URL 
=  r
'https?://(?:www\.)?fox\.com/watch/(?P<id>[0-9]+)'  
  11          'url' :  'http://www.fox.com/watch/255180355939/7684182528' ,  
  12          'md5' :  'ebd296fcc41dd4b19f8115d8461a3165' ,  
  16              'title' :  'Official Trailer: Gotham' ,  
  17              'description' :  'Tracing the rise of the great DC Comics Super-Villains and vigilantes, Gotham reveals an entirely new chapter that has never been told.' ,  
  20          'add_ie' : [ 'ThePlatform' ],  
  23      def  _real_extract ( self
,  url
):  
  24          video_id 
=  self
._ match
_ id
( url
)  
  25          webpage 
=  self
._ download
_ webpage
( url
,  video_id
)  
  27          release_url 
=  self
._ parse
_ json
( self
._ search
_ regex
(  
  28              r
'"fox_pdk_player"\s*:\s*({[^}]+?})' ,  webpage
,  'fox_pdk_player' ),  
  29              video_id
)[ 'release_url' ] +  '&switch=http'  
  32              '_type' :  'url_transparent' ,  
  33              'ie_key' :  'ThePlatform' ,  
  34              'url' :  smuggle_url ( release_url
, { 'force_smil_url' :  True }),