aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/canal13cl.py
blob: 781c1b50375d50d37d8041c8138ea76ca34196d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from __future__ import unicode_literals
import re

from .common import InfoExtractor


class Canal13clIE(InfoExtractor):
    _VALID_URL = r'^http://(?:www\.)?13\.cl/'
    IE_NAME = 'Canal13cl'

    def _real_extract(self, url):
        webpage = self._download_webpage(url, url)
        video_id = self._html_search_regex(
            r'http://streaming.13.cl/(.*)\.mp4',
            webpage, u'video_id')
        title = self._html_search_regex(
            r'(articuloTitulo = \"(.*?)\"|(.*?)\|)',
            webpage, u'title')
        url = self._html_search_regex(
            r'articuloVideo = \"(.*?)\"',
            webpage, u'url')
        thumbnail = self._html_search_regex (
            r'articuloImagen = \"(.*?)\"',
            webpage, u'thumbnail')

        return {
            'video_id': video_id,
            'url': url,
            'title': title,
            'ext': 'mp4',
            'thumbnail': thumbnail
        }