diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-07-31 16:21:01 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-08-01 12:38:05 +0530 |
commit | dbf5416a20b8a4ff301ef6c641f516fa20a546cb (patch) | |
tree | 959c28dd0afea7a2571066765eeb744b5d0a826e /yt_dlp/downloader/dash.py | |
parent | d74a58a186603670f0f8acbc07a54f6381ca267f (diff) | |
download | hypervideo-pre-dbf5416a20b8a4ff301ef6c641f516fa20a546cb.tar.lz hypervideo-pre-dbf5416a20b8a4ff301ef6c641f516fa20a546cb.tar.xz hypervideo-pre-dbf5416a20b8a4ff301ef6c641f516fa20a546cb.zip |
[cleanup] Refactor some code
Diffstat (limited to 'yt_dlp/downloader/dash.py')
-rw-r--r-- | yt_dlp/downloader/dash.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/yt_dlp/downloader/dash.py b/yt_dlp/downloader/dash.py index 9dae6b9bd..ccc41e158 100644 --- a/yt_dlp/downloader/dash.py +++ b/yt_dlp/downloader/dash.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from ..downloader import _get_real_downloader +from ..downloader import get_suitable_downloader from .fragment import FragmentFD from ..utils import urljoin @@ -15,11 +15,14 @@ class DashSegmentsFD(FragmentFD): FD_NAME = 'dashsegments' def real_download(self, filename, info_dict): + if info_dict.get('is_live'): + self.report_error('Live DASH videos are not supported') + fragment_base_url = info_dict.get('fragment_base_url') fragments = info_dict['fragments'][:1] if self.params.get( 'test', False) else info_dict['fragments'] - real_downloader = _get_real_downloader(info_dict, 'dash_frag_urls', self.params, None) + real_downloader = get_suitable_downloader(info_dict, self.params, None, protocol='dash_frag_urls') ctx = { 'filename': filename, @@ -54,9 +57,6 @@ class DashSegmentsFD(FragmentFD): info_copy = info_dict.copy() info_copy['fragments'] = fragments_to_download fd = real_downloader(self.ydl, self.params) - # TODO: Make progress updates work without hooking twice - # for ph in self._progress_hooks: - # fd.add_progress_hook(ph) return fd.real_download(filename, info_copy) return self.download_and_append_fragments(ctx, fragments_to_download, info_dict) |