]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/medici.py
1 from .common
import InfoExtractor
9 class MediciIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:www\.)?medici\.tv/#!/(?P<id>[^?#&]+)'
12 'url': 'http://www.medici.tv/#!/daniel-harding-frans-helmerson-verbier-festival-music-camp',
13 'md5': '004c21bb0a57248085b6ff3fec72719d',
17 'title': 'Daniel Harding conducts the Verbier Festival Music Camp \u2013 With Frans Helmerson',
18 'description': 'md5:322a1e952bafb725174fd8c1a8212f58',
19 'thumbnail': r
're:^https?://.*\.jpg$',
20 'upload_date': '20170408',
24 def _real_extract(self
, url
):
25 video_id
= self
._match
_id
(url
)
27 # Sets csrftoken cookie
28 self
._download
_webpage
(url
, video_id
)
30 MEDICI_URL
= 'http://www.medici.tv/'
32 data
= self
._download
_json
(
34 data
=urlencode_postdata({
36 'page': '/%s' % video_id
,
37 'timezone_offset': -420,
39 'X-CSRFToken': self
._get
_cookies
(url
)['csrftoken'].value
,
40 'X-Requested-With': 'XMLHttpRequest',
41 'Referer': MEDICI_URL
,
42 'Content-Type': 'application/x-www-form-urlencoded',
45 video
= data
['video']['videos']['video1']
47 title
= video
.get('nom') or data
['title']
49 video_id
= video
.get('id') or video_id
50 formats
= self
._extract
_f
4m
_formats
(
51 update_url_query(video
['url_akamai'], {
53 'plugin=aasp': '3.1.0.43.124',
54 }), video_id
, f4m_id
='hds')
56 description
= data
.get('meta_description')
57 thumbnail
= video
.get('url_thumbnail') or data
.get('main_image')
58 upload_date
= unified_strdate(data
['video'].get('date'))
63 'description': description
,
64 'thumbnail': thumbnail
,
65 'upload_date': upload_date
,