aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/mitele.py
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-10-23 20:08:55 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-10-23 20:08:55 +0200
commitad5f53ac72d32803819d221b3e9a68331c3002a1 (patch)
treeb020942079c05da0833b53391384e2cdd7cdeb3c /youtube_dl/extractor/mitele.py
parent75da98e9e1f55f8fc27200f2b3d56386ead3b56d (diff)
downloadyoutube-dl-ad5f53ac72d32803819d221b3e9a68331c3002a1.tar.xz
[telecinco] Add extractor (closes #4005)
It uses the same extraction process as mitele.es, but with a few small differences.
Diffstat (limited to 'youtube_dl/extractor/mitele.py')
-rw-r--r--youtube_dl/extractor/mitele.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/youtube_dl/extractor/mitele.py b/youtube_dl/extractor/mitele.py
index 979f3d692..df7fde87c 100644
--- a/youtube_dl/extractor/mitele.py
+++ b/youtube_dl/extractor/mitele.py
@@ -39,13 +39,21 @@ class MiTeleIE(InfoExtractor):
).replace('\'', '"')
embed_data = json.loads(embed_data_json)
- info_url = embed_data['flashvars']['host']
+ domain = embed_data['mediaUrl']
+ if not domain.startswith('http'):
+ # only happens in telecinco.es videos
+ domain = 'http://' + domain
+ info_url = compat_urllib_parse.urljoin(
+ domain,
+ compat_urllib_parse.unquote(embed_data['flashvars']['host'])
+ )
info_el = self._download_xml(info_url, episode).find('./video/info')
video_link = info_el.find('videoUrl/link').text
token_query = compat_urllib_parse.urlencode({'id': video_link})
token_info = self._download_json(
- 'http://token.mitele.es/?' + token_query, episode,
+ embed_data['flashvars']['ov_tk'] + '?' + token_query,
+ episode,
transform_source=strip_jsonp
)