Allowing URLs for 13.cl without the /programas prefix
[youtube-dl] / youtube_dl / extractor / canal13cl.py
1 from __future__ import unicode_literals
2 import re
3
4 from .common import InfoExtractor
5
6
7 class Canal13clIE(InfoExtractor):
8     _VALID_URL = r'^http://(?:www\.)?13\.cl/'
9     IE_NAME = 'Canal13cl'
10
11     def _real_extract(self, url):
12         webpage = self._download_webpage(url, url)
13         video_id = self._html_search_regex(
14             r'http://streaming.13.cl/(.*)\.mp4',
15             webpage, u'video_id')
16         title = self._html_search_regex(
17             r'(articuloTitulo = \"(.*?)\"|(.*?)\|)',
18             webpage, u'title')
19         url = self._html_search_regex(
20             r'articuloVideo = \"(.*?)\"',
21             webpage, u'url')
22         thumbnail = self._html_search_regex (
23             r'articuloImagen = \"(.*?)\"',
24             webpage, u'thumbnail')
25
26         return {
27             'video_id': video_id,
28             'url': url,
29             'title': title,
30             'ext': 'mp4',
31             'thumbnail': thumbnail
32         }