1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-26 18:34:32 +01:00
youtube-dl/youtube_dl/extractor/telecinco.py

63 lines
2.5 KiB
Python
Raw Normal View History

2014-11-23 20:41:03 +01:00
# coding: utf-8
from __future__ import unicode_literals
2016-07-07 00:08:44 +02:00
from .mitele import MiTeleBaseIE
2016-07-07 00:08:44 +02:00
class TelecincoIE(MiTeleBaseIE):
2015-09-16 18:49:26 +02:00
IE_DESC = 'telecinco.es, cuatro.com and mediaset.es'
2016-09-08 13:29:05 +02:00
_VALID_URL = r'https?://(?:www\.)?(?:telecinco\.es|cuatro\.com|mediaset\.es)/(?:[^/]+/)+(?P<id>.+?)\.html'
_TESTS = [{
'url': 'http://www.telecinco.es/robinfood/temporada-01/t01xp14/Bacalao-cocochas-pil-pil_0_1876350223.html',
2016-07-07 00:08:44 +02:00
'md5': '8d7b2d5f699ee2709d992a63d5cd1712',
'info_dict': {
2016-07-07 00:08:44 +02:00
'id': 'JEA5ijCnF6p5W08A1rNKn7',
'ext': 'mp4',
2016-07-07 00:08:44 +02:00
'title': 'Bacalao con kokotxas al pil-pil',
'description': 'md5:1382dacd32dd4592d478cbdca458e5bb',
'duration': 662,
},
2015-09-16 18:37:01 +02:00
}, {
'url': 'http://www.cuatro.com/deportes/futbol/barcelona/Leo_Messi-Champions-Roma_2_2052780128.html',
2016-07-07 00:08:44 +02:00
'md5': '284393e5387b3b947b77c613ef04749a',
2015-09-16 18:37:01 +02:00
'info_dict': {
2016-07-07 00:08:44 +02:00
'id': 'jn24Od1zGLG4XUZcnUnZB6',
2015-09-16 18:37:01 +02:00
'ext': 'mp4',
2016-07-07 00:08:44 +02:00
'title': '¿Quién es este ex futbolista con el que hablan Leo Messi y Luis Suárez?',
'description': 'md5:a62ecb5f1934fc787107d7b9a2262805',
2015-09-16 18:37:01 +02:00
'duration': 79,
},
}, {
'url': 'http://www.mediaset.es/12meses/campanas/doylacara/conlatratanohaytrato/Ayudame-dar-cara-trata-trato_2_1986630220.html',
2016-07-07 00:08:44 +02:00
'md5': '749afab6ea5a136a8806855166ae46a2',
'info_dict': {
2016-07-07 00:08:44 +02:00
'id': 'aywerkD2Sv1vGNqq9b85Q2',
'ext': 'mp4',
'title': '#DOYLACARA. Con la trata no hay trato',
2016-07-07 00:08:44 +02:00
'description': 'md5:2771356ff7bfad9179c5f5cd954f1477',
'duration': 50,
},
}, {
'url': 'http://www.telecinco.es/informativos/nacional/Pablo_Iglesias-Informativos_Telecinco-entrevista-Pedro_Piqueras_2_1945155182.html',
'only_matching': True,
}, {
'url': 'http://www.telecinco.es/espanasinirmaslejos/Espana-gran-destino-turistico_2_1240605043.html',
'only_matching': True,
}]
2015-09-16 18:25:25 +02:00
def _real_extract(self, url):
2016-07-07 00:08:44 +02:00
display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)
title = self._html_search_meta(
['og:title', 'twitter:title'], webpage, 'title')
info = self._get_player_info(url, webpage)
info.update({
'display_id': display_id,
'title': title,
'description': self._html_search_meta(
['og:description', 'twitter:description'],
webpage, 'title', fatal=False),
})
return info