]>
 
 
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/fox.py 
 
 
 
 
 
 
 
 
   2  from  __future__ 
import  unicode_literals
 
   4  from  . adobepass 
import  AdobePassIE
 
  11  class  FOXIE ( AdobePassIE
):  
  12      _VALID_URL 
=  r
'https?://(?:www\.)?fox\.com/watch/(?P<id>[0-9]+)'  
  14          'url' :  'http://www.fox.com/watch/255180355939/7684182528' ,  
  15          'md5' :  'ebd296fcc41dd4b19f8115d8461a3165' ,  
  19              'title' :  'Official Trailer: Gotham' ,  
  20              'description' :  'Tracing the rise of the great DC Comics Super-Villains and vigilantes, Gotham reveals an entirely new chapter that has never been told.' ,  
  22              'timestamp' :  1400020798 ,  
  23              'upload_date' :  '20140513' ,  
  24              'uploader' :  'NEWA-FNG-FOXCOM' ,  
  26          'add_ie' : [ 'ThePlatform' ],  
  29      def  _real_extract ( self
,  url
):  
  30          video_id 
=  self
._ match
_ id
( url
)  
  31          webpage 
=  self
._ download
_ webpage
( url
,  video_id
)  
  33          settings 
=  self
._ parse
_ json
( self
._ search
_ regex
(  
  34              r
'jQuery\.extend\(Drupal\.settings\s*,\s*({.+?})\);' ,  
  35              webpage
,  'drupal settings' ),  video_id
)  
  36          fox_pdk_player 
=  settings
[ 'fox_pdk_player' ]  
  37          release_url 
=  fox_pdk_player
[ 'release_url' ]  
  42          if  fox_pdk_player
. get ( 'access' ) ==  'locked' :  
  43              ap_p 
=  settings
[ 'foxAdobePassProvider' ]  
  44              rating 
=  ap_p
. get ( 'videoRating' )  
  47              resource 
=  self
._ get
_ mvpd
_ resource
( 'fbc-fox' ,  None ,  ap_p
[ 'videoGUID' ],  rating
)  
  48              query
[ 'auth' ] =  self
._ extract
_ mvpd
_ auth
( url
,  video_id
,  'fbc-fox' ,  resource
)  
  51              '_type' :  'url_transparent' ,  
  52              'ie_key' :  'ThePlatform' ,  
  53              'url' :  smuggle_url ( update_url_query ( release_url
,  query
), { 'force_smil_url' :  True }),