]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/tutv.py
822372ea14e52c08d0e95f81a4618c122b2232d8
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
6 from ..compat
import compat_parse_qs
9 class TutvIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:www\.)?tu\.tv/videos/(?P<id>[^/?]+)'
12 'url': 'http://tu.tv/videos/robots-futbolistas',
13 'md5': '0cd9e28ad270488911b0d2a72323395d',
17 'title': 'Robots futbolistas',
21 def _real_extract(self
, url
):
22 video_id
= self
._match
_id
(url
)
23 webpage
= self
._download
_webpage
(url
, video_id
)
25 internal_id
= self
._search
_regex
(r
'codVideo=([0-9]+)', webpage
, 'internal video ID')
27 data_content
= self
._download
_webpage
(
28 'http://tu.tv/flvurl.php?codVideo=%s' % internal_id
, video_id
, 'Downloading video info')
29 video_url
= base64
.b64decode(compat_parse_qs(data_content
)['kpt'][0].encode('utf-8')).decode('utf-8')
34 'title': self
._og
_search
_title
(webpage
),