This commit is contained in:
kenavera 2020-09-24 01:04:11 -05:00 committed by GitHub
commit afaface217
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 14 deletions

View File

@ -10,6 +10,7 @@ from ..utils import (
parse_duration,
try_get,
unified_timestamp,
unified_strdate
)
@ -60,13 +61,13 @@ class MedialaanIE(GigyaBaseIE):
# clip
'url': 'http://vtm.be/video?aid=168332',
'info_dict': {
'id': '168332',
'id': 'vtm_168332',
'ext': 'mp4',
'title': '"Veronique liegt!"',
'description': 'md5:1385e2b743923afe54ba4adc38476155',
'duration': 96,
'timestamp': 1489002029,
'upload_date': '20170308',
'duration': 96,
},
}, {
# vod
@ -147,22 +148,31 @@ class MedialaanIE(GigyaBaseIE):
# clip, no authentication required
if not vod_id:
player = self._parse_json(
settings = self._parse_json(
self._search_regex(
r'vmmaplayer\(({.+?})\);', webpage, 'vmma player',
default=''),
video_id, transform_source=lambda s: '[%s]' % s, fatal=False)
if player:
video = player[-1]
if video['videoUrl'] in ('http', 'https'):
return self.url_result(video['url'], MedialaanIE.ie_key())
r'jQuery\.extend\(Drupal\.settings\s*,\s*({.+?})\);',
webpage, 'drupal settings', default='{}'),
video_id)
if not re.match(video_id, 'vtm_[0-9]*'):
video_id = settings.get('medialaan_player').keys()[0]
config = try_get(settings, lambda x: x['medialaan_player'][video_id]['videoConfig'], None)
video = config.get('video')
metadata = config.get('tracking').get('metadata')
pubdate = metadata.get('pubDate') or self._search_regex(
r'"%s"\s*:\s*"([^"]+)' % 'pubDate', webpage, 'pubDate',
default=None)
if video:
info = {
'id': video_id,
'url': video['videoUrl'],
'title': video['title'],
'thumbnail': video.get('imageUrl'),
'timestamp': int_or_none(video.get('createdDate')),
'formats': video.get('formats'),
'title': metadata.get('videoTitle') or self._og_search_title(webpage),
'thumbnail': video.get('poster'),
'timestamp': unified_timestamp(pubdate),
'duration': int_or_none(video.get('duration')),
'upload_date': unified_strdate(pubdate)
}
else:
info = self._parse_html5_media_entries(