]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/movieclips.py
   2 from __future__ 
import unicode_literals
 
   4 from .common 
import InfoExtractor
 
  13 class MovieClipsIE(InfoExtractor
): 
  14     _VALID_URL 
= r
'https?://(?:www\.)?movieclips\.com/videos/.+-(?P<id>\d+)(?:\?|$)' 
  16         'url': 'http://www.movieclips.com/videos/warcraft-trailer-1-561180739597', 
  17         'md5': '42b5a0352d4933a7bd54f2104f481244', 
  21             'title': 'Warcraft Trailer 1', 
  22             'description': 'Watch Trailer 1 from Warcraft (2016). Legendary’s WARCRAFT is a 3D epic adventure of world-colliding conflict based.', 
  23             'thumbnail': r
're:^https?://.*\.jpg$', 
  24             'timestamp': 1446843055, 
  25             'upload_date': '20151106', 
  26             'uploader': 'Movieclips', 
  28         'add_ie': ['ThePlatform'], 
  31     def _real_extract(self
, url
): 
  32         video_id 
= self
._match
_id
(url
) 
  33         webpage 
= self
._download
_webpage
(url
, video_id
) 
  34         video 
= next(v 
for v 
in self
._parse
_json
(self
._search
_regex
( 
  35             r
'var\s+__REACT_ENGINE__\s*=\s*({.+});', 
  36             webpage
, 'react engine'), video_id
)['playlist']['videos'] if v
['id'] == video_id
) 
  39             '_type': 'url_transparent', 
  40             'ie_key': 'ThePlatform', 
  41             'url': smuggle_url(update_url_query( 
  42                 video
['contentUrl'], {'mbr': 'true'}), {'force_smil_url': True}), 
  43             'title': self
._og
_search
_title
(webpage
), 
  44             'description': self
._html
_search
_meta
('description', webpage
), 
  45             'duration': float_or_none(video
.get('duration')), 
  46             'timestamp': parse_iso8601(video
.get('dateCreated')), 
  47             'thumbnail': video
.get('defaultImage'), 
  48             'uploader': video
.get('provider'),