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Ărculo de hierro de Michelle Bachelet en su regreso a La Moneda',
22 # HTTP Error 404: Not Found
23 'skip_download': True,
27 'url': 'http://www.t13.cl/videos/mundo/tendencias/video-captan-misteriosa-bola-fuego-cielos-bangkok',
28 'md5': '65d1ae54812c96f4b345dd21d3bb1adc',
32 'title': 'Shooting star seen on 7-Sep-2015',
33 'description': 'md5:a1cd2e74f6ee6851552c9cf5851d6b06',
34 'uploader': 'Porjai Jaturongkhakun',
35 'upload_date': '20150906',
36 'uploader_id': 'UCnLY_3ezwNcDSC_Wc6suZxw',
38 'add_ie': ['Youtube'],
42 def _real_extract(self, url):
43 display_id = self._match_id(url)
45 webpage = self._download_webpage(url, display_id)
47 setup_js = self._parse_json(
50 r"jwplayer\('player-vivo'\).setup\((\{.*?\})\)",
58 title = setup_js['title']
59 thumbnail = setup_js.get('image') or setup_js['playlist'][0].get('image')
60 description = self._html_search_meta(
61 'description', webpage, 'description')
64 for f in setup_js['playlist'][0]['sources']:
65 format_url = f['file']
67 if '.m3u8' in format_url:
68 formats.extend(self._extract_m3u8_formats(format_url, display_id))
70 if 'youtube.com' in format_url:
71 return self.url_result(format_url, 'Youtube')
73 formats.append({'url': format_url, 'format_id': f.get('label')})
78 'description': description,
79 'thumbnail': thumbnail,