2016-06-17 23:06:19 +02:00
|
|
|
# coding: utf-8
|
2014-08-18 22:43:35 +02:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2021-01-01 13:26:37 +01:00
|
|
|
from .telecinco import TelecincoIE
|
2014-12-13 12:24:42 +01:00
|
|
|
from ..utils import (
|
2015-09-16 18:27:03 +02:00
|
|
|
int_or_none,
|
2019-12-25 20:01:25 +01:00
|
|
|
parse_iso8601,
|
2014-08-18 22:43:35 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2021-01-01 13:26:37 +01:00
|
|
|
class MiTeleIE(TelecincoIE):
|
2015-09-16 18:39:48 +02:00
|
|
|
IE_DESC = 'mitele.es'
|
2016-11-19 19:23:49 +01:00
|
|
|
_VALID_URL = r'https?://(?:www\.)?mitele\.es/(?:[^/]+/)+(?P<id>[^/]+)/player'
|
2014-08-18 22:43:35 +02:00
|
|
|
|
2016-06-17 23:06:19 +02:00
|
|
|
_TESTS = [{
|
2016-10-04 03:04:24 +02:00
|
|
|
'url': 'http://www.mitele.es/programas-tv/diario-de/57b0dfb9c715da65618b4afa/player',
|
2014-08-18 22:43:35 +02:00
|
|
|
'info_dict': {
|
2018-07-28 07:52:36 +02:00
|
|
|
'id': 'FhYW1iNTE6J6H7NkQRIEzfne6t2quqPg',
|
2016-07-07 00:08:44 +02:00
|
|
|
'ext': 'mp4',
|
2019-12-25 20:01:25 +01:00
|
|
|
'title': 'Diario de La redacción Programa 144',
|
|
|
|
'description': 'md5:07c35a7b11abb05876a6a79185b58d27',
|
2016-06-17 23:06:19 +02:00
|
|
|
'series': 'Diario de',
|
2019-12-25 20:01:25 +01:00
|
|
|
'season': 'Season 14',
|
2016-11-24 16:43:02 +01:00
|
|
|
'season_number': 14,
|
2019-12-25 20:01:25 +01:00
|
|
|
'episode': 'Tor, la web invisible',
|
2016-11-24 16:43:02 +01:00
|
|
|
'episode_number': 3,
|
2017-01-02 13:08:07 +01:00
|
|
|
'thumbnail': r're:(?i)^https?://.*\.jpg$',
|
2014-08-18 22:43:35 +02:00
|
|
|
'duration': 2913,
|
2019-12-25 20:01:25 +01:00
|
|
|
'age_limit': 16,
|
|
|
|
'timestamp': 1471209401,
|
|
|
|
'upload_date': '20160814',
|
2014-08-18 22:43:35 +02:00
|
|
|
},
|
2016-06-17 23:06:19 +02:00
|
|
|
}, {
|
|
|
|
# no explicit title
|
2016-10-04 03:04:24 +02:00
|
|
|
'url': 'http://www.mitele.es/programas-tv/cuarto-milenio/57b0de3dc915da14058b4876/player',
|
2016-06-17 23:06:19 +02:00
|
|
|
'info_dict': {
|
2018-07-28 07:52:36 +02:00
|
|
|
'id': 'oyNG1iNTE6TAPP-JmCjbwfwJqqMMX3Vq',
|
2016-07-07 00:08:44 +02:00
|
|
|
'ext': 'mp4',
|
2016-10-04 03:04:24 +02:00
|
|
|
'title': 'Cuarto Milenio Temporada 6 Programa 226',
|
|
|
|
'description': 'md5:5ff132013f0cd968ffbf1f5f3538a65f',
|
2016-06-17 23:06:19 +02:00
|
|
|
'series': 'Cuarto Milenio',
|
2019-12-25 20:01:25 +01:00
|
|
|
'season': 'Season 6',
|
2016-11-24 16:43:02 +01:00
|
|
|
'season_number': 6,
|
2019-12-25 20:01:25 +01:00
|
|
|
'episode': 'Episode 24',
|
2016-11-24 16:43:02 +01:00
|
|
|
'episode_number': 24,
|
2017-01-02 13:08:07 +01:00
|
|
|
'thumbnail': r're:(?i)^https?://.*\.jpg$',
|
2016-10-04 03:04:24 +02:00
|
|
|
'duration': 7313,
|
2019-12-25 20:01:25 +01:00
|
|
|
'age_limit': 12,
|
|
|
|
'timestamp': 1471209021,
|
|
|
|
'upload_date': '20160814',
|
2016-06-17 23:06:19 +02:00
|
|
|
},
|
|
|
|
'params': {
|
|
|
|
'skip_download': True,
|
2021-01-01 13:26:37 +01:00
|
|
|
},
|
2016-11-19 19:23:49 +01:00
|
|
|
}, {
|
|
|
|
'url': 'http://www.mitele.es/series-online/la-que-se-avecina/57aac5c1c915da951a8b45ed/player',
|
|
|
|
'only_matching': True,
|
2019-12-25 20:01:25 +01:00
|
|
|
}, {
|
|
|
|
'url': 'https://www.mitele.es/programas-tv/diario-de/la-redaccion/programa-144-40_1006364575251/player/',
|
|
|
|
'only_matching': True,
|
2016-06-17 23:06:19 +02:00
|
|
|
}]
|
2014-08-18 22:43:35 +02:00
|
|
|
|
|
|
|
def _real_extract(self, url):
|
2019-12-25 20:01:25 +01:00
|
|
|
display_id = self._match_id(url)
|
|
|
|
webpage = self._download_webpage(url, display_id)
|
|
|
|
pre_player = self._parse_json(self._search_regex(
|
|
|
|
r'window\.\$REACTBASE_STATE\.prePlayer_mtweb\s*=\s*({.+})',
|
|
|
|
webpage, 'Pre Player'), display_id)['prePlayer']
|
|
|
|
title = pre_player['title']
|
2021-01-01 13:26:37 +01:00
|
|
|
video_info = self._parse_content(pre_player['video'], url)
|
2019-12-25 20:01:25 +01:00
|
|
|
content = pre_player.get('content') or {}
|
|
|
|
info = content.get('info') or {}
|
2015-09-16 18:27:03 +02:00
|
|
|
|
2021-01-01 13:26:37 +01:00
|
|
|
video_info.update({
|
2015-09-16 18:27:03 +02:00
|
|
|
'title': title,
|
2019-12-25 20:01:25 +01:00
|
|
|
'description': info.get('synopsis'),
|
|
|
|
'series': content.get('title'),
|
|
|
|
'season_number': int_or_none(info.get('season_number')),
|
|
|
|
'episode': content.get('subtitle'),
|
|
|
|
'episode_number': int_or_none(info.get('episode_number')),
|
|
|
|
'duration': int_or_none(info.get('duration')),
|
|
|
|
'age_limit': int_or_none(info.get('rating')),
|
|
|
|
'timestamp': parse_iso8601(pre_player.get('publishedTime')),
|
2021-01-01 13:26:37 +01:00
|
|
|
})
|
|
|
|
return video_info
|