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.

81 lines
3.3 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. from ..utils import (
  5. ExtractorError,
  6. remove_end,
  7. )
  8. from .rudo import RudoIE
  9. class BioBioChileTVIE(InfoExtractor):
  10. _VALID_URL = r'https?://(?:tv|www)\.biobiochile\.cl/(?:notas|noticias)/(?:[^/]+/)+(?P<id>[^/]+)\.shtml'
  11. _TESTS = [{
  12. 'url': 'http://tv.biobiochile.cl/notas/2015/10/21/sobre-camaras-y-camarillas-parlamentarias.shtml',
  13. 'md5': '26f51f03cf580265defefb4518faec09',
  14. 'info_dict': {
  15. 'id': 'sobre-camaras-y-camarillas-parlamentarias',
  16. 'ext': 'mp4',
  17. 'title': 'Sobre Cámaras y camarillas parlamentarias',
  18. 'thumbnail': r're:^https?://.*\.jpg$',
  19. 'uploader': 'Fernando Atria',
  20. },
  21. 'skip': 'URL expired and redirected to http://www.biobiochile.cl/portada/bbtv/index.html',
  22. }, {
  23. # different uploader layout
  24. 'url': 'http://tv.biobiochile.cl/notas/2016/03/18/natalia-valdebenito-repasa-a-diputado-hasbun-paso-a-la-categoria-de-hablar-brutalidades.shtml',
  25. 'md5': 'edc2e6b58974c46d5b047dea3c539ff3',
  26. 'info_dict': {
  27. 'id': 'natalia-valdebenito-repasa-a-diputado-hasbun-paso-a-la-categoria-de-hablar-brutalidades',
  28. 'ext': 'mp4',
  29. 'title': 'Natalia Valdebenito repasa a diputado Hasbún: Pasó a la categoría de hablar brutalidades',
  30. 'thumbnail': r're:^https?://.*\.jpg$',
  31. 'uploader': 'Piangella Obrador',
  32. },
  33. 'params': {
  34. 'skip_download': True,
  35. },
  36. 'skip': 'URL expired and redirected to http://www.biobiochile.cl/portada/bbtv/index.html',
  37. }, {
  38. 'url': 'http://www.biobiochile.cl/noticias/bbtv/comentarios-bio-bio/2016/07/08/edecanes-del-congreso-figuras-decorativas-que-le-cuestan-muy-caro-a-los-chilenos.shtml',
  39. 'info_dict': {
  40. 'id': 'edecanes-del-congreso-figuras-decorativas-que-le-cuestan-muy-caro-a-los-chilenos',
  41. 'ext': 'mp4',
  42. 'uploader': '(none)',
  43. 'upload_date': '20160708',
  44. 'title': 'Edecanes del Congreso: Figuras decorativas que le cuestan muy caro a los chilenos',
  45. },
  46. }, {
  47. 'url': 'http://tv.biobiochile.cl/notas/2015/10/22/ninos-transexuales-de-quien-es-la-decision.shtml',
  48. 'only_matching': True,
  49. }, {
  50. 'url': 'http://tv.biobiochile.cl/notas/2015/10/21/exclusivo-hector-pinto-formador-de-chupete-revela-version-del-ex-delantero-albo.shtml',
  51. 'only_matching': True,
  52. }]
  53. def _real_extract(self, url):
  54. video_id = self._match_id(url)
  55. webpage = self._download_webpage(url, video_id)
  56. rudo_url = RudoIE._extract_url(webpage)
  57. if not rudo_url:
  58. raise ExtractorError('No videos found')
  59. title = remove_end(self._og_search_title(webpage), ' - BioBioChile TV')
  60. thumbnail = self._og_search_thumbnail(webpage)
  61. uploader = self._html_search_regex(
  62. r'<a[^>]+href=["\']https?://(?:busca|www)\.biobiochile\.cl/(?:lista/)?(?:author|autor)[^>]+>(.+?)</a>',
  63. webpage, 'uploader', fatal=False)
  64. return {
  65. '_type': 'url_transparent',
  66. 'url': rudo_url,
  67. 'id': video_id,
  68. 'title': title,
  69. 'thumbnail': thumbnail,
  70. 'uploader': uploader,
  71. }