aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/downloader/hls.py
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2016-08-13 22:53:07 +0100
committerRemita Amine <remitamine@gmail.com>2016-08-13 22:53:41 +0100
commitaaf44a2f47f013e8d864ac9f98b2833904a8be78 (patch)
tree7583b1ef8434768c5bb47055ae5e32edcb809aae /youtube_dl/downloader/hls.py
parentfafabc0712d95e6a5b2ac56e9375fe90060738f5 (diff)
downloadyoutube-dl-aaf44a2f47f013e8d864ac9f98b2833904a8be78.tar.xz
[uplynk] Add new extractor
Diffstat (limited to 'youtube_dl/downloader/hls.py')
-rw-r--r--youtube_dl/downloader/hls.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube_dl/downloader/hls.py b/youtube_dl/downloader/hls.py
index 3b7bb3508..8d7971e5d 100644
--- a/youtube_dl/downloader/hls.py
+++ b/youtube_dl/downloader/hls.py
@@ -20,6 +20,7 @@ from ..utils import (
encodeFilename,
sanitize_open,
parse_m3u8_attributes,
+ update_url_query,
)
@@ -82,6 +83,7 @@ class HlsFD(FragmentFD):
self._prepare_and_start_frag_download(ctx)
+ extra_param_to_segment_url = info_dict.get('extra_param_to_segment_url')
i = 0
media_sequence = 0
decrypt_info = {'METHOD': 'NONE'}
@@ -95,6 +97,8 @@ class HlsFD(FragmentFD):
if re.match(r'^https?://', line)
else compat_urlparse.urljoin(man_url, line))
frag_filename = '%s-Frag%d' % (ctx['tmpfilename'], i)
+ if extra_param_to_segment_url:
+ frag_url = update_url_query(frag_url, extra_param_to_segment_url)
success = ctx['dl'].download(frag_filename, {'url': frag_url})
if not success:
return False
@@ -120,6 +124,8 @@ class HlsFD(FragmentFD):
if not re.match(r'^https?://', decrypt_info['URI']):
decrypt_info['URI'] = compat_urlparse.urljoin(
man_url, decrypt_info['URI'])
+ if extra_param_to_segment_url:
+ decrypt_info['URI'] = update_url_query(decrypt_info['URI'], extra_param_to_segment_url)
decrypt_info['KEY'] = self.ydl.urlopen(decrypt_info['URI']).read()
elif line.startswith('#EXT-X-MEDIA-SEQUENCE'):
media_sequence = int(line[22:])