2 from __future__ import unicode_literals
4 from .common import InfoExtractor
12 class MediciIE(InfoExtractor):
13 _VALID_URL = r'https?://(?:www\.)?medici\.tv/#!/(?P<id>[^?#&]+)'
15 'url': 'http://www.medici.tv/#!/daniel-harding-frans-helmerson-verbier-festival-music-camp',
16 'md5': '004c21bb0a57248085b6ff3fec72719d',
20 'title': 'Daniel Harding conducts the Verbier Festival Music Camp \u2013 With Frans Helmerson',
21 'description': 'md5:322a1e952bafb725174fd8c1a8212f58',
22 'thumbnail': r're:^https?://.*\.jpg$',
23 'upload_date': '20170408',
27 def _real_extract(self, url):
28 video_id = self._match_id(url)
30 # Sets csrftoken cookie
31 self._download_webpage(url, video_id)
33 MEDICI_URL = 'http://www.medici.tv/'
35 data = self._download_json(
37 data=urlencode_postdata({
39 'page': '/%s' % video_id,
40 'timezone_offset': -420,
42 'X-CSRFToken': self._get_cookies(url)['csrftoken'].value,
43 'X-Requested-With': 'XMLHttpRequest',
44 'Referer': MEDICI_URL,
45 'Content-Type': 'application/x-www-form-urlencoded',
48 video = data['video']['videos']['video1']
50 title = video.get('nom') or data['title']
52 video_id = video.get('id') or video_id
53 formats = self._extract_f4m_formats(
54 update_url_query(video['url_akamai'], {
56 'plugin=aasp': '3.1.0.43.124',
57 }), video_id, f4m_id='hds')
59 description = data.get('meta_description')
60 thumbnail = video.get('url_thumbnail') or data.get('main_image')
61 upload_date = unified_strdate(data['video'].get('date'))
66 'description': description,
67 'thumbnail': thumbnail,
68 'upload_date': upload_date,