]>
Commit | Line | Data |
---|---|---|
fa023ccb | 1 | from .common import InfoExtractor |
b99af8a5 YCH |
2 | from ..utils import ( |
3 | ExtractorError, | |
4 | remove_end, | |
5 | ) | |
fa023ccb S |
6 | |
7 | ||
8 | class BioBioChileTVIE(InfoExtractor): | |
b99af8a5 | 9 | _VALID_URL = r'https?://(?:tv|www)\.biobiochile\.cl/(?:notas|noticias)/(?:[^/]+/)+(?P<id>[^/]+)\.shtml' |
fa023ccb S |
10 | |
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', | |
ec85ded8 | 18 | 'thumbnail': r're:^https?://.*\.jpg$', |
fa023ccb S |
19 | 'uploader': 'Fernando Atria', |
20 | }, | |
b99af8a5 | 21 | 'skip': 'URL expired and redirected to http://www.biobiochile.cl/portada/bbtv/index.html', |
fa023ccb S |
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', | |
ec85ded8 | 30 | 'thumbnail': r're:^https?://.*\.jpg$', |
fa023ccb S |
31 | 'uploader': 'Piangella Obrador', |
32 | }, | |
33 | 'params': { | |
34 | 'skip_download': True, | |
35 | }, | |
b99af8a5 YCH |
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': { | |
0441d626 | 40 | 'id': 'b4xd0LK3SK', |
b99af8a5 | 41 | 'ext': 'mp4', |
0441d626 RA |
42 | # TODO: fix url_transparent information overriding |
43 | # 'uploader': 'Juan Pablo Echenique', | |
44 | 'title': 'Comentario Oscar Cáceres', | |
45 | }, | |
46 | 'params': { | |
47 | # empty m3u8 manifest | |
48 | 'skip_download': True, | |
b99af8a5 | 49 | }, |
fa023ccb S |
50 | }, { |
51 | 'url': 'http://tv.biobiochile.cl/notas/2015/10/22/ninos-transexuales-de-quien-es-la-decision.shtml', | |
52 | 'only_matching': True, | |
53 | }, { | |
54 | 'url': 'http://tv.biobiochile.cl/notas/2015/10/21/exclusivo-hector-pinto-formador-de-chupete-revela-version-del-ex-delantero-albo.shtml', | |
55 | 'only_matching': True, | |
56 | }] | |
57 | ||
58 | def _real_extract(self, url): | |
59 | video_id = self._match_id(url) | |
60 | ||
61 | webpage = self._download_webpage(url, video_id) | |
62 | ||
0441d626 RA |
63 | rudo_url = self._search_regex( |
64 | r'<iframe[^>]+src=(?P<q1>[\'"])(?P<url>(?:https?:)?//rudo\.video/vod/[0-9a-zA-Z]+)(?P=q1)', | |
65 | webpage, 'embed URL', None, group='url') | |
b99af8a5 YCH |
66 | if not rudo_url: |
67 | raise ExtractorError('No videos found') | |
fa023ccb | 68 | |
b99af8a5 | 69 | title = remove_end(self._og_search_title(webpage), ' - BioBioChile TV') |
fa023ccb S |
70 | |
71 | thumbnail = self._og_search_thumbnail(webpage) | |
72 | uploader = self._html_search_regex( | |
0441d626 | 73 | r'<a[^>]+href=["\'](?:https?://(?:busca|www)\.biobiochile\.cl)?/(?:lista/)?(?:author|autor)[^>]+>(.+?)</a>', |
fa023ccb S |
74 | webpage, 'uploader', fatal=False) |
75 | ||
76 | return { | |
b99af8a5 YCH |
77 | '_type': 'url_transparent', |
78 | 'url': rudo_url, | |
fa023ccb S |
79 | 'id': video_id, |
80 | 'title': title, | |
81 | 'thumbnail': thumbnail, | |
82 | 'uploader': uploader, | |
fa023ccb | 83 | } |