From a1a22572fb968aa90e110798b34c444d894ad24a Mon Sep 17 00:00:00 2001 From: remitamine Date: Tue, 2 Feb 2016 18:12:32 +0100 Subject: [PATCH] [downloader/dash] make initialization_url optional --- youtube_dl/downloader/dash.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/youtube_dl/downloader/dash.py b/youtube_dl/downloader/dash.py index 535f2a7fc..b0070aead 100644 --- a/youtube_dl/downloader/dash.py +++ b/youtube_dl/downloader/dash.py @@ -40,9 +40,10 @@ class DashSegmentsFD(FileDownloader): return '%s%s%s' % (base_url, '' if base_url.endswith('/') else '/', target_url) with open(tmpfilename, 'wb') as outf: - append_url_to_file( - outf, combine_url(base_url, info_dict['initialization_url']), - 'initialization segment') + if info_dict.get('initialization_url'): + append_url_to_file( + outf, combine_url(base_url, info_dict['initialization_url']), + 'initialization segment') for i, segment_url in enumerate(segment_urls): segment_len = append_url_to_file( outf, combine_url(base_url, segment_url), -- 2.39.5