]>
 
 
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/bild.py 
 
 
 
 
 
 
 
 
   2  from  __future__ 
import  unicode_literals
 
   4  from  . common 
import  InfoExtractor
 
   5  from  .. utils 
import  int_or_none
 
   8  class  BildIE ( InfoExtractor
):  
   9      _VALID_URL 
=  r
'https?://(?:www\.)?bild\.de/(?:[^/]+/)+(?P<display_id>[^/]+)-(?P<id>\d+)(?:,auto=true)?\.bild\.html'  
  12          'url' :  'http://www.bild.de/video/clip/apple-ipad-air/das-koennen-die-neuen-ipads-38184146.bild.html' ,  
  13          'md5' :  'dd495cbd99f2413502a1713a1156ac8a' ,  
  17              'title' :  'BILD hat sie getestet' ,  
  18              'thumbnail' :  'http://bilder.bild.de/fotos/stand-das-koennen-die-neuen-ipads-38184138/Bild/1.bild.jpg' ,  
  20              'description' :  'Mit dem iPad Air 2 und dem iPad Mini 3 hat Apple zwei neue Tablet-Modelle präsentiert. BILD-Reporter Sven Stein durfte die Geräte bereits testen. ' ,  
  24      def  _real_extract ( self
,  url
):  
  25          video_id 
=  self
._ match
_ id
( url
)  
  27          xml_url 
=  url
. split ( ".bild.html" )[ 0 ] +  ",view=xml.bild.xml"  
  28          doc 
=  self
._ download
_ xml
( xml_url
,  video_id
)  
  30          duration 
=  int_or_none ( doc
. attrib
. get ( 'duration' ),  scale
= 1000 )  
  34              'title' :  doc
. attrib
[ 'ueberschrift' ],  
  35              'description' :  doc
. attrib
. get ( 'text' ),  
  36              'url' :  doc
. attrib
[ 'src' ],  
  37              'thumbnail' :  doc
. attrib
. get ( 'img' ),