]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/franceculture.py
56048ffc21e8de8810b7e6b10122cc621927fbba
   2 from __future__ 
import unicode_literals
 
   4 from .common 
import InfoExtractor
 
  11 class FranceCultureIE(InfoExtractor
): 
  12     _VALID_URL 
= r
'https?://(?:www\.)?franceculture\.fr/emissions/(?:[^/]+/)*(?P<id>[^/?#&]+)' 
  14         'url': 'http://www.franceculture.fr/emissions/carnet-nomade/rendez-vous-au-pays-des-geeks', 
  16             'id': 'rendez-vous-au-pays-des-geeks', 
  17             'display_id': 'rendez-vous-au-pays-des-geeks', 
  19             'title': 'Rendez-vous au pays des geeks', 
  20             'thumbnail': 're:^https?://.*\\.jpg$', 
  21             'upload_date': '20140301', 
  26     def _real_extract(self
, url
): 
  27         display_id 
= self
._match
_id
(url
) 
  29         webpage 
= self
._download
_webpage
(url
, display_id
) 
  31         video_url 
= self
._search
_regex
( 
  32             r
'(?s)<div[^>]+class="[^"]*?title-zone-diffusion[^"]*?"[^>]*>.*?<button[^>]+data-asset-source="([^"]+)"', 
  33             webpage
, 'video path') 
  35         title 
= self
._og
_search
_title
(webpage
) 
  37         upload_date 
= unified_strdate(self
._search
_regex
( 
  38             '(?s)<div[^>]+class="date"[^>]*>.*?<span[^>]+class="inner"[^>]*>([^<]+)<', 
  39             webpage
, 'upload date', fatal
=False)) 
  40         thumbnail 
= self
._search
_regex
( 
  41             r
'(?s)<figure[^>]+itemtype="https://schema.org/ImageObject"[^>]*>.*?<img[^>]+data-dejavu-src="([^"]+)"', 
  42             webpage
, 'thumbnail', fatal
=False) 
  43         uploader 
= self
._html
_search
_regex
( 
  44             r
'(?s)<div id="emission".*?<span class="author">(.*?)</span>', 
  45             webpage
, 'uploader', default
=None) 
  46         vcodec 
= 'none' if determine_ext(video_url
.lower()) == 'mp3' else None 
  50             'display_id': display_id
, 
  53             'thumbnail': thumbnail
, 
  56             'upload_date': upload_date
,