You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.5 KiB

10 years ago
  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .mitele import MiTeleBaseIE
  4. class TelecincoIE(MiTeleBaseIE):
  5. IE_DESC = 'telecinco.es, cuatro.com and mediaset.es'
  6. _VALID_URL = r'https?://(?:www\.)?(?:telecinco\.es|cuatro\.com|mediaset\.es)/(?:[^/]+/)+(?P<id>.+?)\.html'
  7. _TESTS = [{
  8. 'url': 'http://www.telecinco.es/robinfood/temporada-01/t01xp14/Bacalao-cocochas-pil-pil_0_1876350223.html',
  9. 'md5': '8d7b2d5f699ee2709d992a63d5cd1712',
  10. 'info_dict': {
  11. 'id': 'JEA5ijCnF6p5W08A1rNKn7',
  12. 'ext': 'mp4',
  13. 'title': 'Bacalao con kokotxas al pil-pil',
  14. 'description': 'md5:1382dacd32dd4592d478cbdca458e5bb',
  15. 'duration': 662,
  16. },
  17. }, {
  18. 'url': 'http://www.cuatro.com/deportes/futbol/barcelona/Leo_Messi-Champions-Roma_2_2052780128.html',
  19. 'md5': '284393e5387b3b947b77c613ef04749a',
  20. 'info_dict': {
  21. 'id': 'jn24Od1zGLG4XUZcnUnZB6',
  22. 'ext': 'mp4',
  23. 'title': '¿Quién es este ex futbolista con el que hablan Leo Messi y Luis Suárez?',
  24. 'description': 'md5:a62ecb5f1934fc787107d7b9a2262805',
  25. 'duration': 79,
  26. },
  27. }, {
  28. 'url': 'http://www.mediaset.es/12meses/campanas/doylacara/conlatratanohaytrato/Ayudame-dar-cara-trata-trato_2_1986630220.html',
  29. 'md5': '749afab6ea5a136a8806855166ae46a2',
  30. 'info_dict': {
  31. 'id': 'aywerkD2Sv1vGNqq9b85Q2',
  32. 'ext': 'mp4',
  33. 'title': '#DOYLACARA. Con la trata no hay trato',
  34. 'description': 'md5:2771356ff7bfad9179c5f5cd954f1477',
  35. 'duration': 50,
  36. },
  37. }, {
  38. 'url': 'http://www.telecinco.es/informativos/nacional/Pablo_Iglesias-Informativos_Telecinco-entrevista-Pedro_Piqueras_2_1945155182.html',
  39. 'only_matching': True,
  40. }, {
  41. 'url': 'http://www.telecinco.es/espanasinirmaslejos/Espana-gran-destino-turistico_2_1240605043.html',
  42. 'only_matching': True,
  43. }]
  44. def _real_extract(self, url):
  45. display_id = self._match_id(url)
  46. webpage = self._download_webpage(url, display_id)
  47. title = self._html_search_meta(
  48. ['og:title', 'twitter:title'], webpage, 'title')
  49. info = self._get_player_info(url, webpage)
  50. info.update({
  51. 'display_id': display_id,
  52. 'title': title,
  53. 'description': self._html_search_meta(
  54. ['og:description', 'twitter:description'],
  55. webpage, 'title', fatal=False),
  56. })
  57. return info