]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/tutv.py
362318b24b5df786cc98b9688d2859258e15178f
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
10 class TutvIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://(?:www\.)?tu\.tv/videos/(?P<id>[^/?]+)'
13 'url': 'http://tu.tv/videos/robots-futbolistas',
14 'md5': '0cd9e28ad270488911b0d2a72323395d',
18 'title': 'Robots futbolistas',
22 def _real_extract(self
, url
):
23 video_id
= self
._match
_id
(url
)
24 webpage
= self
._download
_webpage
(url
, video_id
)
26 internal_id
= self
._search
_regex
(r
'codVideo=([0-9]+)', webpage
, 'internal video ID')
28 data_content
= self
._download
_webpage
(
29 'http://tu.tv/flvurl.php?codVideo=%s' % internal_id
, video_id
, 'Downloading video info')
30 video_url
= compat_b64decode(compat_parse_qs(data_content
)['kpt'][0]).decode('utf-8')
35 'title': self
._og
_search
_title
(webpage
),