2 from __future__ import unicode_literals
6 from .common import InfoExtractor
7 from ..utils import js_to_json
10 class Tele13IE(InfoExtractor):
11 _VALID_URL = r'^http://(?:www\.)?t13\.cl/videos(?:/[^/]+)+/(?P<id>[\w-]+)'
14 'url': 'http://www.t13.cl/videos/actualidad/el-circulo-de-hierro-de-michelle-bachelet-en-su-regreso-a-la-moneda',
15 'md5': '4cb1fa38adcad8fea88487a078831755',
17 'id': 'el-circulo-de-hierro-de-michelle-bachelet-en-su-regreso-a-la-moneda',
19 'title': 'El c\u00edrculo de hierro de Michelle Bachelet en su regreso a La Moneda',
23 'url': 'http://www.t13.cl/videos/mundo/tendencias/video-captan-misteriosa-bola-fuego-cielos-bangkok',
24 'md5': '65d1ae54812c96f4b345dd21d3bb1adc',
28 'title': 'Shooting star seen on 7-Sep-2015',
29 'description': 'md5:a1cd2e74f6ee6851552c9cf5851d6b06',
30 'uploader': 'Porjai Jaturongkhakun',
31 'upload_date': '20150906',
32 'uploader_id': 'UCnLY_3ezwNcDSC_Wc6suZxw',
34 'add_ie': ['Youtube'],
38 def _real_extract(self, url):
39 display_id = self._match_id(url)
41 webpage = self._download_webpage(url, display_id)
43 setup_js = self._parse_json(
46 r"jwplayer\('player-vivo'\).setup\((\{.*?\})\)",
54 title = setup_js['title']
55 thumbnail = setup_js.get('image') or setup_js['playlist'][0].get('image')
56 description = self._html_search_meta(
57 'description', webpage, 'description')
60 for f in setup_js['playlist'][0]['sources']:
61 format_url = f['file']
63 if '.m3u8' in format_url:
64 formats.extend(self._extract_m3u8_formats(format_url, display_id))
66 if 'youtube.com' in format_url:
67 return self.url_result(format_url, 'Youtube')
69 formats.append({'url': format_url, 'format_id': f.get('label')})
74 'description': description,
75 'thumbnail': thumbnail,