aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dl/extractor/miomio.py
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2015-11-06 06:33:05 +0100
committerremitamine <remitamine@gmail.com>2015-11-06 06:33:05 +0100
commite68dd1921ad7528d225a8571066f99b9934b6a06 (patch)
tree11d9545d5a6130607e27f8d629a07cb2f10e2ef6 /youtube_dl/extractor/miomio.py
parent6953d8e95a78e83f087693b7353baab96b09fbdd (diff)
downloadyoutube-dl-e68dd1921ad7528d225a8571066f99b9934b6a06.zip
youtube-dl-e68dd1921ad7528d225a8571066f99b9934b6a06.tar.gz
youtube-dl-e68dd1921ad7528d225a8571066f99b9934b6a06.tar.bz2
[miomio] use the formats urls headers for downloading xml
Diffstat (limited to 'youtube_dl/extractor/miomio.py')
-rw-r--r--youtube_dl/extractor/miomio.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/youtube_dl/extractor/miomio.py b/youtube_dl/extractor/miomio.py
index 3f812e0..6f40bf1 100644
--- a/youtube_dl/extractor/miomio.py
+++ b/youtube_dl/extractor/miomio.py
@@ -52,6 +52,8 @@ class MioMioIE(InfoExtractor):
mioplayer_path = self._search_regex(
r'src="(/mioplayer/[^"]+)"', webpage, 'ref_path')
+ http_headers = {'Referer': 'http://www.miomio.tv%s' % mioplayer_path,}
+
xml_config = self._search_regex(
r'flashvars="type=(?:sina|video)&amp;(.+?)&amp;',
webpage, 'xml config')
@@ -63,15 +65,11 @@ class MioMioIE(InfoExtractor):
vid_config_request = compat_urllib_request.Request(
'http://www.miomio.tv/mioplayer/mioplayerconfigfiles/sina.php?{0}'.format(xml_config),
- headers={'Referer': 'http://www.miomio.tv/mioplayer/mioplayer-v3.0.swf'})
+ headers=http_headers)
# the following xml contains the actual configuration information on the video file(s)
vid_config = self._download_xml(vid_config_request, video_id)
- http_headers = {
- 'Referer': 'http://www.miomio.tv%s' % mioplayer_path,
- }
-
if not int_or_none(xpath_text(vid_config, 'timelength')):
raise ExtractorError('Unable to load videos!', expected=True)