]>
 
 
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/la7.py 
 
 
 
 
 
 
 
 
   2  from  __future__ 
import  unicode_literals
 
   4  from  . common 
import  InfoExtractor
 
  11  class  LA7IE ( InfoExtractor
):  
  13      _VALID_URL 
=  r
'''(?x)(https?://)?(?:  
  14          (?:www\.)?la7\.it/([^/]+)/(?:rivedila7|video)/|  
  15          tg\.la7\.it/repliche-tgla7\?id=  
  19          # 'src' is a plain URL  
  20          'url' :  'http://www.la7.it/crozza/video/inccool8-02-10-2015-163722' ,  
  21          'md5' :  '8b613ffc0c4bf9b9e377169fc19c214c' ,  
  23              'id' :  'inccool8-02-10-2015-163722' ,  
  26              'description' :  'Benvenuti nell \' incredibile mondo della INC. COOL. 8. dove “INC.” sta per “Incorporated” “COOL” sta per “fashion” ed Eight sta per il gesto  atletico' ,  
  27              'thumbnail' :  're:^https?://.*' ,  
  28              'uploader_id' :  'kdla7pillole@iltrovatore.it' ,  
  29              'timestamp' :  1443814869 ,  
  30              'upload_date' :  '20151002' ,  
  33          # 'src' is a dictionary  
  34          'url' :  'http://tg.la7.it/repliche-tgla7?id=189080' ,  
  35          'md5' :  '6b0d8888d286e39870208dfeceaf456b' ,  
  42          'url' :  'http://www.la7.it/omnibus/rivedila7/omnibus-news-02-07-2016-189077' ,  
  43          'only_matching' :  True ,  
  46      def  _real_extract ( self
,  url
):  
  47          video_id 
=  self
._ match
_ id
( url
)  
  49          webpage 
=  self
._ download
_ webpage
( url
,  video_id
)  
  51          player_data 
=  self
._ parse
_ json
(  
  52              self
._ search
_ regex
( r
'videoLa7\(({[^;]+})\);' ,  webpage
,  'player data' ),  
  53              video_id
,  transform_source
= js_to_json
)  
  56              '_type' :  'url_transparent' ,  
  57              'url' :  smuggle_url ( 'kaltura:103: %s '  %  player_data
[ 'vid' ], {  
  58                  'service_url' :  'http://kdam.iltrovatore.it' ,  
  61              'title' :  player_data
[ 'title' ],  
  62              'description' :  self
._ og
_ search
_ description
( webpage
,  default
= None ),  
  63              'thumbnail' :  player_data
. get ( 'poster' ),