]>
Commit | Line | Data |
---|---|---|
9f62eaf4 | 1 | # coding: utf-8 |
2d73b458 | 2 | from __future__ import unicode_literals |
9f62eaf4 | 3 | |
2d73b458 JO |
4 | import re |
5 | ||
6 | from .common import InfoExtractor | |
7 | ||
8 | ||
9 | class Canal13clIE(InfoExtractor): | |
9f62eaf4 PH |
10 | _VALID_URL = r'^http://(?:www\.)?13\.cl/(?:[^/?#]+/)*(?P<id>[^/?#]+)' |
11 | _TEST = { | |
12 | 'url': 'http://www.13.cl/t13/nacional/el-circulo-de-hierro-de-michelle-bachelet-en-su-regreso-a-la-moneda', | |
13 | 'md5': '4cb1fa38adcad8fea88487a078831755', | |
14 | 'info_dict': { | |
15 | 'id': '1403022125', | |
16 | 'display_id': 'el-circulo-de-hierro-de-michelle-bachelet-en-su-regreso-a-la-moneda', | |
17 | 'ext': 'mp4', | |
18 | 'title': 'El "círculo de hierro" de Michelle Bachelet en su regreso a La Moneda', | |
19 | 'description': '(Foto: Agencia Uno) En nueve días más, Michelle Bachelet va a asumir por segunda vez como presidenta de la República. Entre aquellos que la acompañarán hay caras que se repiten y otras que se consolidan en su entorno de colaboradores más cercanos.', | |
20 | } | |
21 | } | |
2d73b458 JO |
22 | |
23 | def _real_extract(self, url): | |
9f62eaf4 PH |
24 | mobj = re.match(self._VALID_URL, url) |
25 | display_id = mobj.group('id') | |
26 | ||
27 | webpage = self._download_webpage(url, display_id) | |
28 | ||
29 | title = self._html_search_meta( | |
30 | 'twitter:title', webpage, 'title', fatal=True) | |
31 | description = self._html_search_meta( | |
32 | 'twitter:description', webpage, 'description') | |
2d73b458 | 33 | url = self._html_search_regex( |
9f62eaf4 PH |
34 | r'articuloVideo = \"(.*?)\"', webpage, 'url') |
35 | real_id = self._search_regex( | |
36 | r'[^0-9]([0-9]{7,})[^0-9]', url, 'id', default=display_id) | |
37 | thumbnail = self._html_search_regex( | |
38 | r'articuloImagen = \"(.*?)\"', webpage, 'thumbnail') | |
2d73b458 JO |
39 | |
40 | return { | |
9f62eaf4 PH |
41 | 'id': real_id, |
42 | 'display_id': display_id, | |
2d73b458 JO |
43 | 'url': url, |
44 | 'title': title, | |
9f62eaf4 | 45 | 'description': description, |
2d73b458 | 46 | 'ext': 'mp4', |
9f62eaf4 | 47 | 'thumbnail': thumbnail, |
2d73b458 | 48 | } |