]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/swrmediathek.py
1 from .common
import InfoExtractor
9 class SWRMediathekIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:www\.)?swrmediathek\.de/(?:content/)?player\.htm\?show=(?P<id>[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12})'
13 'url': 'http://swrmediathek.de/player.htm?show=849790d0-dab8-11e3-a953-0026b975f2e6',
14 'md5': '8c5f6f0172753368547ca8413a7768ac',
16 'id': '849790d0-dab8-11e3-a953-0026b975f2e6',
18 'title': 'SWR odysso',
19 'description': 'md5:2012e31baad36162e97ce9eb3f157b8a',
20 'thumbnail': r
're:^http:.*\.jpg$',
22 'upload_date': '20140515',
23 'uploader': 'SWR Fernsehen',
24 'uploader_id': '990030',
27 'url': 'http://swrmediathek.de/player.htm?show=0e1a8510-ddf2-11e3-9be3-0026b975f2e6',
28 'md5': 'b10ab854f912eecc5a6b55cd6fc1f545',
30 'id': '0e1a8510-ddf2-11e3-9be3-0026b975f2e6',
32 'title': 'Nachtcafé - Alltagsdroge Alkohol - zwischen Sektempfang und Komasaufen',
33 'description': 'md5:e0a3adc17e47db2c23aab9ebc36dbee2',
34 'thumbnail': r
're:http://.*\.jpg',
36 'upload_date': '20140516',
37 'uploader': 'SWR Fernsehen',
38 'uploader_id': '990030',
40 'skip': 'redirect to http://swrmediathek.de/index.htm?hinweis=swrlink',
42 'url': 'http://swrmediathek.de/player.htm?show=bba23e10-cb93-11e3-bf7f-0026b975f2e6',
43 'md5': '4382e4ef2c9d7ce6852535fa867a0dd3',
45 'id': 'bba23e10-cb93-11e3-bf7f-0026b975f2e6',
47 'title': 'Saša Stanišic: Vor dem Fest',
48 'description': 'md5:5b792387dc3fbb171eb709060654e8c9',
49 'thumbnail': r
're:http://.*\.jpg',
51 'upload_date': '20140520',
53 'uploader_id': '284670',
55 'skip': 'redirect to http://swrmediathek.de/index.htm?hinweis=swrlink',
58 def _real_extract(self
, url
):
59 video_id
= self
._match
_id
(url
)
61 video
= self
._download
_json
(
62 'http://swrmediathek.de/AjaxEntry?ekey=%s' % video_id
,
63 video_id
, 'Downloading video JSON')
66 title
= attr
['entry_title']
67 media_type
= attr
.get('entry_etype')
70 for entry
in video
.get('sub', []):
71 if entry
.get('name') != 'entry_media':
74 entry_attr
= entry
.get('attr', {})
75 f_url
= entry_attr
.get('val2')
78 codec
= entry_attr
.get('val0')
80 formats
.extend(self
._extract
_m
3u8_formats
(
81 f_url
, video_id
, 'mp4', 'm3u8_native',
82 m3u8_id
='hls', fatal
=False))
84 formats
.extend(self
._extract
_f
4m
_formats
(
85 f_url
+ '?hdcore=3.7.0', video_id
,
86 f4m_id
='hds', fatal
=False))
89 'format_id': determine_protocol({'url': f_url}
),
91 'quality': int_or_none(entry_attr
.get('val1')),
92 'vcodec': codec
if media_type
== 'Video' else 'none',
93 'acodec': codec
if media_type
== 'Audio' else None,
95 self
._sort
_formats
(formats
)
98 entry_pdatet
= attr
.get('entry_pdatet')
100 upload_date
= entry_pdatet
[:-4]
105 'description': attr
.get('entry_descl'),
106 'thumbnail': attr
.get('entry_image_16_9'),
107 'duration': parse_duration(attr
.get('entry_durat')),
108 'upload_date': upload_date
,
109 'uploader': attr
.get('channel_title'),
110 'uploader_id': attr
.get('channel_idkey'),