]>
Commit | Line | Data |
---|---|---|
fa023ccb S |
1 | # coding: utf-8 |
2 | from __future__ import unicode_literals | |
3 | ||
4 | from .common import InfoExtractor | |
b99af8a5 YCH |
5 | from ..utils import ( |
6 | ExtractorError, | |
7 | remove_end, | |
8 | ) | |
fa023ccb S |
9 | |
10 | ||
11 | class BioBioChileTVIE(InfoExtractor): | |
b99af8a5 | 12 | _VALID_URL = r'https?://(?:tv|www)\.biobiochile\.cl/(?:notas|noticias)/(?:[^/]+/)+(?P<id>[^/]+)\.shtml' |
fa023ccb S |
13 | |
14 | _TESTS = [{ | |
15 | 'url': 'http://tv.biobiochile.cl/notas/2015/10/21/sobre-camaras-y-camarillas-parlamentarias.shtml', | |
16 | 'md5': '26f51f03cf580265defefb4518faec09', | |
17 | 'info_dict': { | |
18 | 'id': 'sobre-camaras-y-camarillas-parlamentarias', | |
19 | 'ext': 'mp4', | |
20 | 'title': 'Sobre Cámaras y camarillas parlamentarias', | |
ec85ded8 | 21 | 'thumbnail': r're:^https?://.*\.jpg$', |
fa023ccb S |
22 | 'uploader': 'Fernando Atria', |
23 | }, | |
b99af8a5 | 24 | 'skip': 'URL expired and redirected to http://www.biobiochile.cl/portada/bbtv/index.html', |
fa023ccb S |
25 | }, { |
26 | # different uploader layout | |
27 | 'url': 'http://tv.biobiochile.cl/notas/2016/03/18/natalia-valdebenito-repasa-a-diputado-hasbun-paso-a-la-categoria-de-hablar-brutalidades.shtml', | |
28 | 'md5': 'edc2e6b58974c46d5b047dea3c539ff3', | |
29 | 'info_dict': { | |
30 | 'id': 'natalia-valdebenito-repasa-a-diputado-hasbun-paso-a-la-categoria-de-hablar-brutalidades', | |
31 | 'ext': 'mp4', | |
32 | 'title': 'Natalia Valdebenito repasa a diputado Hasbún: Pasó a la categoría de hablar brutalidades', | |
ec85ded8 | 33 | 'thumbnail': r're:^https?://.*\.jpg$', |
fa023ccb S |
34 | 'uploader': 'Piangella Obrador', |
35 | }, | |
36 | 'params': { | |
37 | 'skip_download': True, | |
38 | }, | |
b99af8a5 YCH |
39 | 'skip': 'URL expired and redirected to http://www.biobiochile.cl/portada/bbtv/index.html', |
40 | }, { | |
41 | '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', | |
42 | 'info_dict': { | |
0441d626 | 43 | 'id': 'b4xd0LK3SK', |
b99af8a5 | 44 | 'ext': 'mp4', |
0441d626 RA |
45 | # TODO: fix url_transparent information overriding |
46 | # 'uploader': 'Juan Pablo Echenique', | |
47 | 'title': 'Comentario Oscar Cáceres', | |
48 | }, | |
49 | 'params': { | |
50 | # empty m3u8 manifest | |
51 | 'skip_download': True, | |
b99af8a5 | 52 | }, |
fa023ccb S |
53 | }, { |
54 | 'url': 'http://tv.biobiochile.cl/notas/2015/10/22/ninos-transexuales-de-quien-es-la-decision.shtml', | |
55 | 'only_matching': True, | |
56 | }, { | |
57 | 'url': 'http://tv.biobiochile.cl/notas/2015/10/21/exclusivo-hector-pinto-formador-de-chupete-revela-version-del-ex-delantero-albo.shtml', | |
58 | 'only_matching': True, | |
59 | }] | |
60 | ||
61 | def _real_extract(self, url): | |
62 | video_id = self._match_id(url) | |
63 | ||
64 | webpage = self._download_webpage(url, video_id) | |
65 | ||
0441d626 RA |
66 | rudo_url = self._search_regex( |
67 | r'<iframe[^>]+src=(?P<q1>[\'"])(?P<url>(?:https?:)?//rudo\.video/vod/[0-9a-zA-Z]+)(?P=q1)', | |
68 | webpage, 'embed URL', None, group='url') | |
b99af8a5 YCH |
69 | if not rudo_url: |
70 | raise ExtractorError('No videos found') | |
fa023ccb | 71 | |
b99af8a5 | 72 | title = remove_end(self._og_search_title(webpage), ' - BioBioChile TV') |
fa023ccb S |
73 | |
74 | thumbnail = self._og_search_thumbnail(webpage) | |
75 | uploader = self._html_search_regex( | |
0441d626 | 76 | r'<a[^>]+href=["\'](?:https?://(?:busca|www)\.biobiochile\.cl)?/(?:lista/)?(?:author|autor)[^>]+>(.+?)</a>', |
fa023ccb S |
77 | webpage, 'uploader', fatal=False) |
78 | ||
79 | return { | |
b99af8a5 YCH |
80 | '_type': 'url_transparent', |
81 | 'url': rudo_url, | |
fa023ccb S |
82 | 'id': video_id, |
83 | 'title': title, | |
84 | 'thumbnail': thumbnail, | |
85 | 'uploader': uploader, | |
fa023ccb | 86 | } |