]>
 
 
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/jeuxvideo.py 
 
 
 
 
 
 
 
 
   3  from  __future__ 
import  unicode_literals
 
   7  from  . common 
import  InfoExtractor
 
  10  class  JeuxVideoIE ( InfoExtractor
):  
  11      _VALID_URL 
=  r
'https?://.*?\.jeuxvideo\.com/.*/(.*?)\.htm'  
  14          'url' :  'http://www.jeuxvideo.com/reportages-videos-jeux/0004/00046170/tearaway-playstation-vita-gc-2013-tearaway-nous-presente-ses-papiers-d-identite-00115182.htm' ,  
  15          'md5' :  '046e491afb32a8aaac1f44dd4ddd54ee' ,  
  19              'title' :  'Tearaway : GC 2013 : Tearaway nous présente ses papiers d \' identité' ,  
  20              'description' :  'Lorsque les développeurs de LittleBigPlanet proposent un nouveau titre, on ne peut que s \' attendre à un résultat original et fort attrayant.' ,  
  23          'url' :  'http://www.jeuxvideo.com/videos/chroniques/434220/l-histoire-du-jeu-video-la-saturn.htm' ,  
  24          'only_matching' :  True ,  
  27      def  _real_extract ( self
,  url
):  
  28          mobj 
=  re
. match ( self
._ VALID
_U RL
,  url
)  
  30          webpage 
=  self
._ download
_ webpage
( url
,  title
)  
  31          title 
=  self
._ html
_ search
_ meta
( 'name' ,  webpage
)  or  self
._ og
_ search
_ title
( webpage
)  
  32          config_url 
=  self
._ html
_ search
_ regex
(  
  33              r
'data-src(?:set-video)?="(/contenu/medias/video\.php.*?)"' ,  
  34              webpage
,  'config URL' )  
  35          config_url 
=  'http://www.jeuxvideo.com'  +  config_url
 
  37          video_id 
=  self
._ search
_ regex
(  
  39              config_url
,  'video ID' )  
  41          config 
=  self
._ download
_ json
(  
  42              config_url
,  title
,  'Downloading JSON config' )  
  45              'url' :  source
[ 'file' ],  
  46              'format_id' :  source
[ 'label' ],  
  47              'resolution' :  source
[ 'label' ],  
  48          }  for  source 
in  reversed ( config
[ 'sources' ])]  
  54              'description' :  self
._ og
_ search
_ description
( webpage
),  
  55              'thumbnail' :  config
. get ( 'image' ),