]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/movieclips.py
456807dd1c4487332a4e0006448074010e86117b
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
13 class MovieClipsIE(InfoExtractor
):
14 _VALID_URL
= r
'https?://movieclips\.com/(?P<id>[\da-zA-Z]+)(?:-(?P<display_id>[\da-z-]+))?'
16 'url': 'http://movieclips.com/Wy7ZU-my-week-with-marilyn-movie-do-you-love-me/',
19 'display_id': 'my-week-with-marilyn-movie-do-you-love-me',
21 'title': 'My Week with Marilyn - Do You Love Me?',
22 'description': 'md5:e86795bd332fe3cff461e7c8dc542acb',
23 'thumbnail': 're:^https?://.*\.jpg$',
27 'skip_download': True,
31 def _real_extract(self
, url
):
32 mobj
= re
.match(self
._VALID
_URL
, url
)
33 video_id
= mobj
.group('id')
34 display_id
= mobj
.group('display_id')
35 show_id
= display_id
or video_id
37 config
= self
._download
_xml
(
38 'http://config.movieclips.com/player/config/%s' % video_id
,
39 show_id
, 'Downloading player config')
41 if config
.find('./country-region').text
== 'false':
43 '%s said: %s' % (self
.IE_NAME
, config
.find('./region_alert').text
), expected
=True)
45 properties
= config
.find('./video/properties')
46 smil_file
= properties
.attrib
['smil_file']
48 smil
= self
._download
_xml
(smil_file
, show_id
, 'Downloading SMIL')
49 base_url
= smil
.find('./head/meta').attrib
['base']
52 for video
in smil
.findall('./body/switch/video'):
53 vbr
= int(video
.attrib
['system-bitrate']) / 1000
54 src
= video
.attrib
['src']
58 'ext': src
.split(':')[0],
60 'format_id': '%dk' % vbr
,
63 self
._sort
_formats
(formats
)
65 title
= '%s - %s' % (properties
.attrib
['clip_movie_title'], properties
.attrib
['clip_title'])
66 description
= clean_html(compat_str(properties
.attrib
['clip_description']))
67 thumbnail
= properties
.attrib
['image']
68 categories
= properties
.attrib
['clip_categories'].split(',')
72 'display_id': display_id
,
74 'description': description
,
75 'thumbnail': thumbnail
,
76 'categories': categories
,