]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/makerschannel.py
   2 from __future__ 
import unicode_literals
 
   6 from .common 
import InfoExtractor
 
   9 class MakersChannelIE(InfoExtractor
): 
  10     _VALID_URL 
= r
'https?://(?:www\.)?makerschannel\.com/.*(?P<id_type>video|production)_id=(?P<id>[0-9]+)' 
  12         'url': 'http://makerschannel.com/en/zoomin/community-highlights?video_id=849', 
  13         'md5': '624a512c6969236b5967bf9286345ad1', 
  17             'title': 'Landing a bus on a plane is an epic win', 
  19             'description': 'md5:cd9cca2ea7b69b78be81d07020c97139', 
  23     def _real_extract(self
, url
): 
  24         id_type
, url_id 
= re
.match(self
._VALID
_URL
, url
).groups() 
  25         webpage 
= self
._download
_webpage
(url
, url_id
) 
  26         video_data 
= self
._html
_search
_regex
(r
'<div([^>]+data-%s-id="%s"[^>]+)>' % (id_type
, url_id
), webpage
, 'video data') 
  28         def extract_data_val(attr
, fatal
=False): 
  29             return self
._html
_search
_regex
(r
'data-%s\s*=\s*"([^"]+)"' % attr
, video_data
, attr
, fatal
=fatal
) 
  30         minoto_id 
= self
._search
_regex
(r
'/id/([a-zA-Z0-9]+)', extract_data_val('video-src', True), 'minoto id') 
  33             '_type': 'url_transparent', 
  34             'url': 'minoto:%s' % minoto_id
, 
  35             'id': extract_data_val('video-id', True), 
  36             'title': extract_data_val('title', True), 
  37             'description': extract_data_val('description'), 
  38             'thumbnail': extract_data_val('image'), 
  39             'uploader': extract_data_val('channel'),