aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/downloader
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-10-24 21:02:31 +0600
committerSergey M․ <dstftw@gmail.com>2015-10-24 21:02:31 +0600
commit8cd9614abf81cb41055142d87158b5eda4353a4d (patch)
tree4da355f7de6165cc5aec1aed713293d8b1f2086c /youtube_dl/downloader
parent324ac0a243c14340f7e4cd909e2e7c62828a2425 (diff)
[downloader/f4m] More accurate fragment URL construction
Diffstat (limited to 'youtube_dl/downloader')
-rw-r--r--youtube_dl/downloader/f4m.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/youtube_dl/downloader/f4m.py b/youtube_dl/downloader/f4m.py
index b8db6bf9b..7f6143954 100644
--- a/youtube_dl/downloader/f4m.py
+++ b/youtube_dl/downloader/f4m.py
@@ -340,11 +340,14 @@ class F4mFD(FragmentFD):
while fragments_list:
seg_i, frag_i = fragments_list.pop(0)
name = 'Seg%d-Frag%d' % (seg_i, frag_i)
- url_parsed = base_url_parsed._replace(path=base_url_parsed.path + name)
+ query = []
+ if base_url_parsed.query:
+ query.append(base_url_parsed.query)
if akamai_pv:
- url_parsed = url_parsed._replace(query=url_parsed.query + akamai_pv.strip(';'))
+ query.append(akamai_pv.strip(';'))
if info_dict.get('extra_param_to_segment_url'):
- url_parsed = url_parsed._replace(query=url_parsed.query + info_dict.get('extra_param_to_segment_url'))
+ query.append(info_dict['extra_param_to_segment_url'])
+ url_parsed = base_url_parsed._replace(path=base_url_parsed.path + name, query='&'.join(query))
frag_filename = '%s-%s' % (ctx['tmpfilename'], name)
try:
success = ctx['dl'].download(frag_filename, {'url': url_parsed.geturl()})